add platformio file and fix compiling without IP

This commit is contained in:
Thomas Kunze 2020-05-08 01:50:50 +02:00
parent 16de2048e6
commit 5f4f86dcbd
7 changed files with 41 additions and 4 deletions

7
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,7 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
]
}

27
platformio.ini Normal file
View File

@ -0,0 +1,27 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
src_dir = examples/knx-demo
[env]
platform = atmelsam
board = zeroUSB
framework = arduino
build_type = debug
monitor_speed = 115200
lib_ldf_mode = deep+
lib_extra_dirs =
${sysenv.USERPROFILE}/Documents/PlatformIO/Projects
build_flags =
-Wno-unknown-pragmas
[env:build]

View File

@ -1,6 +1,7 @@
#include "knx_ip_device_information_dib.h" #include "knx_ip_device_information_dib.h"
#include "bits.h" #include "bits.h"
#ifdef USE_IP
KnxIpDeviceInformationDIB::KnxIpDeviceInformationDIB(uint8_t* data) : KnxIpDIB(data) KnxIpDeviceInformationDIB::KnxIpDeviceInformationDIB(uint8_t* data) : KnxIpDIB(data)
{} {}
@ -98,3 +99,4 @@ void KnxIpDeviceInformationDIB::friendlyName(const uint8_t* value)
{ {
pushByteArray(value, LEN_FRIENDLY_NAME, _data + 24); pushByteArray(value, LEN_FRIENDLY_NAME, _data + 24);
} }
#endif

View File

@ -54,7 +54,6 @@ void KnxIpFrame::totalLength(uint16_t length)
{ {
pushWord(length, _data + 4); pushWord(length, _data + 4);
} }
#endif
uint8_t* KnxIpFrame::data() uint8_t* KnxIpFrame::data()
{ {
@ -79,3 +78,4 @@ KnxIpFrame::KnxIpFrame(uint16_t length)
protocolVersion(KnxIp1_0); protocolVersion(KnxIp1_0);
totalLength(length); totalLength(length);
} }
#endif

View File

@ -1,8 +1,6 @@
#include "knx_ip_search_response.h" #include "knx_ip_search_response.h"
#ifdef USE_IP #ifdef USE_IP
#endif
#define SERVICE_FAMILIES 2 #define SERVICE_FAMILIES 2
KnxIpSearchResponse::KnxIpSearchResponse(IpParameterObject& parameters, DeviceObject& deviceObject) KnxIpSearchResponse::KnxIpSearchResponse(IpParameterObject& parameters, DeviceObject& deviceObject)
@ -61,3 +59,4 @@ KnxIpSupportedServiceDIB& KnxIpSearchResponse::supportedServices()
{ {
return _supportedServices; return _supportedServices;
} }
#endif

View File

@ -1,5 +1,6 @@
#include "knx_ip_supported_service_dib.h" #include "knx_ip_supported_service_dib.h"
#ifdef USE_IP
KnxIpSupportedServiceDIB::KnxIpSupportedServiceDIB(uint8_t* data) : KnxIpDIB(data) KnxIpSupportedServiceDIB::KnxIpSupportedServiceDIB(uint8_t* data) : KnxIpDIB(data)
{} {}
@ -39,3 +40,4 @@ void KnxIpSupportedServiceDIB::serviceVersion(ServiceFamily family, uint8_t ver
} }
} }
} }
#endif

View File

@ -526,7 +526,7 @@ struct tm KNXValue::timeValue() const
return *timePtr; return *timePtr;
} }
} }
struct tm tmp; struct tm tmp = {0};
return tmp; return tmp;
} }