From 5f4f86dcbdbfe216024073617963cc478546f601 Mon Sep 17 00:00:00 2001 From: Thomas Kunze Date: Fri, 8 May 2020 01:50:50 +0200 Subject: [PATCH] add platformio file and fix compiling without IP --- .vscode/extensions.json | 7 ++++++ platformio.ini | 27 +++++++++++++++++++++++ src/knx/knx_ip_device_information_dib.cpp | 2 ++ src/knx/knx_ip_frame.cpp | 2 +- src/knx/knx_ip_search_response.cpp | 3 +-- src/knx/knx_ip_supported_service_dib.cpp | 2 ++ src/knx/knx_value.cpp | 2 +- 7 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 .vscode/extensions.json create mode 100644 platformio.ini diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..e80666b --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "platformio.platformio-ide" + ] +} diff --git a/platformio.ini b/platformio.ini new file mode 100644 index 0000000..23ac4f9 --- /dev/null +++ b/platformio.ini @@ -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] diff --git a/src/knx/knx_ip_device_information_dib.cpp b/src/knx/knx_ip_device_information_dib.cpp index 8d5cf95..c6a5aa5 100644 --- a/src/knx/knx_ip_device_information_dib.cpp +++ b/src/knx/knx_ip_device_information_dib.cpp @@ -1,6 +1,7 @@ #include "knx_ip_device_information_dib.h" #include "bits.h" +#ifdef USE_IP 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); } +#endif \ No newline at end of file diff --git a/src/knx/knx_ip_frame.cpp b/src/knx/knx_ip_frame.cpp index fad20ac..9cf1ce2 100644 --- a/src/knx/knx_ip_frame.cpp +++ b/src/knx/knx_ip_frame.cpp @@ -54,7 +54,6 @@ void KnxIpFrame::totalLength(uint16_t length) { pushWord(length, _data + 4); } -#endif uint8_t* KnxIpFrame::data() { @@ -79,3 +78,4 @@ KnxIpFrame::KnxIpFrame(uint16_t length) protocolVersion(KnxIp1_0); totalLength(length); } +#endif \ No newline at end of file diff --git a/src/knx/knx_ip_search_response.cpp b/src/knx/knx_ip_search_response.cpp index 8f436a4..ba3968e 100644 --- a/src/knx/knx_ip_search_response.cpp +++ b/src/knx/knx_ip_search_response.cpp @@ -1,8 +1,6 @@ #include "knx_ip_search_response.h" #ifdef USE_IP -#endif - #define SERVICE_FAMILIES 2 KnxIpSearchResponse::KnxIpSearchResponse(IpParameterObject& parameters, DeviceObject& deviceObject) @@ -61,3 +59,4 @@ KnxIpSupportedServiceDIB& KnxIpSearchResponse::supportedServices() { return _supportedServices; } +#endif \ No newline at end of file diff --git a/src/knx/knx_ip_supported_service_dib.cpp b/src/knx/knx_ip_supported_service_dib.cpp index 2e73d69..a4afbd4 100644 --- a/src/knx/knx_ip_supported_service_dib.cpp +++ b/src/knx/knx_ip_supported_service_dib.cpp @@ -1,5 +1,6 @@ #include "knx_ip_supported_service_dib.h" +#ifdef USE_IP KnxIpSupportedServiceDIB::KnxIpSupportedServiceDIB(uint8_t* data) : KnxIpDIB(data) {} @@ -39,3 +40,4 @@ void KnxIpSupportedServiceDIB::serviceVersion(ServiceFamily family, uint8_t ver } } } +#endif \ No newline at end of file diff --git a/src/knx/knx_value.cpp b/src/knx/knx_value.cpp index 7b6f93a..22d3e85 100644 --- a/src/knx/knx_value.cpp +++ b/src/knx/knx_value.cpp @@ -526,7 +526,7 @@ struct tm KNXValue::timeValue() const return *timePtr; } } - struct tm tmp; + struct tm tmp = {0}; return tmp; }