Commit 2013d9d1 authored by João Lino's avatar João Lino

added a template to print the contents of variables, in debug mode.

parent 79b4a630
...@@ -82,6 +82,17 @@ ...@@ -82,6 +82,17 @@
// ++++++++++++++++++++++++ ENUM +++++++++++++++++++++++++++++++++ // ++++++++++++++++++++++++ ENUM +++++++++++++++++++++++++++++++++
#include "CustomDataStructures.h" #include "CustomDataStructures.h"
// ######################### TEMPLATES #########################
// ++++++++++++++++++++++++ Debug ++++++++++++++++++++++++
template <class T> void debugPrintVar( char *name, const T& value );
template <class T> void debugPrintVar( char *name, const T& value ) {
Serial.print("[");
Serial.print(name);
Serial.print(":");
Serial.print(value);
Serial.println("]");
}
// ######################### VARIABLES ######################### // ######################### VARIABLES #########################
// ++++++++++++++++++++++++ State Machine ++++++++++++++++++++++++ // ++++++++++++++++++++++++ State Machine ++++++++++++++++++++++++
eRotaryEncoderMode rotaryEncoderMode; eRotaryEncoderMode rotaryEncoderMode;
...@@ -885,6 +896,12 @@ void xCountTheTime( int temperatureRange ) { ...@@ -885,6 +896,12 @@ void xCountTheTime( int temperatureRange ) {
// Check if the machine is in the right temperature range, for the current mode, // Check if the machine is in the right temperature range, for the current mode,
if(!(basePT100.getCurrentTemperature() > (cookTemperature - temperatureRange) && basePT100.getCurrentTemperature() < (cookTemperature + temperatureRange))) { if(!(basePT100.getCurrentTemperature() > (cookTemperature - temperatureRange) && basePT100.getCurrentTemperature() < (cookTemperature + temperatureRange))) {
clockIgnore += millis() - clockStartTime - clockCounter; clockIgnore += millis() - clockStartTime - clockCounter;
#ifdef DEBUG
Serial.print("[clockIgnore:");
Serial.print(clockIgnore);
Serial.println("]");
debugPrintVar("clockIgnore", clockIgnore);
#endif
} }
// Calculate the remaining time on the clock // Calculate the remaining time on the clock
...@@ -1354,3 +1371,4 @@ void lcdPrint(String title, String message) { ...@@ -1354,3 +1371,4 @@ void lcdPrint(String title, String message) {
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment