fix hw abstraction defs
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
// Implement these as functions or macros
|
||||
/*
|
||||
#define hwDigitalWrite(__pin, __value)
|
||||
#define hwInit() Serial.begin(BAUD_RATE)
|
||||
#define hwInit() MY_SERIALDEVICE.begin(BAUD_RATE)
|
||||
#define hwWatchdogReset() wdt_reset()
|
||||
#define hwReboot() wdt_enable(WDTO_15MS); while (1)
|
||||
#define hwMillis() millis()
|
||||
|
||||
@@ -78,7 +78,7 @@ void hwPowerDown(period_t period) {
|
||||
void hwInternalSleep(unsigned long ms) {
|
||||
// Let serial prints finish (debug, log etc)
|
||||
#ifndef MY_DISABLED_SERIAL
|
||||
Serial.flush();
|
||||
MY_SERIALDEVICE.flush();
|
||||
#endif
|
||||
// reset interrupt trigger var
|
||||
pinIntTrigger = 0;
|
||||
@@ -188,7 +188,7 @@ void hwDebugPrint(const char *fmt, ... ) {
|
||||
#ifdef MY_GATEWAY_FEATURE
|
||||
// prepend debug message to be handled correctly by controller (C_INTERNAL, I_LOG_MESSAGE)
|
||||
snprintf_P(fmtBuffer, 299, PSTR("0;255;%d;0;%d;"), C_INTERNAL, I_LOG_MESSAGE);
|
||||
Serial.print(fmtBuffer);
|
||||
MY_SERIALDEVICE.print(fmtBuffer);
|
||||
#endif
|
||||
va_list args;
|
||||
va_start (args, fmt );
|
||||
@@ -202,10 +202,10 @@ void hwDebugPrint(const char *fmt, ... ) {
|
||||
vsnprintf_P(fmtBuffer, 299, fmt, args);
|
||||
#endif
|
||||
va_end (args);
|
||||
Serial.print(fmtBuffer);
|
||||
Serial.flush();
|
||||
MY_SERIALDEVICE.print(fmtBuffer);
|
||||
MY_SERIALDEVICE.flush();
|
||||
|
||||
//Serial.write(freeRam());
|
||||
//MY_SERIALDEVICE.write(freeRam());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ do { \
|
||||
// Define these as macros to save valuable space
|
||||
|
||||
#define hwDigitalWrite(__pin, __value) (digitalWrite(__pin, __value))
|
||||
#define hwInit() Serial.begin(MY_BAUD_RATE)
|
||||
#define hwInit() MY_SERIALDEVICE.begin(MY_BAUD_RATE)
|
||||
#define hwWatchdogReset() wdt_reset()
|
||||
#define hwReboot() wdt_enable(WDTO_15MS); while (1)
|
||||
#define hwMillis() millis()
|
||||
|
||||
@@ -132,7 +132,7 @@ void hwDebugPrint(const char *fmt, ... ) {
|
||||
#ifdef MY_GATEWAY_FEATURE
|
||||
// prepend debug message to be handled correctly by controller (C_INTERNAL, I_LOG_MESSAGE)
|
||||
snprintf_P(fmtBuffer, 299, PSTR("0;255;%d;0;%d;"), C_INTERNAL, I_LOG_MESSAGE);
|
||||
Serial.print(fmtBuffer);
|
||||
MY_SERIALDEVICE.print(fmtBuffer);
|
||||
#endif
|
||||
va_list args;
|
||||
va_start (args, fmt );
|
||||
@@ -146,9 +146,9 @@ void hwDebugPrint(const char *fmt, ... ) {
|
||||
vsnprintf_P(fmtBuffer, 299, fmt, args);
|
||||
#endif
|
||||
va_end (args);
|
||||
Serial.print(fmtBuffer);
|
||||
Serial.flush();
|
||||
MY_SERIALDEVICE.print(fmtBuffer);
|
||||
MY_SERIALDEVICE.flush();
|
||||
|
||||
//Serial.write(freeRam());
|
||||
//MY_SERIALDEVICE.write(freeRam());
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
// Define these as macros to save valuable space
|
||||
|
||||
#define hwDigitalWrite(__pin, __value) (digitalWrite(__pin, __value))
|
||||
#define hwInit() Serial.begin(MY_BAUD_RATE); Serial.setDebugOutput(true)
|
||||
#define hwInit() MY_SERIALDEVICE.begin(MY_BAUD_RATE); MY_SERIALDEVICE.setDebugOutput(true)
|
||||
#define hwWatchdogReset() wdt_reset()
|
||||
#define hwReboot() wdt_enable(WDTO_15MS); while (1)
|
||||
#define hwMillis() millis()
|
||||
|
||||
@@ -162,7 +162,7 @@ void hwDebugPrint(const char *fmt, ... ) {
|
||||
MY_SERIALDEVICE.print(fmtBuffer);
|
||||
// MY_SERIALDEVICE.flush();
|
||||
|
||||
//Serial.write(freeRam());
|
||||
//MY_SERIALDEVICE.write(freeRam());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user