From f4fa0af8d83d2a2da329d1dc5cee9e334bee0472 Mon Sep 17 00:00:00 2001
From: schneider <schneider@blinkenlichts.net>
Date: Wed, 15 Sep 2021 03:33:07 +0200
Subject: [PATCH] change(pycardium): Increase systick interval to 1 second

---
 pycardium/mphalport.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/pycardium/mphalport.c b/pycardium/mphalport.c
index b17e9ca32..ede4bae73 100644
--- a/pycardium/mphalport.c
+++ b/pycardium/mphalport.c
@@ -20,9 +20,13 @@
 #include <stdio.h>
 #include <string.h>
 
-// Smallest interval which can be reached exactly
-// * 8 to allow up to 100 ms epic calls
-#define SYSTICK_INTERVAL_US (15625ULL * 8ULL)
+/* Smallest integer us interval which can be reached exactly due
+ * to the 32768 Hz systick frequency */
+#define SYSTICK_INTERVAL_US_MIN 15625
+
+/* Target systick interval is 1 second */
+#define SYSTICK_INTERVAL_US                                                    \
+	(SYSTICK_INTERVAL_US_MIN * (1000000 / SYSTICK_INTERVAL_US_MIN))
 
 /*
  * Copied from core_cm4.h and modified to select the
-- 
GitLab