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 @@
// ++++++++++++++++++++++++ ENUM +++++++++++++++++++++++++++++++++
#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 #########################
// ++++++++++++++++++++++++ State Machine ++++++++++++++++++++++++
eRotaryEncoderMode rotaryEncoderMode;
......@@ -885,6 +896,12 @@ void xCountTheTime( int temperatureRange ) {
// Check if the machine is in the right temperature range, for the current mode,
if(!(basePT100.getCurrentTemperature() > (cookTemperature - temperatureRange) && basePT100.getCurrentTemperature() < (cookTemperature + temperatureRange))) {
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
......@@ -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