From a5f7fd8d2946fa6830deff1e6784e8b2be7cbb1c Mon Sep 17 00:00:00 2001
From: jaseg <git@jaseg.net>
Date: Tue, 24 Apr 2018 11:38:19 +0200
Subject: Small firmware code prettification

---
 firmware/main.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

(limited to 'firmware')

diff --git a/firmware/main.c b/firmware/main.c
index bffe0c0..81ae15f 100644
--- a/firmware/main.c
+++ b/firmware/main.c
@@ -66,9 +66,6 @@ uint32_t sys_time_seconds = 0;
 #define A TIMER_CYCLES_FOR_SPI_TRANSMISSIONS
 #define B 40
 
-/* This is a constant offset containing some empirically determined correction values */
-#define C 0
-
 /* This lookup table maps bit positions to timer period values. This is a lookup table to allow for the compensation for
  * non-linear effects of ringing at lower bit durations.
  */
@@ -79,15 +76,15 @@ static uint16_t timer_period_lookup[NBITS] = {
     A + 9,
     A + 29,
     A + 71,
-    A - C + (B<< 2),
-    A - C + (B<< 3),
-    A - C + (B<< 4),
-    A - C + (B<< 5),
-    A - C + (B<< 6),
-    A - C + (B<< 7),
-    A - C + (B<< 8),
-    A - C + (B<< 9),
-    A - C + (B<<10),
+    A + (B<< 2),
+    A + (B<< 3),
+    A + (B<< 4),
+    A + (B<< 5),
+    A + (B<< 6),
+    A + (B<< 7),
+    A + (B<< 8),
+    A + (B<< 9),
+    A + (B<<10),
     /* MSB here */
 };
 
-- 
cgit