diff --git a/brew.ino b/brew.ino index 5db1e2e740b20b2bd71a92a1ad47cae10ce0df1b..32b76028fc637b82328a40126db3f63de1354fee 100644 --- a/brew.ino +++ b/brew.ino @@ -82,6 +82,17 @@ // ++++++++++++++++++++++++ ENUM +++++++++++++++++++++++++++++++++ #include "CustomDataStructures.h" +// ######################### TEMPLATES ######################### +// ++++++++++++++++++++++++ Debug ++++++++++++++++++++++++ +template void debugPrintVar( char *name, const T& value ); +template 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) { } } +