mirror of
https://github.com/thelsing/knx.git
synced 2025-01-02 00:06:43 +01:00
Fix int32 -> KNXValue conversion (#128)
Add KNX_NO_SPI to reduce footprint
This commit is contained in:
parent
44075d80f7
commit
446ea1b9aa
@ -2,7 +2,9 @@
|
|||||||
#include "knx/bits.h"
|
#include "knx/bits.h"
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
#ifndef KNX_NO_SPI
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
Stream* ArduinoPlatform::SerialDebug = &Serial;
|
Stream* ArduinoPlatform::SerialDebug = &Serial;
|
||||||
|
|
||||||
@ -94,6 +96,7 @@ size_t ArduinoPlatform::readBytesUart(uint8_t *buffer, size_t length)
|
|||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef KNX_NO_SPI
|
||||||
void ArduinoPlatform::setupSpi()
|
void ArduinoPlatform::setupSpi()
|
||||||
{
|
{
|
||||||
SPI.begin();
|
SPI.begin();
|
||||||
@ -111,6 +114,7 @@ int ArduinoPlatform::readWriteSpi(uint8_t *data, size_t len)
|
|||||||
SPI.transfer(data, len);
|
SPI.transfer(data, len);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef KNX_NO_PRINT
|
#ifndef KNX_NO_PRINT
|
||||||
void printUint64(uint64_t value, int base = DEC)
|
void printUint64(uint64_t value, int base = DEC)
|
||||||
|
@ -24,10 +24,11 @@ class ArduinoPlatform : public Platform
|
|||||||
virtual size_t readBytesUart(uint8_t* buffer, size_t length);
|
virtual size_t readBytesUart(uint8_t* buffer, size_t length);
|
||||||
|
|
||||||
//spi
|
//spi
|
||||||
|
#ifndef KNX_NO_SPI
|
||||||
void setupSpi() override;
|
void setupSpi() override;
|
||||||
void closeSpi() override;
|
void closeSpi() override;
|
||||||
int readWriteSpi (uint8_t *data, size_t len) override;
|
int readWriteSpi (uint8_t *data, size_t len) override;
|
||||||
|
#endif
|
||||||
static Stream* SerialDebug;
|
static Stream* SerialDebug;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -187,7 +187,7 @@ KNXValue& KNXValue::operator=(const int16_t value)
|
|||||||
|
|
||||||
KNXValue& KNXValue::operator=(const int32_t value)
|
KNXValue& KNXValue::operator=(const int32_t value)
|
||||||
{
|
{
|
||||||
_value.boolValue = value;
|
_value.intValue = value;
|
||||||
_type = IntType;
|
_type = IntType;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user