[ion] Calibrate msleep / usleep for N0101

This commit is contained in:
Léa Saviot
2019-03-21 13:18:17 +01:00
parent c4c2643b53
commit a656b80089

View File

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