diff options
| author | hathach <[email protected]> | 2018-03-30 15:33:36 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-03-30 15:33:36 +0700 |
| commit | 82da013dadf2b2f69f362702ca40708fdec52df4 (patch) | |
| tree | bfa9a73206ace7aca38dbf008a8277a6ea2d20bc /hw | |
| parent | 97db3c7c3d7cfbbb19dbda09809aa39bb19608b9 (diff) | |
get freertos build
Diffstat (limited to 'hw')
| -rw-r--r-- | hw/bsp/board.h | 2 | ||||
| -rw-r--r-- | hw/bsp/ea4357/board_ea4357.c | 2 | ||||
| -rw-r--r-- | hw/bsp/pca10056/board_pca10056.c | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/hw/bsp/board.h b/hw/bsp/board.h index 2c566bb11..827f22d7e 100644 --- a/hw/bsp/board.h +++ b/hw/bsp/board.h @@ -123,6 +123,8 @@ #define BOARD_TICKS_HZ 1000 +#define board_tick2ms(tck) ( ( ((uint64_t)(tck)) * 1000) / BOARD_TICKS_HZ ) + //--------------------------------------------------------------------+ // Board Common API //--------------------------------------------------------------------+ diff --git a/hw/bsp/ea4357/board_ea4357.c b/hw/bsp/ea4357/board_ea4357.c index 963e7629c..549eb70f7 100644 --- a/hw/bsp/ea4357/board_ea4357.c +++ b/hw/bsp/ea4357/board_ea4357.c @@ -79,7 +79,7 @@ void SysTick_Handler (void) uint32_t tusb_hal_millis(void) { - return (system_ticks*1000) / BOARD_TICKS_HZ; + return board_tick2ms(system_ticks); } #endif diff --git a/hw/bsp/pca10056/board_pca10056.c b/hw/bsp/pca10056/board_pca10056.c index 98071429b..e1668ebb5 100644 --- a/hw/bsp/pca10056/board_pca10056.c +++ b/hw/bsp/pca10056/board_pca10056.c @@ -63,7 +63,7 @@ uint32_t tusb_hal_millis(void) //#define tick2ms(tck) ( ( ((uint64_t)(tck)) * 1000) / configTICK_RATE_HZ ) //return tick2ms( app_timer_cnt_get() ); - return (system_ticks*1000) / BOARD_TICKS_HZ; + return board_tick2ms(system_ticks); } /*------------------------------------------------------------------*/ |
