cc3200: Correct udelay us to ticks calculation.

This commit is contained in:
Daniel Campora 2015-07-08 13:13:37 +02:00
parent d18ced9cdd
commit 9220dc466a
3 changed files with 6 additions and 8 deletions

View File

@ -64,11 +64,11 @@
#define BOOTMGR_HASH_SIZE 32 #define BOOTMGR_HASH_SIZE 32
#define BOOTMGR_BUFF_SIZE 512 #define BOOTMGR_BUFF_SIZE 512
#define BOOTMGR_WAIT_SAFE_MODE_MS 1200 #define BOOTMGR_WAIT_SAFE_MODE_MS 2400
#define BOOTMGR_WAIT_SAFE_MODE_TOOGLE_MS 200 #define BOOTMGR_WAIT_SAFE_MODE_TOOGLE_MS 400
#define BOOTMGR_SAFE_MODE_ENTER_MS 800 #define BOOTMGR_SAFE_MODE_ENTER_MS 1600
#define BOOTMGR_SAFE_MODE_ENTER_TOOGLE_MS 80 #define BOOTMGR_SAFE_MODE_ENTER_TOOGLE_MS 160
//***************************************************************************** //*****************************************************************************
// Exported functions declarations // Exported functions declarations

View File

@ -123,9 +123,7 @@ void HAL_Delay(uint32_t delay) {
#endif #endif
} else { } else {
for (int ms = 0; ms < delay; ms++) { for (int ms = 0; ms < delay; ms++) {
// 500 instead of 1000 us to compensate the overhead of the for loop UtilsDelay(UTILS_DELAY_US_TO_COUNT(1000));
// and the function call
UtilsDelay(UTILS_DELAY_US_TO_COUNT(500));
} }
} }
} }

View File

@ -37,7 +37,7 @@
#define HAL_FCPU_MHZ 80U #define HAL_FCPU_MHZ 80U
#define HAL_FCPU_HZ (1000000U * HAL_FCPU_MHZ) #define HAL_FCPU_HZ (1000000U * HAL_FCPU_MHZ)
#define HAL_SYSTICK_PERIOD_US 1000U #define HAL_SYSTICK_PERIOD_US 1000U
#define UTILS_DELAY_US_TO_COUNT(us) (((us) * HAL_FCPU_MHZ) / 3) #define UTILS_DELAY_US_TO_COUNT(us) (((us) * HAL_FCPU_MHZ) / 6)
#define HAL_NVIC_INT_CTRL_REG (*((volatile uint32_t *) 0xE000ED04 ) ) #define HAL_NVIC_INT_CTRL_REG (*((volatile uint32_t *) 0xE000ED04 ) )
#define HAL_VECTACTIVE_MASK (0x1FUL) #define HAL_VECTACTIVE_MASK (0x1FUL)