Opencv 3.1 project on GR-PEACH board
Fork of gr-peach-opencv-project by
platform/mbed_wait_api_no_rtos.c@170:54ff26da7eb6, 2017-07-04 (annotated)
- Committer:
- thedo
- Date:
- Tue Jul 04 06:23:13 2017 +0000
- Revision:
- 170:54ff26da7eb6
- Parent:
- 167:1657b442184c
project opencv 3.1 on GR PEACH board, no use SD card.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
thedo | 167:1657b442184c | 1 | /* mbed Microcontroller Library |
thedo | 167:1657b442184c | 2 | * Copyright (c) 2006-2013 ARM Limited |
thedo | 167:1657b442184c | 3 | * |
thedo | 167:1657b442184c | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
thedo | 167:1657b442184c | 5 | * you may not use this file except in compliance with the License. |
thedo | 167:1657b442184c | 6 | * You may obtain a copy of the License at |
thedo | 167:1657b442184c | 7 | * |
thedo | 167:1657b442184c | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
thedo | 167:1657b442184c | 9 | * |
thedo | 167:1657b442184c | 10 | * Unless required by applicable law or agreed to in writing, software |
thedo | 167:1657b442184c | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
thedo | 167:1657b442184c | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
thedo | 167:1657b442184c | 13 | * See the License for the specific language governing permissions and |
thedo | 167:1657b442184c | 14 | * limitations under the License. |
thedo | 167:1657b442184c | 15 | */ |
thedo | 167:1657b442184c | 16 | |
thedo | 167:1657b442184c | 17 | // This implementation of the wait functions will be compiled only |
thedo | 167:1657b442184c | 18 | // if the RTOS is not present. |
thedo | 167:1657b442184c | 19 | #ifndef MBED_CONF_RTOS_PRESENT |
thedo | 167:1657b442184c | 20 | |
thedo | 167:1657b442184c | 21 | #include "platform/mbed_wait_api.h" |
thedo | 167:1657b442184c | 22 | #include "hal/us_ticker_api.h" |
thedo | 167:1657b442184c | 23 | |
thedo | 167:1657b442184c | 24 | void wait(float s) { |
thedo | 167:1657b442184c | 25 | wait_us(s * 1000000.0f); |
thedo | 167:1657b442184c | 26 | } |
thedo | 167:1657b442184c | 27 | |
thedo | 167:1657b442184c | 28 | void wait_ms(int ms) { |
thedo | 167:1657b442184c | 29 | wait_us(ms * 1000); |
thedo | 167:1657b442184c | 30 | } |
thedo | 167:1657b442184c | 31 | |
thedo | 167:1657b442184c | 32 | void wait_us(int us) { |
thedo | 167:1657b442184c | 33 | uint32_t start = us_ticker_read(); |
thedo | 167:1657b442184c | 34 | while ((us_ticker_read() - start) < (uint32_t)us); |
thedo | 167:1657b442184c | 35 | } |
thedo | 167:1657b442184c | 36 | |
thedo | 167:1657b442184c | 37 | #endif // #ifndef MBED_CONF_RTOS_PRESENT |
thedo | 167:1657b442184c | 38 | |
thedo | 167:1657b442184c | 39 |