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:
- 11:6e15cc2b2328
- Parent:
- 10:f48cc6be5ae8
- Parent:
- 8:5e70ca85fcb1
- Child:
- 12:258fc423e0fd
--- a/main.cpp Sun Sep 02 18:12:59 2018 -0700 +++ b/main.cpp Sun Sep 02 18:14:47 2018 -0700 @@ -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()); 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; logToPC();