mirror of
https://github.com/thelsing/knx.git
synced 2024-12-18 19:08:18 +01:00
Tweak for Ram usage (#129)
* Add KNX_NO_DEFAULT_UART to avoid default uart assignation for ArduinoPlatforms and derivatives, with associated defines (HWSERIAL_NONE for stm32) to recover RAM from unused RX/TX buffers Remove ArduinoPlatform(HardwareSerial* knxSerial) constructor, seems not useable by KnxFacade * Restore ArduinoPlatform::ArduinoPlatform(HardwareSerial* knxSerial) constructor * revert xxxPlatform(HardwareSerial* s) constructors
This commit is contained in:
parent
446ea1b9aa
commit
036bd54c79
@ -6,7 +6,13 @@
|
||||
#include <SPI.h>
|
||||
#endif
|
||||
|
||||
#ifndef KNX_NO_PRINT
|
||||
Stream* ArduinoPlatform::SerialDebug = &Serial;
|
||||
#endif
|
||||
|
||||
ArduinoPlatform::ArduinoPlatform() : _knxSerial(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
ArduinoPlatform::ArduinoPlatform(HardwareSerial* knxSerial) : _knxSerial(knxSerial)
|
||||
{
|
||||
@ -29,6 +35,7 @@ void ArduinoPlatform::fatalError()
|
||||
|
||||
void ArduinoPlatform::knxUart( HardwareSerial* serial )
|
||||
{
|
||||
if (_knxSerial)
|
||||
closeUart();
|
||||
_knxSerial = serial;
|
||||
setupUart();
|
||||
|
@ -2,11 +2,10 @@
|
||||
|
||||
#include "Arduino.h"
|
||||
|
||||
extern Stream& _serialDBG;
|
||||
|
||||
class ArduinoPlatform : public Platform
|
||||
{
|
||||
public:
|
||||
ArduinoPlatform();
|
||||
ArduinoPlatform(HardwareSerial* knxSerial);
|
||||
|
||||
// basic stuff
|
||||
@ -29,7 +28,9 @@ class ArduinoPlatform : public Platform
|
||||
void closeSpi() override;
|
||||
int readWriteSpi (uint8_t *data, size_t len) override;
|
||||
#endif
|
||||
#ifndef KNX_NO_PRINT
|
||||
static Stream* SerialDebug;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
HardwareSerial* _knxSerial;
|
||||
|
@ -6,7 +6,10 @@
|
||||
|
||||
#include "knx/bits.h"
|
||||
|
||||
Esp32Platform::Esp32Platform() : ArduinoPlatform(&Serial1)
|
||||
Esp32Platform::Esp32Platform()
|
||||
#ifndef KNX_NO_DEFAULT_UART
|
||||
: ArduinoPlatform(&Serial1)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,10 @@
|
||||
|
||||
#include "knx/bits.h"
|
||||
|
||||
EspPlatform::EspPlatform() : ArduinoPlatform(&Serial)
|
||||
EspPlatform::EspPlatform()
|
||||
#ifndef KNX_NO_DEFAULT_UART
|
||||
: ArduinoPlatform(&Serial)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,10 @@
|
||||
#include <Arduino.h>
|
||||
#include <FlashAsEEPROM.h>
|
||||
|
||||
SamdPlatform::SamdPlatform() : ArduinoPlatform(&Serial1)
|
||||
SamdPlatform::SamdPlatform()
|
||||
#ifndef KNX_NO_DEFAULT_UART
|
||||
: ArduinoPlatform(&Serial1)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,10 @@
|
||||
#include <stm32_eeprom.h>
|
||||
#include "knx/bits.h"
|
||||
|
||||
Stm32Platform::Stm32Platform() : ArduinoPlatform(&Serial2)
|
||||
Stm32Platform::Stm32Platform()
|
||||
#ifndef KNX_NO_DEFAULT_UART
|
||||
: ArduinoPlatform(&Serial2)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user