Charles Young's development fork. Going forward I only want to push mature code to main repository.
Fork of GEO_COUNTER_L432KC by
Diff: main.cpp
- Revision:
- 8:5e70ca85fcb1
- Parent:
- 7:9f975e00600c
- Child:
- 9:af4f55093f49
- Child:
- 11:6e15cc2b2328
--- a/main.cpp Sun Sep 02 17:47:14 2018 -0700 +++ b/main.cpp Mon Sep 03 01:00:36 2018 +0000 @@ -38,7 +38,7 @@ #define CNT2 0x20 #define HV 0x40 #define MENU 0x80 -uint8_t LED_statuses [CPM, CPS, PLS, VOLTS, CNT1, CNT2, HV, MENU]; +uint8_t LED_statuses[] = {CPM, CPS, PLS, VOLTS, CNT1, CNT2, HV, MENU}; uint8_t LED_status = CPM; uint8_t LED_status_index = 0; @@ -135,7 +135,7 @@ // set the 1 sec ticker to periodically call the Update() routine // NOTE: this is also the 1-sec time base for counters. A better approach // would replace the ticker with an interrupt from the RTC (to be implemented) - Sec_Beat.attach_us(&Update, 1000000); + Sec_Beat.attach_us(&Update, 100000); //RTC::attach(&Update, RTC::Second); //RTC::detach(RTC::Second); @@ -225,10 +225,10 @@ WheelCurrent = int(Wheel.getPulses()); PC.printf(" started %d", WheelCurrent); if (WheelCurrent > WheelPrevious) - LED_status_index++ | sizeof(LED_statuses); + LED_status_index = ++LED_status_index % sizeof(LED_statuses); else if (WheelCurrent < WheelPrevious) - LED_status_index-- | sizeof(LED_statuses); + LED_status_index = --LED_status_index % sizeof(LED_statuses); WheelPrevious = WheelCurrent; return;