Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy Lehnen committed Mar 27, 2016
2 parents 707bec5 + 64cf55d commit 016336a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 34 deletions.
42 changes: 21 additions & 21 deletions ShotTimer/DebugMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
{
Expand All @@ -68,7 +68,7 @@
}
}
//println
void serialPrintln_p(const char* kStr) {
void serial_println_p(const char* kStr) {
char c;
if (!kStr)
{
Expand All @@ -78,7 +78,7 @@
{
Serial.print(c);
}
serialPrint_p(kNewlineStr); //Serial.print("\n");
serial_print_p(kNewlineStr); //Serial.print("\n");
}

////////////////////////////////////////////////////////////
Expand All @@ -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()
Expand Down
26 changes: 13 additions & 13 deletions ShotTimer/ShotTimer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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 >>";
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 016336a

Please sign in to comment.