Merge pull request #7070 from ithinuel/increase_tolerance_for_systick_less_devices

set the tolerance to 5% if NO_SYSTICK is enabled
pull/6969/merge
Cruz Monrreal 2018-06-04 10:42:04 -05:00 committed by GitHub
commit 583d77f04d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -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