Bugfix, change debug uart not possible (#33)

* bugfix, print not allowed in constructor

* Update tpuart_data_link_layer.cpp

- start confirm timout only after last byte was sent
- increase BYTE_TIMEOUT

* -bugfix, change debug Uart not possible

* Update esp32_platform.cpp

* Update esp_platform.cpp

* Update knx-bme680.ino

* Update knx-demo.ino

* Update knx-hdc1008.ino

* Update knx-sonoffS20.ino
This commit is contained in:
Bernator 2019-09-09 20:10:56 +02:00 committed by thelsing
parent 7cdc104b29
commit afd07d10cb
9 changed files with 36 additions and 36 deletions

View File

@ -43,7 +43,7 @@ bool trigger = false;
void setup(void) void setup(void)
{ {
Serial.begin(115200); Serial.begin(115200);
ArduinoPlatform::SerialDebug = Serial; ArduinoPlatform::SerialDebug = &Serial;
delay(5000); delay(5000);
Serial.println("start"); Serial.println("start");

View File

@ -55,7 +55,7 @@ void resetCallback(GroupObject& go)
void setup() void setup()
{ {
Serial.begin(115200); Serial.begin(115200);
ArduinoPlatform::SerialDebug = Serial; ArduinoPlatform::SerialDebug = &Serial;
randomSeed(millis()); randomSeed(millis());

View File

@ -22,7 +22,7 @@ uint32_t cyclSend = 0;
void setup(void) void setup(void)
{ {
Serial.begin(115200); Serial.begin(115200);
ArduinoPlatform::SerialDebug = Serial; ArduinoPlatform::SerialDebug = &Serial;
delay(5000); delay(5000);
Serial.println("start"); Serial.println("start");

View File

@ -25,7 +25,7 @@ void switchCallback(GroupObject& go)
void setup() void setup()
{ {
Serial.begin(115200); Serial.begin(115200);
ArduinoPlatform::SerialDebug = Serial; ArduinoPlatform::SerialDebug = &Serial;
#ifdef ARDUINO_ARCH_ESP8266 #ifdef ARDUINO_ARCH_ESP8266
WiFiManager wifiManager; WiFiManager wifiManager;

View File

@ -3,7 +3,7 @@
#include <Arduino.h> #include <Arduino.h>
Stream& ArduinoPlatform::SerialDebug = Serial; Stream* ArduinoPlatform::SerialDebug = &Serial;
ArduinoPlatform::ArduinoPlatform(HardwareSerial* knxSerial) : _knxSerial(knxSerial) ArduinoPlatform::ArduinoPlatform(HardwareSerial* knxSerial) : _knxSerial(knxSerial)
{ {
@ -139,134 +139,134 @@ size_t ArduinoPlatform::readBytesUart(uint8_t *buffer, size_t length)
void print(const char* s) void print(const char* s)
{ {
ArduinoPlatform::SerialDebug.print(s); ArduinoPlatform::SerialDebug->print(s);
} }
void print(char c) void print(char c)
{ {
ArduinoPlatform::SerialDebug.print(c); ArduinoPlatform::SerialDebug->print(c);
} }
void print(unsigned char num) void print(unsigned char num)
{ {
ArduinoPlatform::SerialDebug.print(num); ArduinoPlatform::SerialDebug->print(num);
} }
void print(unsigned char num, int base) void print(unsigned char num, int base)
{ {
ArduinoPlatform::SerialDebug.print(num, base); ArduinoPlatform::SerialDebug->print(num, base);
} }
void print(int num) void print(int num)
{ {
ArduinoPlatform::SerialDebug.print(num); ArduinoPlatform::SerialDebug->print(num);
} }
void print(int num, int base) void print(int num, int base)
{ {
ArduinoPlatform::SerialDebug.print(num, base); ArduinoPlatform::SerialDebug->print(num, base);
} }
void print(unsigned int num) void print(unsigned int num)
{ {
ArduinoPlatform::SerialDebug.print(num); ArduinoPlatform::SerialDebug->print(num);
} }
void print(unsigned int num, int base) void print(unsigned int num, int base)
{ {
ArduinoPlatform::SerialDebug.print(num, base); ArduinoPlatform::SerialDebug->print(num, base);
} }
void print(long num) void print(long num)
{ {
ArduinoPlatform::SerialDebug.print(num); ArduinoPlatform::SerialDebug->print(num);
} }
void print(long num, int base) void print(long num, int base)
{ {
ArduinoPlatform::SerialDebug.print(num, base); ArduinoPlatform::SerialDebug->print(num, base);
} }
void print(unsigned long num) void print(unsigned long num)
{ {
ArduinoPlatform::SerialDebug.print(num); ArduinoPlatform::SerialDebug->print(num);
} }
void print(unsigned long num, int base) void print(unsigned long num, int base)
{ {
ArduinoPlatform::SerialDebug.print(num, base); ArduinoPlatform::SerialDebug->print(num, base);
} }
void print(double num) void print(double num)
{ {
ArduinoPlatform::SerialDebug.print(num); ArduinoPlatform::SerialDebug->print(num);
} }
void println(const char* s) void println(const char* s)
{ {
ArduinoPlatform::SerialDebug.println(s); ArduinoPlatform::SerialDebug->println(s);
} }
void println(char c) void println(char c)
{ {
ArduinoPlatform::SerialDebug.println(c); ArduinoPlatform::SerialDebug->println(c);
} }
void println(unsigned char num) void println(unsigned char num)
{ {
ArduinoPlatform::SerialDebug.println(num); ArduinoPlatform::SerialDebug->println(num);
} }
void println(unsigned char num, int base) void println(unsigned char num, int base)
{ {
ArduinoPlatform::SerialDebug.println(num, base); ArduinoPlatform::SerialDebug->println(num, base);
} }
void println(int num) void println(int num)
{ {
ArduinoPlatform::SerialDebug.println(num); ArduinoPlatform::SerialDebug->println(num);
} }
void println(int num, int base) void println(int num, int base)
{ {
ArduinoPlatform::SerialDebug.println(num, base); ArduinoPlatform::SerialDebug->println(num, base);
} }
void println(unsigned int num) void println(unsigned int num)
{ {
ArduinoPlatform::SerialDebug.println(num); ArduinoPlatform::SerialDebug->println(num);
} }
void println(unsigned int num, int base) void println(unsigned int num, int base)
{ {
ArduinoPlatform::SerialDebug.println(num, base); ArduinoPlatform::SerialDebug->println(num, base);
} }
void println(long num) void println(long num)
{ {
ArduinoPlatform::SerialDebug.println(num); ArduinoPlatform::SerialDebug->println(num);
} }
void println(long num, int base) void println(long num, int base)
{ {
ArduinoPlatform::SerialDebug.println(num, base); ArduinoPlatform::SerialDebug->println(num, base);
} }
void println(unsigned long num) void println(unsigned long num)
{ {
ArduinoPlatform::SerialDebug.println(num); ArduinoPlatform::SerialDebug->println(num);
} }
void println(unsigned long num, int base) void println(unsigned long num, int base)
{ {
ArduinoPlatform::SerialDebug.println(num, base); ArduinoPlatform::SerialDebug->println(num, base);
} }
void println(double num) void println(double num)
{ {
ArduinoPlatform::SerialDebug.println(num); ArduinoPlatform::SerialDebug->println(num);
} }
void println(void) void println(void)
{ {
ArduinoPlatform::SerialDebug.println(); ArduinoPlatform::SerialDebug->println();
} }

View File

@ -35,7 +35,7 @@ class ArduinoPlatform : public Platform
virtual int readUart(); virtual int readUart();
virtual size_t readBytesUart(uint8_t* buffer, size_t length); virtual size_t readBytesUart(uint8_t* buffer, size_t length);
static Stream& SerialDebug; static Stream* SerialDebug;
protected: protected:
uint32_t _mulitcastAddr; uint32_t _mulitcastAddr;

View File

@ -36,7 +36,7 @@ void Esp32Platform::macAddress(uint8_t * addr)
void Esp32Platform::restart() void Esp32Platform::restart()
{ {
ArduinoPlatform::SerialDebug.println("restart"); println("restart");
ESP.restart(); ESP.restart();
} }

View File

@ -37,7 +37,7 @@ void EspPlatform::macAddress(uint8_t * addr)
void EspPlatform::restart() void EspPlatform::restart()
{ {
ArduinoPlatform::SerialDebug.println("restart"); println("restart");
ESP.reset(); ESP.reset();
} }

View File

@ -16,7 +16,7 @@ SamdPlatform::SamdPlatform( HardwareSerial* s) : ArduinoPlatform(s)
void SamdPlatform::restart() void SamdPlatform::restart()
{ {
ArduinoPlatform::SerialDebug.println("restart"); println("restart");
NVIC_SystemReset(); NVIC_SystemReset();
} }