From b7d27e31e8c5d34aaba7e2a7070bb3b6fb082d28 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 6 Feb 2017 11:14:16 +1100 Subject: cc3200: Refactor "ticks" functions to use common extmod implementation. The port now uses the common mp_utime_ticks_{ms,us,cpu,add,diff} functions from extmod/utime_mphal.c. The mp_utime_sleep_XXX functions are still cc3200-specific because they handle the GIL differently to the ones in extmod. The files misc/mpsystick.[ch] have been removed because they contain 2 unused functions, and the other remaining function is renamed to mp_hal_ticks_us and moved to hal/cc3200_hal.c. --- cc3200/hal/cc3200_hal.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cc3200/hal/cc3200_hal.h') diff --git a/cc3200/hal/cc3200_hal.h b/cc3200/hal/cc3200_hal.h index 9715096b6..fcb85b292 100644 --- a/cc3200/hal/cc3200_hal.h +++ b/cc3200/hal/cc3200_hal.h @@ -30,6 +30,9 @@ #include #include +#include "hal/utils.h" +#include "hal/systick.h" + /****************************************************************************** DEFINE CONSTANTS ******************************************************************************/ @@ -64,4 +67,7 @@ extern void HAL_SystemDeInit (void); extern void HAL_IncrementTick(void); extern void mp_hal_set_interrupt_char (int c); +#define mp_hal_delay_us(usec) UtilsDelay(UTILS_DELAY_US_TO_COUNT(usec)) +#define mp_hal_ticks_cpu() (SysTickPeriodGet() - SysTickValueGet()) + #endif /* CC3200_LAUNCHXL_HAL_CC3200_HAL_H_ */ -- cgit v1.2.3