diff --git a/ShotTimer/DebugMacros.h b/ShotTimer/DebugMacros.h index f982b2a..3eca23c 100644 --- a/ShotTimer/DebugMacros.h +++ b/ShotTimer/DebugMacros.h @@ -42,11 +42,11 @@ //////////////////////////////////////////////////////////// ////////////////////////////// - // freeRam() - Check available dynamic memory - + // FreeRam() - Check available dynamic memory - // http://playground.arduino.cc/Code/AvailableMemory ////////////////////////////// - int freeRam() { + int free_ram() { extern int __heap_start, *__brkval; int v; return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); @@ -56,7 +56,7 @@ // Serial PROGMEM Helpers - Print a string from PROGMEM to Serial output ////////////////////////////// - void serialPrint_p(const char* kStr) { + void serial_print_p(const char* kStr) { char c; if (!kStr) { @@ -68,7 +68,7 @@ } } //println - void serialPrintln_p(const char* kStr) { + void serial_println_p(const char* kStr) { char c; if (!kStr) { @@ -78,7 +78,7 @@ { Serial.print(c); } - serialPrint_p(kNewlineStr); //Serial.print("\n"); + serial_print_p(kNewlineStr); //Serial.print("\n"); } //////////////////////////////////////////////////////////// @@ -94,36 +94,36 @@ Serial.print(str); #define DEBUG_PRINTLN(str, bl) \ if (bl > 0) { \ - serialPrint_p(kMillisStr); \ + serial_print_p(kMillisStr); \ Serial.print(millis()); \ - serialPrint_p(kBytesStr); \ - Serial.print(freeRam()); \ - serialPrint_p(kColStr); \ + serial_print_p(kBytesStr); \ + Serial.print(FreeRam()); \ + serial_print_p(kColStr); \ Serial.print(__PRETTY_FUNCTION__); \ - serialPrint_p(kSpaceStr); \ + serial_print_p(kSpaceStr); \ Serial.print(__FILE__); \ - serialPrint_p(kColStr); \ + serial_print_p(kColStr); \ Serial.print(__LINE__); \ - serialPrint_p(kSpaceStr); \ + serial_print_p(kSpaceStr); \ } \ Serial.println(str); #define DEBUG_PRINT_P(str) \ - serialPrint_p(str); + serial_print_p(str); #define DEBUG_PRINTLN_P(str, bl) \ if (bl > 0) { \ - serialPrint_p(kMillisStr); \ + serial_print_p(kMillisStr); \ Serial.print(millis()); \ - serialPrint_p(kBytesStr); \ - Serial.print(freeRam()); \ - serialPrint_p(kColStr); \ + serial_print_p(kBytesStr); \ + Serial.print(FreeRam()); \ + serial_print_p(kColStr); \ Serial.print(__PRETTY_FUNCTION__); \ - serialPrint_p(kSpaceStr); \ + serial_print_p(kSpaceStr); \ Serial.print(__FILE__); \ - serialPrint_p(kColStr); \ + serial_print_p(kColStr); \ Serial.print(__LINE__); \ - serialPrint_p(kSpaceStr); \ + serial_print_p(kSpaceStr); \ } \ - serialPrintln_p(str); + serial_println_p(str); #else #define DEBUG_SETUP() diff --git a/ShotTimer/ShotTimer.ino b/ShotTimer/ShotTimer.ino index 7e6a9fb..bf698da 100644 --- a/ShotTimer/ShotTimer.ino +++ b/ShotTimer/ShotTimer.ino @@ -142,7 +142,7 @@ const int16_p PROGMEM kBeepNote = NOTE_C4; // https://github.com/Chris--A/PGMWrap/blob/master/examples/advanced/use_within_classes/use_within_classes.ino // More detailed example of dealing with strings and arrays in PROGMEM: // http://www.gammon.com.au/progmem -const char PROGMEM kMainName[] = "Shot Timer v.3"; +const char PROGMEM kMainName[] = "Shot Timer v.2"; const char PROGMEM kStartName[] = "[Start]"; const char PROGMEM kReviewName[] = "[Review]"; const char PROGMEM kParName[] = "Set Par >>"; @@ -997,11 +997,11 @@ void on_menu_par_times_selected(MenuItem* p_menu_item) { } ////////////////////////////// -// ParUp() +// ParDown() ////////////////////////////// -void ParUp() { - DEBUG_PRINTLN(F("ParUp()"), 0); +void ParDown() { + DEBUG_PRINTLN(F("ParDown()"), 0); if (g_current_par == 0) { g_current_par = kParLimit - 1; } @@ -1022,11 +1022,11 @@ void ParUp() { } ////////////////////////////// -// ParDown() +// ParUp() ////////////////////////////// -void ParDown() { - DEBUG_PRINTLN(F("ParDown()"), 1); +void ParUp() { + DEBUG_PRINTLN(F("ParUp()"), 1); DEBUG_PRINTLN(kParLimit,0); if (g_current_par == kParLimit - 1) { g_current_par = 0; @@ -1492,14 +1492,14 @@ void ButtonListener(Adafruit_RGBLCDShield* g_lcd, NextShot(); break; case BUTTON_DOWN: - DEBUG_PRINTLN(F("DOWN/NextShot()"), 0); - NextShot(); + DEBUG_PRINTLN(F("DOWN/PreviousShot()"), 0); + PreviousShot(); //@TODO<-- Maybe I should be building a shot string class, with //functions, rather than using functions to operate on a global array. break; case BUTTON_UP: - DEBUG_PRINTLN(F("UP/PreviousShot()"), 0); - PreviousShot(); + DEBUG_PRINTLN(F("UP/NextShot()"), 0); + NextShot(); break; } break; @@ -1631,11 +1631,11 @@ void ButtonListener(Adafruit_RGBLCDShield* g_lcd, break; case BUTTON_DOWN: DEBUG_PRINTLN(F("DOWN/DecreaseBeepVol()"), 0); - IncreaseBeepVol(); + DecreaseBeepVol(); break; case BUTTON_UP: DEBUG_PRINTLN(F("UP/IncreaseBeepVol()"), 0); - DecreaseBeepVol(); + IncreaseBeepVol(); break; } break;