From a656b80089644ae2c39bce8a1ee2b3d8049d35ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Thu, 21 Mar 2019 13:18:17 +0100 Subject: [PATCH] [ion] Calibrate msleep / usleep for N0101 --- ion/src/device/n0101/drivers/config/timing.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ion/src/device/n0101/drivers/config/timing.h b/ion/src/device/n0101/drivers/config/timing.h index 747611b5c..fcd1b4ff2 100644 --- a/ion/src/device/n0101/drivers/config/timing.h +++ b/ion/src/device/n0101/drivers/config/timing.h @@ -8,12 +8,12 @@ namespace Device { namespace Timing { namespace Config { -// TODO: calibrate msleep -constexpr static int LoopsPerMillisecond = 8852; -constexpr static int LoopsPerMicrosecond = 9; +constexpr static int LoopsPerMillisecond = 4426; +constexpr static int LoopsPerMicrosecond = 36; // CPU clock is 96 MHz, and systick clock source is divided by 8 // To get 1 ms systick overflow we need to reset it to // 96 000 000 (Hz) / 8 / 1 000 (ms/s) - 1 (because the counter resets *after* counting to 0) +// TODO: calibrate systick constexpr static int SysTickPerMillisecond = 12000;