mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #7070 from ithinuel/increase_tolerance_for_systick_less_devices
set the tolerance to 5% if NO_SYSTICK is enabledpull/6969/merge
commit
583d77f04d
|
@ -45,9 +45,15 @@ extern uint32_t SystemCoreClock;
|
|||
* 1000 ms delay: tolerance = 20500 us
|
||||
*
|
||||
* */
|
||||
#define DELTA_US(delay_ms) (500 + (delay_ms) * US_PER_MSEC / 50)
|
||||
#define DELTA_MS(delay_ms) (1 + ((delay_ms) * US_PER_MSEC / 50 / US_PER_MSEC))
|
||||
#define DELTA_S(delay_ms) (0.000500f + (((float)(delay_ms)) / MSEC_PER_SEC / 50))
|
||||
#ifdef NO_SYSTICK
|
||||
#define TOLERANCE 5
|
||||
#else
|
||||
#define TOLERANCE 2
|
||||
#endif
|
||||
|
||||
#define DELTA_US(delay_ms) (500 + (delay_ms) * US_PER_MSEC * TOLERANCE / 100)
|
||||
#define DELTA_MS(delay_ms) (1 + (delay_ms) * TOLERANCE / 100)
|
||||
#define DELTA_S(delay_ms) (0.000500f + ((float)(delay_ms)) * ((float)(TOLERANCE) / 100.f) / MSEC_PER_SEC)
|
||||
|
||||
#define TICKER_FREQ_1MHZ 1000000
|
||||
#define TICKER_BITS 32
|
||||
|
|
Loading…
Reference in New Issue