From 51dcb7b9dfa1a0c3d0b588c316cd28d142e65068 Mon Sep 17 00:00:00 2001 From: sidey79 <7968127+sidey79@users.noreply.github.com> Date: Thu, 16 Jul 2020 22:42:59 +0200 Subject: [PATCH] Version 3.4 zum Master machen (#143) * SIGNALDuino.ino | SIGNALESP.ino - FIX: If duration is greater than maxPulse it could happen that the timer time for the cronjob timer becomes negative (or a big value if it is unsigned) * Set ArduinoJson Version to the desired one * commands.h - fixed output of version after ping response * FIX names * fixed: value of success must be saved before calling reset() * NEW: Settings if LED_BUILTIN on WEMOS boards as PIN_LED * PlattformIO Support incl. STM Support (#138) * signalesp.h - prevent crash if first char is a linebreak or # - fixed crash with ; as command - modified connection handling - Implement a Wifi reconnect event to restart the telnet server (#136 ) - FIX: Min. timer time for cronTimer is 1ms * commands.h - added dumpEEPROM when doing factory reset - FIX: unsupported command caused a crash - add 0x17 chipid * Arduino IDE compatibility - Added sym links to project files to support arduino compatible layout * changed esp8266 core version to 2.6.3 * cc1101.cpp - Added wait_miso call after select to repair factory reset * SimpleFIFO.h - enqueue: ICACHE_RAM_ATTR added to support usage via interrupt * send.h - fix unexpected serial print until null termination char is found - cleanup some code * signalDecoder/src/signalDecoder.cpp - prevents crashes * Update some compile errors * ESP32 support (#134) * Maple Mini (stm32f103cbt6) support (#136) * FIX: strobe commands register (#140) * Update / fix deploy travis config (#142) updated yml for successful deployment of release fixed some yaml warnings on travis --- .travis.yml | 116 +++-- README.md | 15 +- __vm/.SIGNALDuino.vsarduino.h | 122 +++-- build.sh | 2 +- cc1101.h | 192 -------- compile_config.h | 82 ---- custom_hwids.py | 10 + deploy.sh | 0 platformio.ini | 439 ++++++++++++++++++ .../libraries/SimpleFIFO/src/SimpleFIFO.h | 6 +- src/_micro-api/libraries/WIFIManager | 2 +- src/_micro-api/libraries/output/src/output.h | 30 +- .../signalDecoder/src/signalDecoder.cpp | 4 + .../signalDecoder/src/signalDecoder.h | 7 + src/arduino-ide/SIGNALDuino/ArduinoJson.h | 1 + src/arduino-ide/SIGNALDuino/ArduinoJson.hpp | 1 + .../SIGNALDuino/ArduinoJson/Configuration.hpp | 1 + .../SIGNALDuino/ArduinoJson/Data/Encoding.hpp | 1 + .../ArduinoJson/Data/JsonBufferAllocated.hpp | 1 + .../ArduinoJson/Data/JsonFloat.hpp | 1 + .../ArduinoJson/Data/JsonInteger.hpp | 1 + .../ArduinoJson/Data/JsonVariantAs.hpp | 1 + .../ArduinoJson/Data/JsonVariantContent.hpp | 1 + .../ArduinoJson/Data/JsonVariantDefault.hpp | 1 + .../ArduinoJson/Data/JsonVariantType.hpp | 1 + .../SIGNALDuino/ArduinoJson/Data/List.hpp | 1 + .../ArduinoJson/Data/ListConstIterator.hpp | 1 + .../ArduinoJson/Data/ListIterator.hpp | 1 + .../SIGNALDuino/ArduinoJson/Data/ListNode.hpp | 1 + .../ArduinoJson/Data/NonCopyable.hpp | 1 + .../ArduinoJson/Data/ReferenceType.hpp | 1 + .../ArduinoJson/Data/ValueSaver.hpp | 1 + .../ArduinoJson/Deserialization/Comments.hpp | 1 + .../Deserialization/JsonParser.hpp | 1 + .../Deserialization/JsonParserImpl.hpp | 1 + .../Deserialization/StringWriter.hpp | 1 + .../ArduinoJson/DynamicJsonBuffer.hpp | 1 + .../SIGNALDuino/ArduinoJson/JsonArray.hpp | 1 + .../SIGNALDuino/ArduinoJson/JsonArrayImpl.hpp | 1 + .../ArduinoJson/JsonArraySubscript.hpp | 1 + .../SIGNALDuino/ArduinoJson/JsonBuffer.hpp | 1 + .../ArduinoJson/JsonBufferBase.hpp | 1 + .../ArduinoJson/JsonBufferImpl.hpp | 1 + .../SIGNALDuino/ArduinoJson/JsonObject.hpp | 1 + .../ArduinoJson/JsonObjectImpl.hpp | 1 + .../ArduinoJson/JsonObjectSubscript.hpp | 1 + .../SIGNALDuino/ArduinoJson/JsonPair.hpp | 1 + .../SIGNALDuino/ArduinoJson/JsonVariant.hpp | 1 + .../ArduinoJson/JsonVariantBase.hpp | 1 + .../ArduinoJson/JsonVariantCasts.hpp | 1 + .../ArduinoJson/JsonVariantComparisons.hpp | 1 + .../ArduinoJson/JsonVariantImpl.hpp | 1 + .../SIGNALDuino/ArduinoJson/JsonVariantOr.hpp | 1 + .../ArduinoJson/JsonVariantSubscripts.hpp | 1 + .../ArduinoJson/Polyfills/attributes.hpp | 1 + .../ArduinoJson/Polyfills/ctype.hpp | 1 + .../ArduinoJson/Polyfills/isFloat.hpp | 1 + .../ArduinoJson/Polyfills/isInteger.hpp | 1 + .../ArduinoJson/Polyfills/math.hpp | 1 + .../ArduinoJson/Polyfills/parseFloat.hpp | 1 + .../ArduinoJson/Polyfills/parseInteger.hpp | 1 + .../SIGNALDuino/ArduinoJson/RawJson.hpp | 1 + .../ArduinoJson/Serialization/DummyPrint.hpp | 1 + .../Serialization/DynamicStringBuilder.hpp | 1 + .../ArduinoJson/Serialization/FloatParts.hpp | 1 + .../Serialization/IndentedPrint.hpp | 1 + .../Serialization/JsonPrintable.hpp | 1 + .../Serialization/JsonSerializer.hpp | 1 + .../Serialization/JsonSerializerImpl.hpp | 1 + .../ArduinoJson/Serialization/JsonWriter.hpp | 1 + .../ArduinoJson/Serialization/Prettyfier.hpp | 1 + .../Serialization/StaticStringBuilder.hpp | 1 + .../Serialization/StreamPrintAdapter.hpp | 1 + .../ArduinoJson/StaticJsonBuffer.hpp | 1 + .../StringTraits/ArduinoStream.hpp | 1 + .../ArduinoJson/StringTraits/CharPointer.hpp | 1 + .../ArduinoJson/StringTraits/FlashString.hpp | 1 + .../ArduinoJson/StringTraits/StdStream.hpp | 1 + .../ArduinoJson/StringTraits/StdString.hpp | 1 + .../ArduinoJson/StringTraits/StringTraits.hpp | 1 + .../ArduinoJson/TypeTraits/EnableIf.hpp | 1 + .../ArduinoJson/TypeTraits/FloatTraits.hpp | 1 + .../ArduinoJson/TypeTraits/IsArray.hpp | 1 + .../ArduinoJson/TypeTraits/IsBaseOf.hpp | 1 + .../ArduinoJson/TypeTraits/IsChar.hpp | 1 + .../ArduinoJson/TypeTraits/IsConst.hpp | 1 + .../TypeTraits/IsFloatingPoint.hpp | 1 + .../ArduinoJson/TypeTraits/IsIntegral.hpp | 1 + .../ArduinoJson/TypeTraits/IsSame.hpp | 1 + .../TypeTraits/IsSignedIntegral.hpp | 1 + .../TypeTraits/IsUnsignedIntegral.hpp | 1 + .../ArduinoJson/TypeTraits/IsVariant.hpp | 1 + .../ArduinoJson/TypeTraits/RemoveConst.hpp | 1 + .../TypeTraits/RemoveReference.hpp | 1 + .../SIGNALDuino/ArduinoJson/version.hpp | 1 + src/arduino-ide/SIGNALDuino/FastDelegate.h | 1 + .../SIGNALDuino/FastDelegateBind.h | 1 + src/arduino-ide/SIGNALDuino/SIGNALDuino.ino | 1 + src/arduino-ide/SIGNALDuino/SimpleFIFO.cpp | 1 + src/arduino-ide/SIGNALDuino/SimpleFIFO.h | 1 + src/arduino-ide/SIGNALDuino/TimerOne.cpp | 1 + src/arduino-ide/SIGNALDuino/TimerOne.h | 1 + src/arduino-ide/SIGNALDuino/WiFiManager.cpp | 1 + src/arduino-ide/SIGNALDuino/WiFiManager.h | 1 + src/arduino-ide/SIGNALDuino/bitstore.cpp | 1 + src/arduino-ide/SIGNALDuino/bitstore.h | 1 + src/arduino-ide/SIGNALDuino/cc1101.cpp | 1 + src/arduino-ide/SIGNALDuino/cc1101.h | 1 + src/arduino-ide/SIGNALDuino/commands.h | 1 + src/arduino-ide/SIGNALDuino/compile_config.h | 1 + .../SIGNALDuino/config/known_16bit_timers.h | 1 + src/arduino-ide/SIGNALDuino/functions.h | 1 + src/arduino-ide/SIGNALDuino/main.h | 1 + src/arduino-ide/SIGNALDuino/output.h | 1 + src/arduino-ide/SIGNALDuino/send.h | 1 + src/arduino-ide/SIGNALDuino/signalDecoder.cpp | 1 + src/arduino-ide/SIGNALDuino/signalDecoder.h | 1 + src/arduino-ide/SIGNALDuino/signalSTM.h | 1 + src/arduino-ide/SIGNALDuino/signalduino.h | 1 + src/arduino-ide/SIGNALDuino/signalesp.h | 1 + src/arduino-ide/SIGNALDuino/strings_en.h | 1 + src/arduino-ide/SIGNALDuino/wifi-config.h | 1 + cc1101.cpp => src/cc1101.cpp | 257 +++++----- src/cc1101.h | 208 +++++++++ commands.h => src/commands.h | 26 +- src/compile_config.h | 111 +++++ functions.h => src/functions.h | 47 +- src/main.cpp | 1 + src/main.h | 5 + send.h => src/send.h | 15 +- src/signalSTM.h | 329 +++++++++++++ SIGNALDuino.ino => src/signalduino.h | 24 +- SIGNALESP.ino => src/signalesp.h | 136 ++++-- wifi-config.h => src/wifi-config.h | 4 +- tests/CMakeLists.txt | 6 +- 135 files changed, 1732 insertions(+), 572 deletions(-) mode change 100644 => 100755 build.sh delete mode 100644 cc1101.h delete mode 100644 compile_config.h create mode 100644 custom_hwids.py mode change 100644 => 100755 deploy.sh create mode 100644 platformio.ini create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson.h create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Configuration.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Data/Encoding.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonBufferAllocated.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonFloat.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonInteger.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonVariantAs.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonVariantContent.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonVariantDefault.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonVariantType.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Data/List.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Data/ListConstIterator.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Data/ListIterator.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Data/ListNode.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Data/NonCopyable.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Data/ReferenceType.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Data/ValueSaver.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Deserialization/Comments.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Deserialization/JsonParser.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Deserialization/JsonParserImpl.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Deserialization/StringWriter.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/DynamicJsonBuffer.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/JsonArray.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/JsonArrayImpl.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/JsonArraySubscript.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/JsonBuffer.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/JsonBufferBase.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/JsonBufferImpl.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/JsonObject.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/JsonObjectImpl.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/JsonObjectSubscript.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/JsonPair.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariant.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantBase.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantCasts.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantComparisons.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantImpl.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantOr.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantSubscripts.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/attributes.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/ctype.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/isFloat.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/isInteger.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/math.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/parseFloat.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/parseInteger.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/RawJson.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/DummyPrint.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/DynamicStringBuilder.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/FloatParts.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/IndentedPrint.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/JsonPrintable.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/JsonSerializer.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/JsonSerializerImpl.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/JsonWriter.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/Prettyfier.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/StaticStringBuilder.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/StreamPrintAdapter.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/StaticJsonBuffer.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/ArduinoStream.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/CharPointer.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/FlashString.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/StdStream.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/StdString.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/StringTraits.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/EnableIf.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/FloatTraits.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsArray.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsBaseOf.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsChar.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsConst.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsFloatingPoint.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsIntegral.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsSame.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsSignedIntegral.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsUnsignedIntegral.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsVariant.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/RemoveConst.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/RemoveReference.hpp create mode 120000 src/arduino-ide/SIGNALDuino/ArduinoJson/version.hpp create mode 120000 src/arduino-ide/SIGNALDuino/FastDelegate.h create mode 120000 src/arduino-ide/SIGNALDuino/FastDelegateBind.h create mode 100644 src/arduino-ide/SIGNALDuino/SIGNALDuino.ino create mode 120000 src/arduino-ide/SIGNALDuino/SimpleFIFO.cpp create mode 120000 src/arduino-ide/SIGNALDuino/SimpleFIFO.h create mode 120000 src/arduino-ide/SIGNALDuino/TimerOne.cpp create mode 120000 src/arduino-ide/SIGNALDuino/TimerOne.h create mode 120000 src/arduino-ide/SIGNALDuino/WiFiManager.cpp create mode 120000 src/arduino-ide/SIGNALDuino/WiFiManager.h create mode 120000 src/arduino-ide/SIGNALDuino/bitstore.cpp create mode 120000 src/arduino-ide/SIGNALDuino/bitstore.h create mode 120000 src/arduino-ide/SIGNALDuino/cc1101.cpp create mode 120000 src/arduino-ide/SIGNALDuino/cc1101.h create mode 120000 src/arduino-ide/SIGNALDuino/commands.h create mode 120000 src/arduino-ide/SIGNALDuino/compile_config.h create mode 120000 src/arduino-ide/SIGNALDuino/config/known_16bit_timers.h create mode 120000 src/arduino-ide/SIGNALDuino/functions.h create mode 120000 src/arduino-ide/SIGNALDuino/main.h create mode 120000 src/arduino-ide/SIGNALDuino/output.h create mode 120000 src/arduino-ide/SIGNALDuino/send.h create mode 120000 src/arduino-ide/SIGNALDuino/signalDecoder.cpp create mode 120000 src/arduino-ide/SIGNALDuino/signalDecoder.h create mode 120000 src/arduino-ide/SIGNALDuino/signalSTM.h create mode 120000 src/arduino-ide/SIGNALDuino/signalduino.h create mode 120000 src/arduino-ide/SIGNALDuino/signalesp.h create mode 120000 src/arduino-ide/SIGNALDuino/strings_en.h create mode 120000 src/arduino-ide/SIGNALDuino/wifi-config.h rename cc1101.cpp => src/cc1101.cpp (56%) create mode 100644 src/cc1101.h rename commands.h => src/commands.h (95%) create mode 100644 src/compile_config.h rename functions.h => src/functions.h (87%) create mode 100644 src/main.cpp create mode 100644 src/main.h rename send.h => src/send.h (97%) create mode 100644 src/signalSTM.h rename SIGNALDuino.ino => src/signalduino.h (94%) rename SIGNALESP.ino => src/signalesp.h (84%) rename wifi-config.h => src/wifi-config.h (97%) diff --git a/.travis.yml b/.travis.yml index cddfc2c9..2419dfcc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,15 @@ language: cpp -sudo: required +os: linux +dist: xenial env: - matrix: + jobs: env: - BOARD=nano328 RECEIVER=cc1101 - - BOARD=radiono RECEIVER=cc1101 - - BOARD=promini + - BOARD=radiono RECEIVER=cc1101 + - BOARD=promini + - BOARD=ESP32 RECEIVER=cc1101 - BOARD=ESP8266 RECEIVER=cc1101 + - BOARD=MAPLEMINI_F103CB RECEIVER=cc1101 global: # - IDE_VERSION=1.8.8 - secure: JuFfMHl8rC9ZeUF2LWHvWb99xWHn7e+sQcGiFkUrVztrmH6L18r7wyOdCbEpxdHJphQdsBPj6S0qnA4RXuKoMizAQfEmZ01v9ZPXr1y6A+QF+ri3M2ZMicwEUfyT80oPUp+o33HPE7cKG8sq8eM4qlALTFf4VL8QsM4DLyMuZlfkMLa1SkglA6Z7W15Ftm3kPxzFqHt7g/Y0QbFus9NrmS28pE3uZKzMjPvMv5Uyq47Ua6dRGV8brXutN9qsx1La87VtunelOECE1s8RvkjuLVlcQS2YmGkqRWSdGQPKVnK4pH3EtJDZ3010hRfJCus02VsGXNqssDmfOYv8JxS/7TxI6d88VS+YpKrqWfsZ3e9KWL4SiCaTuh3V3OG3iddYWuU13dyZeXviJVaSmKcm0AKs+WdugsApB691d6wQ19ujPwdIaeR9+K68b7jjMJeftkYuheMY4iJHteJO10E5m1BC/VDl8ptWSFdGPmGRTV+uzhJINLkzuc/p8vj/XQh4lcCwssxvfYy1qF5xD+gmtpEvzHNN/lAy3AsJdAf+Ay1PC/3Uo5WP9NtlsYwY6QadDpM4fyObGCapTsLDf7J3sgD1YpZSUvjdDSFz4C8TbXCHfiogcCR+fPKrlctqNX76VnE871pAUdF45E33gFKTndL6s3E8EHmJFiLGVeMJp9Q= @@ -17,20 +20,20 @@ script: before_install: - mkdir $PWD/SIGNALDuino # - find $PWD/src/_micro-api/libraries -maxdepth 1 -depth -type d -not -name "libraries" | xargs -i find {}/src/ -maxdepth 1 -not -name "src" -not -name "examples" | xargs cp -a -t $PWD/SIGNALDuino/; - - find $PWD -maxdepth 1 -name "*.h" -or -name "*.cpp" -or -name "*.ino" | xargs cp -a -t $PWD/SIGNALDuino/ +# - find $PWD -maxdepth 1 -name "*.h" -or -name "*.cpp" -or -name "*.ino" | xargs cp -a -t $PWD/SIGNALDuino/ - wget http://downloads.arduino.cc/arduino-$IDE_VERSION-linux64.tar.xz install: - tar xf arduino-$IDE_VERSION-linux64.tar.xz; - sudo mv arduino-$IDE_VERSION /usr/local/share/arduino; - sudo ln -s /usr/local/share/arduino/arduino /usr/local/bin/arduino; - - ln -s $PWD/src/_micro-api/libraries/bitstore /usr/local/share/arduino/libraries/bitstore - - ln -s $PWD/src/_micro-api/libraries/output /usr/local/share/arduino/libraries/output - - ln -s $PWD/src/_micro-api/libraries/signalDecoder /usr/local/share/arduino/libraries/signalDecoder - - ln -s $PWD/src/_micro-api/libraries/SimpleFIFO /usr/local/share/arduino/libraries/simpleFIFO - - ln -s $PWD/src/_micro-api/libraries/fastdelegate /usr/local/share/arduino/libraries/fastdelegate - - ln -s $PWD/src/_micro-api/libraries/TimerOne /usr/local/share/arduino/libraries/TimerOne - - ln -s $PWD/src/_micro-api/libraries/WIFIManager /usr/local/share/arduino/libraries/WIFIManager - - ln -s $PWD/src/_micro-api/libraries/ArduinoJson /usr/local/share/arduino/libraries/ArduinoJson +# - ln -s $PWD/src/_micro-api/libraries/bitstore /usr/local/share/arduino/libraries/bitstore +# - ln -s $PWD/src/_micro-api/libraries/output /usr/local/share/arduino/libraries/output +# - ln -s $PWD/src/_micro-api/libraries/signalDecoder /usr/local/share/arduino/libraries/signalDecoder +# - ln -s $PWD/src/_micro-api/libraries/SimpleFIFO /usr/local/share/arduino/libraries/simpleFIFO +# - ln -s $PWD/src/_micro-api/libraries/fastdelegate /usr/local/share/arduino/libraries/fastdelegate +# - ln -s $PWD/src/_micro-api/libraries/TimerOne /usr/local/share/arduino/libraries/TimerOne +# - ln -s $PWD/src/_micro-api/libraries/WIFIManager /usr/local/share/arduino/libraries/WIFIManager +# - ln -s $PWD/src/_micro-api/libraries/ArduinoJson /usr/local/share/arduino/libraries/ArduinoJson - arduino --pref "compiler.warning_level=all" --save-prefs; - mkdir $PWD/release; - arduino --pref "build.path=$PWD/release" --save-prefs; @@ -49,50 +52,68 @@ before_deploy: - chmod +x ./deploy.sh; deploy: # - ./deploy.sh - skip_cleanup: true provider: releases - api_key: + skip_cleanup: true + draft: true + prerelease: true + token: secure: X2FfofClmMfz7Uch6QZYcBCDHfRblljHjMioNOvZdRU0eL1SapPnbCAL4Aff5eox4loJHm0sjRMemCXEDWkbgGxIjGqYaXe9eLdQn/jXUMuGlF+UgWxJsU5xj0kvMA3e6qMD/8gwnmfCFmLamDrYzvOgUOnNLnTmWFHiERLRBdd+b+LZ/68kX1VHnkmEKDEGIt+QfhQM5dO4fZF1MdPsho9mXlPGLSj81S3njAdMKnWVatBWXdNSAMwhJDARO+nfGXHSNoEY/RBmzmt7VTPScnCXrASjsuzHFmU0GvjG1zV8pBPNmj26TlST74xdtWGA7Czl7mLbYup1Q/GATy1s4LrQP/wXHHKKBccg2czlD7I6YgeuTbwgLncmtk918hcqnu4Zn8I2tuUxlB8V1G0u2XMeyQx3jcodxF4I36c1yge+VrW2FeDIl2qOGJwn5Azff4T1SAd49YJGyLMZfVkZljzhUVb92rKrcX33TW2eVyG4kNd6aOi/mH8niNJlsU5osfjhtBP0zQM89QroMV9AMpLfltmMBFGlcH4hxb9gjCWFZXwGqgka5fEAVTCJhp/GNhwuCN754/vdoGaA78zHkOPPIZ2CIBvX93BH2QtaRz+8inY6xA6g4ScVVp3lMjrqe1NdCCR6j927vkp+lvCPj6OLBhkcM4QcYQffRqmaAHY= file: $PWD/release/SIGNALDuino_${BOARD}${RECEIVER}${TRAVIS_TAG}.hex on: repo: RFD-FHEM/SIGNALDuino tags: true - prerelease: true - draft: true - condition: $TRAVIS_BUILD_STAGE_NAME = "Deploy" - #condition: "$TRAVIS_EVENT_TYPE = cron" - #condition: $TRAVIS_TAG =~ ^release.*$ + condition: $TRAVIS_BUILD_STAGE_NAME = "deploy" all_branches: true - #condition: $TRAVIS_BRANCH =~ ^dev-r33.* jobs: include: - - + - stage: deploy env: - BOARD=nano - RECEIVER=cc1101 - - + - stage: deploy env: - BOARD=nano328 - - + - stage: deploy env: - BOARD=radino - RECEIVER=cc1101 before_script: - arduino --pref boardsmanager.additional.urls=http://library.radino.cc/Arduino_1_8/package_radino_radino32_index.json --save-prefs; - - + - stage: deploy env: - BOARD=minicul - RECEIVER=cc1101 - - + - stage: deploy env: - BOARD=promini - - + - + stage: deploy + env: + - BOARD=ESP32 + - RECEIVER=cc1101 + before_script: + - arduino --pref "boardsmanager.additional.urls=https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json" --save-prefs + - arduino --install-boards esp32:esp32 + - arduino --board esp32:esp32:esp32:FlashMode=qio,FlashFreq=80 --save-prefs + after_success: + - mv $PWD/release/SIGNALDuino.ino.bin $PWD/release/SIGNALDuino_${BOARD}${RECEIVER}${TRAVIS_TAG}.hex + - + stage: deploy + env: + - BOARD=ESP32 + before_script: + - arduino --pref "boardsmanager.additional.urls=https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json" --save-prefs + - arduino --install-boards esp32:esp32 + - arduino --board esp32:esp32:esp32:FlashMode=qio,FlashFreq=80 --save-prefs + after_success: + - mv $PWD/release/SIGNALDuino.ino.bin $PWD/release/SIGNALDuino_${BOARD}${RECEIVER}${TRAVIS_TAG}.hex + - stage: deploy env: - BOARD=ESP8266 @@ -102,21 +123,48 @@ jobs: # - git clone --branch ota http://github.com/tzapu/WiFiManager.git /usr/local/share/arduino/libraries/WIFIManager - arduino --pref "boardsmanager.additional.urls=http://arduino.esp8266.com/stable/package_esp8266com_index.json" --save-prefs # - arduino --install-library "ArduinoJson:5.13.2"; - - arduino --install-boards esp8266:esp8266:2.4.2 - - arduino --board esp8266:esp8266:generic:CpuFrequency=80,ResetMethod=ck,CrystalFreq=26,FlashFreq=40,FlashMode=dio,FlashSize=1M64,LwIPVariant=v2mss536,Debug=Disabled,DebugLevel=None____,UploadSpeed=115200 --save-prefs + - arduino --install-boards esp8266:esp8266:2.6.3 + - arduino --board esp8266:esp8266:generic:xtal=80,eesz=1M64,FlashMode=qio,FlashFreq=40,dbg=Serial,lvl=CORE --save-prefs after_success: - mv $PWD/release/SIGNALDuino.ino.bin $PWD/release/SIGNALDuino_${BOARD}${RECEIVER}${TRAVIS_TAG}.hex - - + - stage: deploy env: - BOARD=ESP8266 before_script: - arduino --pref "boardsmanager.additional.urls=http://arduino.esp8266.com/stable/package_esp8266com_index.json" --save-prefs - - arduino --install-boards esp8266:esp8266:2.4.2 - - arduino --board esp8266:esp8266:generic:CpuFrequency=80,ResetMethod=ck,CrystalFreq=26,FlashFreq=40,FlashMode=dio,FlashSize=1M64,LwIPVariant=v2mss536,Debug=Disabled,DebugLevel=None____,UploadSpeed=115200 --save-prefs + - arduino --install-boards esp8266:esp8266:2.6.3 + - arduino --board esp8266:esp8266:generic:xtal=80,eesz=1M64,FlashMode=qio,FlashFreq=40,dbg=Serial,lvl=CORE --save-prefs + after_success: + - mv $PWD/release/SIGNALDuino.ino.bin $PWD/release/SIGNALDuino_${BOARD}${RECEIVER}${TRAVIS_TAG}.hex + - + stage: deploy + env: + - BOARD=MAPLEMINI_F103CB + - RECEIVER=cc1101 + before_script: + # Add json packages url to the Arduino IDE + - arduino --pref "boardsmanager.additional.urls=https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json" --save-prefs + # Install the latest core version + - arduino --install-boards STM32:stm32 + # "package:arch:board" or "package:arch:board:options" + - arduino --board STM32:stm32:GenF1:pnum=MAPLEMINI_F103CB --save-prefs + after_success: + - mv $PWD/release/SIGNALDuino.ino.bin $PWD/release/SIGNALDuino_${BOARD}${RECEIVER}${TRAVIS_TAG}.hex + - + stage: deploy + env: + - BOARD=MAPLEMINI_F103CB + before_script: + # Add json packages url to the Arduino IDE + - arduino --pref "boardsmanager.additional.urls=https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json" --save-prefs + # Install the latest core version + - arduino --install-boards STM32:stm32 + # "package:arch:board" or "package:arch:board:options" + - arduino --board STM32:stm32:GenF1:pnum=MAPLEMINI_F103CB --save-prefs after_success: - mv $PWD/release/SIGNALDuino.ino.bin $PWD/release/SIGNALDuino_${BOARD}${RECEIVER}${TRAVIS_TAG}.hex - - + - stage: unittest install: skip before_install: skip @@ -146,4 +194,4 @@ notifications: on_failure: change stages: - unittest - - stage: deploy + - deploy diff --git a/README.md b/README.md index 8bf24761..cb955b92 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# SIGNALDuino uC v3.3.1 with cc1101 support +# SIGNALDuino uC v3.4.0-development with cc1101 support [![Build Status](https://travis-ci.org/RFD-FHEM/SIGNALDuino.svg?branch=master)](https://travis-ci.org/RFD-FHEM/SIGNALDuino) ### Getting started @@ -22,13 +22,16 @@ http://www.fhemwiki.de/wiki/SIGNALDuino ### Tested microcontrollers -* Aduino Nano -* RadinoCC1101 +* Arduino Nano +* Arduino Pro Mini +* ESP32 (ESP32-WROOM-32 / ESP32-WROOM-32D) * ESP8266 +* RadinoCC1101 +* STM32 F103CBT6 (Maple Mini, bootloader v1.0) ### ESP32 Notes -If you encounter problems compiling for ESP32, sorry the code for this microcontroller is currently not finished. Contributors are welcome. If you have mane errors from fastDelegate.h try adding this compiler flag: +If you encounter problems compiling for ESP32, sorry the code for this microcontroller is currently not finished tested with all variants from ESP32. Contributors are welcome. If you have mane errors from fastDelegate.h try adding this compiler flag: -Wno-unused-local-typedef ### Signal from my device ist not detected @@ -57,6 +60,4 @@ First, sorry. This software is not perfect. 4. Create a branch (git checkout -b my_branch) 5. Commit your changes (git commit -am "") 6 .Push to a developer branch (git push dev-my_branch) -7. Open a Pull Request, put some useful informations there, what your extension does and why we should add it, reference to the open issues which are fixed whith this pull requet. - - +7. Open a Pull Request, put some useful informations there, what your extension does and why we should add it, reference to the open issues which are fixed whith this pull requet. \ No newline at end of file diff --git a/__vm/.SIGNALDuino.vsarduino.h b/__vm/.SIGNALDuino.vsarduino.h index 29e084d5..b83fbac7 100644 --- a/__vm/.SIGNALDuino.vsarduino.h +++ b/__vm/.SIGNALDuino.vsarduino.h @@ -6,77 +6,107 @@ All non-arduino files created by visual micro and all visual studio project or solution files can be freely deleted and are not required to compile a sketch (do not delete your own code!). Note: debugger breakpoints are stored in '.sln' or '.asln' files, knowledge of last uploaded breakpoints is stored in the upload.vmps.xml file. Both files are required to continue a previous debug session without needing to compile and upload again - Hardware: Arduino Nano w/ ATmega328P, Platform=avr, Package=arduino + Hardware: NodeMCU 1.0 (ESP-12E Module), Platform=esp8266, Package=esp8266 */ #if defined(_VMICRO_INTELLISENSE) #ifndef _VSARDUINO_H_ #define _VSARDUINO_H_ -#define __AVR_atmega328p__ -#define __AVR_ATmega328P__ -#define __AVR_ATmega328p__ -#define F_CPU 16000000L -#define ARDUINO 10805 -#define ARDUINO_AVR_NANO -#define ARDUINO_ARCH_AVR +#define __ESP8266_esp8266__ +#define __ESP8266_ESP8266__ +#define __ets__ +#define ICACHE_FLASH +#define F_CPU 80000000L +#define LWIP_OPEN_SRC +#define ARDUINO 108010 +#define ARDUINO_ESP8266_NODEMCU +#define ARDUINO_ARCH_ESP8266 +#define ESP8266 #define __cplusplus 201103L -#define _Pragma(x) -#define __AVR__ +#undef __cplusplus +#define __cplusplus 201103L +#define __STDC__ +#define __ARM__ +#define __arm__ #define __inline__ -#define __asm__(...) +#define __asm__(x) +#define __asm__ #define __extension__ -#define __inline__ +#define __ATTR_PURE__ +#define __ATTR_CONST__ #define __volatile__ -#define GCC_VERSION 40902 -#define __cplusplus 201103L -#define volatile(va_arg) -#define _CONST -#define __builtin_va_start -#define __builtin_va_end -#define __attribute__(...) -#define NOINLINE __attribute__((noinline)) -#define prog_void -#define PGM_VOID_P int +#define __ASM +#define __INLINE +#define __attribute__(noinline) -#ifndef __builtin_constant_p - #define __builtin_constant_p __attribute__((__const__)) -#endif -#ifndef __builtin_strlen - #define __builtin_strlen __attribute__((__const__)) -#endif +//#define _STD_BEGIN +//#define EMIT +#define WARNING +#define _Lockit +#define __CLR_OR_THIS_CALL +#define C4005 +#define _NEW + +//typedef int uint8_t; +//#define __ARMCC_VERSION 400678 +//#define PROGMEM +//#define string_literal +// +//#define prog_void +//#define PGM_VOID_P int +// + +typedef int _read; +typedef int _seek; +typedef int _write; +typedef int _close; +typedef int __cleanup; +//#define inline -#define NEW_H -typedef void *__builtin_va_list; -//extern "C" void __cxa_pure_virtual() {;} +#define __builtin_clz +#define __builtin_clzl +#define __builtin_clzll +#define __builtin_labs +#define __builtin_va_list +typedef int __gnuc_va_list; -typedef int div_t; -typedef int ldiv_t; +#define __ATOMIC_ACQ_REL +#define __CHAR_BIT__ +#define _EXFUN() -typedef void *__builtin_va_list; -//extern "C" void __cxa_pure_virtual() {;} +typedef unsigned char byte; +extern "C" void __cxa_pure_virtual() {;} +typedef long __INTPTR_TYPE__ ; +typedef long __UINTPTR_TYPE__ ; +typedef long __SIZE_TYPE__ ; +typedef long __PTRDIFF_TYPE__; + + +#include "new" +#include "Esp.h" + #include "arduino.h" #include -//#undef F -//#define F(string_literal) ((const PROGMEM char *)(string_literal)) -#undef PSTR -#define PSTR(string_literal) ((const PROGMEM char *)(string_literal)) -//typedef unsigned char uint8_t; -//typedef unsigned int uint8_t; +#include "..\generic\Common.h" +#include "..\generic\pins_arduino.h" -#define pgm_read_byte(address_short) uint8_t() -#define pgm_read_word(address_short) uint16_t() -#define pgm_read_dword(address_short) uint32_t() -#define pgm_read_float(address_short) float() -#define pgm_read_ptr(address_short) short() +#undef F +#define F(string_literal) ((const PROGMEM char *)(string_literal)) +#undef PSTR +#define PSTR(string_literal) ((const PROGMEM char *)(string_literal)) +//current vc++ does not understand this syntax so use older arduino example for intellisense +//todo:move to the new clang/gcc project types. +#define interrupts() sei() +#define noInterrupts() cli() #include "SIGNALDuino.ino" #include "SIGNALESP.ino" diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 index 8c1d522d..98b77988 --- a/build.sh +++ b/build.sh @@ -38,7 +38,7 @@ fi echo "Compile now for ${BOARD} with ${RECEIVER}" -arduino -v --verbose-build --verify $PWD/SIGNALDuino/SIGNALDuino.ino 2>&1 +arduino -v --verbose-build --verify $PWD/src/arduino-ide/SIGNALDuino/SIGNALDuino.ino 2>&1 ARDUINO_RETURN_CODE=$? echo "Compile ${BOARD} ${RECEIVER} finshed" exit $ARDUINO_RETURN_CODE \ No newline at end of file diff --git a/cc1101.h b/cc1101.h deleted file mode 100644 index b14ffe9f..00000000 --- a/cc1101.h +++ /dev/null @@ -1,192 +0,0 @@ -// cc1101.h esp -#pragma once -#ifndef _CC1101_h -#define _CC1101_h - -#if defined(ARDUINO) && ARDUINO >= 100 - #include "Arduino.h" -#else -// #include "WProgram.h" -#endif -#include "compile_config.h" - -#include -#include "output.h" - -extern char IB_1[14]; - - - -#if defined(ESP8266) || defined(ESP32) -#include -#endif -namespace cc1101 { - /* - #ifdef ARDUINO_AVR_ICT_BOARDS_ICT_BOARDS_AVR_RADINOCC1101 - #define SS 8 - #define PIN_MARK433 4 // LOW -> 433Mhz | HIGH -> 868Mhz - - #elif ARDUINO_ATMEGA328P_MINICUL // 8Mhz - #define PIN_MARK433 0 - #endif - - */ - - - #define csPin SS // CSN out - #define mosiPin MOSI // MOSI out - #define misoPin MISO // MISO in - #define sckPin SCK // SCLK out - - - #define CC1100_WRITE_BURST 0x40 - #define CC1101_WRITE_SINGLE 0x00 - #define CC1100_READ_BURST 0xC0 - #define CC1101_READ_SINGLE 0x80 - #define CC1101_CONFIG CC1101_READ_SINGLE - #define CC1101_STATUS CC1100_READ_BURST - - #define CC1100_FREQ2 0x0D // Frequency control word, high byte - #define CC1100_FREQ1 0x0E // Frequency control word, middle byte - #define CC1100_FREQ0 0x0F // Frequency control word, low byte - #define CC1100_PATABLE 0x3E // 8 byte memory - #define CC1100_IOCFG2 0x00 // GDO2 output configuration - #define CC1100_PKTCTRL0 0x08 // Packet config register - - extern uint8_t revision; - extern const uint8_t initVal[]; - // Status registers - newer version base on 0xF0 - #define CC1101_PARTNUM_REV01 0xF0 // Chip ID - #define CC1101_VERSION_REV01 0xF1 // Chip ID - #define CC1100_RSSI_REV01 0xF4 // Received signal strength indication - #define CC1100_MARCSTATE_REV01 0xF5 // Control state machine state - - // Status registers - older version base on 0x30 - #define CC1101_PARTNUM_REV00 0x30 // Chip ID - #define CC1101_VERSION_REV00 0x31 // Chip ID - #define CC1100_RSSI_REV00 0x34 // Received signal strength indication - #define CC1100_MARCSTATE_REV00 0x35 // Control state machine state - - // Strobe commands - #define CC1101_SRES 0x30 // reset - #define CC1100_SFSTXON 0x31 // Enable and calibrate frequency synthesizer (if MCSM0.FS_AUTOCAL=1). - #define CC1100_SCAL 0x33 // Calibrate frequency synthesizer and turn it off - #define CC1100_SRX 0x34 // Enable RX. Perform calibration first if coming from IDLE and MCSM0.FS_AUTOCAL=1 - #define CC1100_STX 0x35 // In IDLE state: Enable TX. Perform calibration first if MCSM0.FS_AUTOCAL=1 - #define CC1100_SIDLE 0x36 // Exit RX / TX, turn off frequency synthesizer - #define CC1100_SAFC 0x37 // Perform AFC adjustment of the frequency synthesizer - #define CC1100_SFTX 0x3B // Flush the TX FIFO buffer. - #define CC1101_SNOP 0x3D // - - enum CC1101_MarcState { - MarcStateSleep = 0x00u - , MarcStateIdle = 0x01u - , MarcStateXOff = 0x02u - , MarcStateVConnManCal = 0x03u - , MarcStateRegOnManCal = 0x04u - , MarcStateManCal = 0x05u - , MarcStateVConnFSWakeUp = 0x06u - , MarcStateRegOnFSWakeUp = 0x07u - , MarcStateStartCalibrate = 0x08u - , MarcStateBWBoost = 0x09u - , MarcStateFSLock = 0x0Au - , MarcStateIfadCon = 0x0Bu - , MarcStateEndCalibrate = 0x0Cu - , MarcStateRx = 0x0Du - , MarcStateRxEnd = 0x0Eu - , MarcStateRxRst = 0x0Fu - , MarcStateTxRxSwitch = 0x10u - , MarcStateRxFifoOverflow = 0x11u - , MarcStateFsTxOn = 0x12u - , MarcStateTx = 0x13u - , MarcStateTxEnd = 0x14u - , MarcStateRxTxSwitch = 0x15u - , MarcStateTxFifoUnerflow = 0x16u - }; - -#if defined(ESP8266) || defined(ESP32) - #define pinAsInput(pin) pinMode(pin, INPUT) - #define pinAsOutput(pin) pinMode(pin, OUTPUT) - #define pinAsInputPullUp(pin) pinMode(pin, INPUT_PULLUP) - - #ifndef digitalLow - #define digitalLow(pin) digitalWrite(pin, LOW) - #endif - #ifndef digitalHigh - #define digitalHigh(pin) digitalWrite(pin, HIGH) - #endif - #ifndef isHigh - #define isHigh(pin) (digitalRead(pin) == HIGH) - #endif -#endif - - #define wait_Miso() while(isHigh(misoPin) ) { static uint8_t miso_count=255;delay(1); if(miso_count==0) return; miso_count--; } // wait until SPI MISO line goes low - #define wait_Miso_rf() while(isHigh(misoPin) ) { static uint8_t miso_count=255;delay(1); if(miso_count==0) return false; miso_count--; } // wait until SPI MISO line goes low - #define cc1101_Select() digitalLow(csPin) // select (SPI) CC1101 - #define cc1101_Deselect() digitalHigh(csPin) - - #define EE_CC1100_CFG 2 - #define EE_CC1100_CFG_SIZE 0x29 - #define EE_CC1100_PA 0x30 // (EE_CC1100_CFG+EE_CC1100_CFG_SIZE) // 2C - #define EE_CC1100_PA_SIZE 8 - - #define PATABLE_DEFAULT 0x84 // 5 dB default value for factory reset - - //------------------------------------------------------------------------------ - // Chip Status Byte - //------------------------------------------------------------------------------ - - // Bit fields in the chip status byte - #define CC1100_STATUS_CHIP_RDYn_BM 0x80 - #define CC1100_STATUS_STATE_BM 0x70 - #define CC1100_STATUS_FIFO_BYTES_AVAILABLE_BM 0x0F - - // Chip states - #define CC1100_STATE_IDLE 0x00 - #define CC1100_STATE_RX 0x10 - #define CC1100_STATE_TX 0x20 - #define CC1100_STATE_FSTXON 0x30 - #define CC1100_STATE_CALIBRATE 0x40 - #define CC1100_STATE_SETTLING 0x50 - #define CC1100_STATE_RX_OVERFLOW 0x60 - #define CC1100_STATE_TX_UNDERFLOW 0x70 - - - #ifdef ARDUINO_AVR_ICT_BOARDS_ICT_BOARDS_AVR_RADINOCC1101 - //uint8_t RADINOVARIANT = 0; // Standardwert welcher je radinoVarinat ge寤ert wird - #endif - extern const uint8_t initVal[]; - - - - byte hex2int(byte hex); // convert a hexdigit to int // Todo: printf oder scanf nutzen - uint8_t sendSPI(const uint8_t val); // send byte via SPI - uint8_t cmdStrobe(const uint8_t cmd); - uint8_t readReg(const uint8_t regAddr, const uint8_t regType); // read CC1101 register via SPI - void writeReg(const uint8_t regAddr, const uint8_t val); // write single register into the CC1101 IC via SPI - void readPatable(void); - void writePatable(void); - void readCCreg(const uint8_t reg); // read CC11001 register - void commandStrobes(void); - void writeCCreg(uint8_t reg, uint8_t var); // write CC11001 register - void writeCCpatable(uint8_t var); // write 8 byte to patable (kein pa ramping) - void ccFactoryReset(); - - uint8_t chipVersionRev(); - uint8_t chipVersion(); - bool checkCC1101(); - void setup(); - uint8_t getRevision(); - uint8_t getRSSI(); - void setIdleMode(); - uint8_t currentMode(); - void setReceiveMode(); - void setTransmitMode(); - - void CCinit(void); // initialize CC1101 - - bool regCheck(); - -} - -#endif diff --git a/compile_config.h b/compile_config.h deleted file mode 100644 index b08a7462..00000000 --- a/compile_config.h +++ /dev/null @@ -1,82 +0,0 @@ -#pragma once - - -// Config flags for compiling correct options / boards Define only one! -//#define CMP_CC1101 -//#define ARDUINO_ATMEGA328P_MINICUL 1 -//#define ARDUINO_AVR_ICT_BOARDS_ICT_BOARDS_AVR_RADINOCC1101 1; -//#define OTHER_BOARD_WITH_CC1101 1 - - -//Enable debug option here: -//#define DEBUG - - - - - -/* - - Do not Change anything below this line - -*/ - -#ifdef OTHER_BOARD_WITH_CC1101 -#define CMP_CC1101 -#endif -#ifdef ARDUINO_ATMEGA328P_MINICUL -#define CMP_CC1101 -#endif - -// Get compatibility with arduino ide and visualmicro -#ifdef ARDUINO_AVR_ICT_BOARDS_ICT_BOARDS_AVR_RADINOCC1101 -#define ARDUINO_RADINOCC1101 -#endif - -#ifdef ARDUINO_RADINOCC1101 -#define CMP_CC1101 -#endif - -#ifdef ESP8266 - -#endif - -#ifdef CMP_CC1101 - #ifdef ARDUINO_RADINOCC1101 - #define PIN_LED 13 - #define PIN_SEND 9 // gdo0Pin TX out - #define PIN_RECEIVE 7 - #define digitalPinToInterrupt(p) ((p) == 0 ? 2 : ((p) == 1 ? 3 : ((p) == 2 ? 1 : ((p) == 3 ? 0 : ((p) == 7 ? 4 : NOT_AN_INTERRUPT))))) - #define PIN_MARK433 4 - #define SS 8 - #elif ARDUINO_ATMEGA328P_MINICUL // 8Mhz - #define PIN_LED 4 - #define PIN_SEND 2 // gdo0Pin TX out - #define PIN_RECEIVE 3 - #define PIN_MARK433 A0 - #elif defined(ESP8266) - #define PIN_RECEIVE 5// D1 - #define PIN_LED 16 - #define PIN_SEND 4// D2 // gdo0Pin TX out - #define ETHERNET_PRINT - #else - #define PIN_LED 9 - #define PIN_SEND 3 // gdo0Pin TX out - #define PIN_RECEIVE 2 - #endif -#else - #ifdef ESP8266 - #define PIN_RECEIVE 5// D1 - #define PIN_LED 16 - #define PIN_SEND 4// D2 // gdo0Pin TX out - #define ETHERNET_PRINT - #else - #define PIN_RECEIVE 2 - #define PIN_LED 13 // Message-LED - #define PIN_SEND 11 - #endif -#endif - - - - diff --git a/custom_hwids.py b/custom_hwids.py new file mode 100644 index 00000000..c2c75939 --- /dev/null +++ b/custom_hwids.py @@ -0,0 +1,10 @@ +Import("env") + +board_config = env.BoardConfig() +# should be array of VID:PID pairs +# https://docs.platformio.org/en/latest/projectconf/advanced_scripting.html#override-board-configuration +# https://docs.platformio.org/en/latest/projectconf/advanced_scripting.html +board_config.update("build.hwids", [ + ["0x0483", "0x0003"], # 1st pair + ["0x0483", "0x0004"] # 2nd pair, etc. +]) \ No newline at end of file diff --git a/deploy.sh b/deploy.sh old mode 100644 new mode 100755 diff --git a/platformio.ini b/platformio.ini new file mode 100644 index 00000000..875355b6 --- /dev/null +++ b/platformio.ini @@ -0,0 +1,439 @@ +;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] +; https://docs.platformio.org/en/latest/projectconf/section_env.html +; default_envs = esp32_CC1101@debug, esp32_CC1101, esp32@debug, esp32 +; default_envs = esp8266_CC1101@debug, esp8266_CC1101, esp8266@debug, esp8266 +; default_envs = maple_mini_bootl_v1_CC1101@debug_wr, maple_mini_bootl_v1_CC1101@debug, maple_mini_bootl_v1_CC1101, maple_mini_bootl_v1 +; default_envs = maple_mini_bootl_v2_CC1101@debug_wr, maple_mini_bootl_v2_CC1101@debug, maple_mini_bootl_v2_CC1101, maple_mini_bootl_v2 +; default_envs = minicul_16MHz_CC1101, minicul_16MHz_CC1101@debug, minicul_8MHz_CC1101, minicul_8MHz_CC1101@debug +; default_envs = nano328_bootl_new, nano328_bootl_new@debug, nano328_bootl_old, nano328_bootl_old@debug +; default_envs = promini, promini@debug +; default_envs = radino_CC1101 +test_dir = tests/ + +[env] +; https://docs.platformio.org/en/feature-platformio-30/projectconf.html +src_filter = +<*> -<.git/> -<.svn/> - - - -<_micro-api/libraries/ArduinoJson/test/> -<_micro-api/libraries/ArduinoJson/third-party/> -<_micro-api/libraries/fastdelegate/examples/>- - -<_micro-api/libraries/ArduinoJson/fuzzing/> +lib_extra_dirs = + src/_micro-api/libraries/ + +; general - for all devices, using ${env.***} + +; Unix, example +debug_port = /dev/ttyUSB0 +monitor_port = /dev/ttyUSB0 +upload_port = /dev/ttyUSB0 + +; Windows, example +; debug_port = COM4 +; monitor_port = COM4 +; upload_port = COM4 + +[env_maple_mini] +; all options for MAPLE_Mini +; extra_scripts = pre:custom_hwids.py ; to write USB PID for device | needed to right reconnected +; platform = ststm32 ; Stable version +platform = https://github.com/platformio/platform-ststm32.git ; Development version +board = maple_mini_origin +board_build.mcu = stm32f103cbt6 ; https://docs.platformio.org/en/latest/projectconf/section_env_platform.html#board-build-mcu +board_build.core = STM32Duino ; https://docs.platformio.org/en/latest/platforms/ststm32.html#configuration +framework = arduino +build_flags= + -D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC ; CDC (generic Serial supersede U(S)ART) + -D USBCON ; !! work only with maple_mini bootloader v1.0 !! + ;-D USBD_VID=0x1eaf ; Maple Serial (COMxx) + ;-D USBD_PID=0x0003 ; Bootloader + -D USBD_PID=0x0004 ; Device + -D USBD_VID=0x0483 ; Serielles USB-Geraet (COMxx) + -D USB_MANUFACTURER="STMicroelectronics" + -D USB_PRODUCT="\"Maple\"" + + +; * * * * * * * * * * * * * * * * * * * * * +; behind this lines, all hardware projects +; * * * * * * * * * * * * * * * * * * * * * + +[env:maple_mini_bootl_v2_CC1101@debug_wr] +; STM32duino bootloader v2.0 +; no hardware to test +platform = ${env_maple_mini.platform} +board = maple_mini_b20 +board_build.mcu = ${env_maple_mini.board_build.mcu} +board_build.core = ${env_maple_mini.board_build.core} +framework = ${env_maple_mini.framework} +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags= -D ARDUINO_MAPLEMINI_F103CB=1 + -D OTHER_BOARD_WITH_CC1101=1 + -D WATCHDOG_STM32=1 + -D DEBUG + +[env:maple_mini_bootl_v1_CC1101@debug_wr] +; STM32duino bootloader v1.0 +platform = ${env_maple_mini.platform} +board = ${env_maple_mini.board} +board_build.mcu = ${env_maple_mini.board_build.mcu} +board_build.core = ${env_maple_mini.board_build.core} +framework = ${env_maple_mini.framework} +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags = ${env_maple_mini.build_flags} + -D OTHER_BOARD_WITH_CC1101=1 + -D WATCHDOG_STM32=1 + -D DEBUG + +[env:maple_mini_bootl_v2_CC1101@debug] +; STM32duino bootloader v2.0 +; no hardware to test +platform = ${env_maple_mini.platform} +board = maple_mini_b20 +board_build.mcu = ${env_maple_mini.board_build.mcu} +board_build.core = ${env_maple_mini.board_build.core} +framework = ${env_maple_mini.framework} +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags= -D ARDUINO_MAPLEMINI_F103CB=1 + -D OTHER_BOARD_WITH_CC1101=1 + -D DEBUG + +[env:maple_mini_bootl_v1_CC1101@debug] +; STM32duino bootloader v1.0 +platform = ${env_maple_mini.platform} +board = ${env_maple_mini.board} +board_build.mcu = ${env_maple_mini.board_build.mcu} +board_build.core = ${env_maple_mini.board_build.core} +framework = ${env_maple_mini.framework} +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags = ${env_maple_mini.build_flags} + -D OTHER_BOARD_WITH_CC1101=1 + -D DEBUG + +[env:maple_mini_bootl_v2_CC1101] +; STM32duino bootloader v2.0 +; no hardware to test +platform = ${env_maple_mini.platform} +board = maple_mini_b20 +board_build.mcu = ${env_maple_mini.board_build.mcu} +board_build.core = ${env_maple_mini.board_build.core} +framework = ${env_maple_mini.framework} +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags= -D ARDUINO_MAPLEMINI_F103CB=1 + -D OTHER_BOARD_WITH_CC1101=1 + +[env:maple_mini_bootl_v1_CC1101] +; STM32duino bootloader v1.0 +platform = ${env_maple_mini.platform} +board = ${env_maple_mini.board} +board_build.mcu = ${env_maple_mini.board_build.mcu} +board_build.core = ${env_maple_mini.board_build.core} +framework = ${env_maple_mini.framework} +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags = ${env_maple_mini.build_flags} + -D OTHER_BOARD_WITH_CC1101=1 + +[env:maple_mini_bootl_v2] +; STM32duino bootloader v2.0 +; no hardware to test +platform = ${env_maple_mini.platform} +board = maple_mini_b20 +board_build.mcu = ${env_maple_mini.board_build.mcu} +board_build.core = ${env_maple_mini.board_build.core} +framework = ${env_maple_mini.framework} +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags= + -D ARDUINO_MAPLEMINI_F103CB=1 + +[env:maple_mini_bootl_v1] +; STM32duino bootloader v1.0 +platform = ${env_maple_mini.platform} +board = ${env_maple_mini.board} +board_build.mcu = ${env_maple_mini.board_build.mcu} +board_build.core = ${env_maple_mini.board_build.core} +framework = ${env_maple_mini.framework} +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags = ${env_maple_mini.build_flags} + +[env:nano_bootl_old_CC1101@debug] +; bootloader ATmegaBOOT +platform = atmelavr +board = nanoatmega328 +monitor_speed = 57600 +framework = arduino +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags=-D OTHER_BOARD_WITH_CC1101=1 -D DEBUG + +[env:nano_bootl_old_CC1101] +; bootloader ATmegaBOOT +platform = atmelavr +board = nanoatmega328 +monitor_speed = 57600 +framework = arduino +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags=-D OTHER_BOARD_WITH_CC1101=1 + +[env:nano_bootl_new_CC1101@debug] +; bootloader Optiboot +platform = atmelavr +board = nanoatmega328new +monitor_speed = 57600 +framework = arduino +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags=-D OTHER_BOARD_WITH_CC1101=1 -D DEBUG + +[env:nano_bootl_new_CC1101] +; bootloader Optiboot +platform = atmelavr +board = nanoatmega328new +monitor_speed = 57600 +framework = arduino +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags=-D OTHER_BOARD_WITH_CC1101=1 + +[env:nano328_bootl_old@debug] +; bootloader ATmegaBOOT +platform = atmelavr +board = nanoatmega328 +monitor_speed = 57600 +framework = arduino +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags=-D DEBUG +src_filter =-cc1101.h -cc1101.cpp +<*> -<.git/> -<.svn/> - - - -<_micro-api/libraries/ArduinoJson/test/> -<_micro-api/libraries/ArduinoJson/third-party/> -<_micro-api/libraries/fastdelegate/examples/>- - -<_micro-api/libraries/ArduinoJson/fuzzing/> + +[env:nano328_bootl_old] +; bootloader ATmegaBOOT +platform = atmelavr +board = nanoatmega328 +monitor_speed = 57600 +framework = arduino +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags= + +[env:nano328_bootl_new@debug] +; bootloader Optiboot +platform = atmelavr +board = nanoatmega328new +monitor_speed = 57600 +framework = arduino +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags=-D DEBUG +src_filter =-cc1101.h -cc1101.cpp +<*> -<.git/> -<.svn/> - - - -<_micro-api/libraries/ArduinoJson/test/> -<_micro-api/libraries/ArduinoJson/third-party/> -<_micro-api/libraries/fastdelegate/examples/>- - -<_micro-api/libraries/ArduinoJson/fuzzing/> + +[env:nano328_bootl_new] +; bootloader Optiboot +platform = atmelavr +board = nanoatmega328new +monitor_speed = 57600 +framework = arduino +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags= + +[env:minicul_8MHz_CC1101@debug] +platform = atmelavr +board = pro8MHzatmega328 +monitor_speed = 57600 +framework = arduino +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags=-D OTHER_BOARD_WITH_CC1101=1 -D DEBUG + +[env:minicul_8MHz_CC1101] +platform = atmelavr +board = pro8MHzatmega328 +monitor_speed = 57600 +framework = arduino +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags=-D OTHER_BOARD_WITH_CC1101=1 + +[env:minicul_16MHz_CC1101@debug] +platform = atmelavr +board = pro16MHzatmega328 +monitor_speed = 57600 +framework = arduino +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags=-D OTHER_BOARD_WITH_CC1101=1 -D DEBUG + +[env:minicul_16MHz_CC1101] +platform = atmelavr +board = pro16MHzatmega328 +monitor_speed = 57600 +framework = arduino +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags=-D OTHER_BOARD_WITH_CC1101=1 + +[env:promini@debug] +platform = atmelavr +board = pro8MHzatmega328 +monitor_speed = 57600 +framework = arduino +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags=-D DEBUG + +[env:promini] +platform = atmelavr +board = pro8MHzatmega328 +monitor_speed = 57600 +framework = arduino +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags= + +; [env:radino_CC1101@debug] +; Error: The program size (32498 bytes) is greater than maximum allowed (28672 bytes) +; +; Radino board from in-circuit is not in POI +; these are compatible with all PIN´s +; working correctly; send & receive function works +; platform = atmelavr +; board = micro +; framework = arduino +; board_build.mcu = atmega32u4 ; change microcontroller +; board_build.f_cpu = 8000000L ; change MCU frequency +; monitor_port = ${env.monitor_port} +; upload_port = ${env.upload_port} +; build_flags=-D ARDUINO_AVR_ICT_BOARDS_ICT_BOARDS_AVR_RADINOCC1101=1 -D DEBUG + +[env:radino_CC1101] +; Radino board from in-circuit is not in POI +; these are compatible with all PIN´s +; working correctly; send & receive function works +platform = atmelavr +board = micro +framework = arduino +board_build.mcu = atmega32u4 ; change microcontroller +board_build.f_cpu = 8000000L ; change MCU frequency +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags=-D ARDUINO_AVR_ICT_BOARDS_ICT_BOARDS_AVR_RADINOCC1101=1 + +[env:esp32_CC1101@debug] +platform = espressif32 +board = esp32dev +framework = arduino +monitor_speed = 115200 +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags=-D DEBUG -D OTHER_BOARD_WITH_CC1101=1 + +[env:esp32_CC1101] +platform = espressif32 +board = esp32dev +framework = arduino +monitor_speed = 115200 +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags=-D OTHER_BOARD_WITH_CC1101=1 + +[env:esp32@debug] +platform = espressif32 +board = esp32dev +framework = arduino +debug_tool = olimex-arm-usb-ocd-h +monitor_speed = 115200 +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags=-D DEBUG + +[env:esp32] +platform = espressif32 +board = esp32dev +framework = arduino +debug_tool = olimex-arm-usb-ocd-h +monitor_speed = 115200 +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +build_flags= + +;[env:esp8266cc1101@2.2.2] +;platform = espressif8266@2.2.2 +;board = nodemcuv2 +;framework = arduino +;lib_deps = +;upload_speed = 115200 +;monitor_port = ${env.monitor_port} +;upload_port = ${env.upload_port} +;monitor_speed = 115200 +;platform_packages = +; framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino.git +;build_flags=-D DEBUG -D OTHER_BOARD_WITH_CC1101 + +[env:esp8266_CC1101@debug] +platform = espressif8266 +board = nodemcuv2 +framework = arduino +;upload_speed = 115200 +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +monitor_speed = 115200 +lib_deps = +build_flags=-D DEBUG -D OTHER_BOARD_WITH_CC1101=1 + +[env:esp8266_CC1101] +platform = espressif8266 +board = nodemcuv2 +framework = arduino +;upload_speed = 115200 +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +monitor_speed = 115200 +lib_deps = +build_flags=-D OTHER_BOARD_WITH_CC1101=1 + +[env:esp8266@debug] +platform = espressif8266 +board = nodemcuv2 +framework = arduino +;upload_speed = 115200 +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +monitor_speed = 115200 +lib_deps = +build_flags=-D DEBUG + +[env:esp8266] +platform = espressif8266 +board = nodemcuv2 +framework = arduino +;upload_speed = 115200 +monitor_port = ${env.monitor_port} +upload_port = ${env.upload_port} +monitor_speed = 115200 +lib_deps = +build_flags= + + +[env:native] +platform = native +lib_deps = + googletest@1.8.1 +build_flags = + -std=c++11 +lib_archive = false +test_ignore = embedded* +;src_dir = tests/testSignalDecoder +lib_compat_mode = off diff --git a/src/_micro-api/libraries/SimpleFIFO/src/SimpleFIFO.h b/src/_micro-api/libraries/SimpleFIFO/src/SimpleFIFO.h index 87540511..fbc7110c 100644 --- a/src/_micro-api/libraries/SimpleFIFO/src/SimpleFIFO.h +++ b/src/_micro-api/libraries/SimpleFIFO/src/SimpleFIFO.h @@ -74,7 +74,11 @@ SimpleFIFO::SimpleFIFO() : size(rawSize) { flush(); } template -bool SimpleFIFO::enqueue( T element ) { +#if defined(ESP32) || defined(ESP8266) +bool ICACHE_RAM_ATTR SimpleFIFO::enqueue( T element ) { +#else +bool SimpleFIFO::enqueue( T element ) { +#endif if ( count() >= rawSize ) { return false; } numberOfElements++; nextIn %= size; diff --git a/src/_micro-api/libraries/WIFIManager b/src/_micro-api/libraries/WIFIManager index 8190ec60..13132edd 160000 --- a/src/_micro-api/libraries/WIFIManager +++ b/src/_micro-api/libraries/WIFIManager @@ -1 +1 @@ -Subproject commit 8190ec6077fea16b304d630053dda39305c43be1 +Subproject commit 13132edd9efa51f5d4b6f26d8e9c78704efdaecb diff --git a/src/_micro-api/libraries/output/src/output.h b/src/_micro-api/libraries/output/src/output.h index 04fc06df..d0f26562 100644 --- a/src/_micro-api/libraries/output/src/output.h +++ b/src/_micro-api/libraries/output/src/output.h @@ -54,6 +54,7 @@ static const char TXT_TPATAB[] PROGMEM = " to PATABLE done"; #define pinIndex(P) \ (((P) >= 8 && (P) <= 11) ? (P) - 4 : (((P) >= 18 && (P) <= 21) ? 25 - (P) : (((P) == 0) ? 2 : (((P) == 1) ? 3 : (((P) == 2) ? 1 : (((P) == 3) ? 0 : (((P) == 4) ? 4 : (((P) == 6) ? 7 : (((P) == 13) ? 7 : (((P) == 14) ? 3 : (((P) == 15) ? 1 : (((P) == 16) ? 2 : (((P) == 17) ? 0 : (((P) == 22) ? 1 : (((P) == 23) ? 0 : (((P) == 24) ? 4 : (((P) == 25) ? 7 : (((P) == 26) ? 4 : (((P) == 27) ? 5 : 6 ))))))))))))))))))) #else + #ifndef ARDUINO_MAPLEMINI_F103CB #define portOfPin(P)\ (((P)>=0&&(P)<8)?&PORTD:(((P)>7&&(P)<14)?&PORTB:&PORTC)) #define ddrOfPin(P)\ @@ -61,21 +62,32 @@ static const char TXT_TPATAB[] PROGMEM = " to PATABLE done"; #define pinOfPin(P)\ (((P)>=0&&(P)<8)?&PIND:(((P)>7&&(P)<14)?&PINB:&PINC)) #define pinIndex(P)((uint8_t)(P>13?P-14:P&7)) + #else + #define pinAsInput(pin) pinMode(pin, INPUT) + #define pinAsOutput(pin) pinMode(pin, OUTPUT) + #define pinAsInputPullUp(pin) pinMode(pin, INPUT_PULLUP) + #define digitalLow(pin) digitalWrite(pin, LOW) + #define digitalHigh(pin) digitalWrite(pin, HIGH) + #define isHigh(pin) (digitalRead(pin) == HIGH) + #define isLow(pin) (digitalRead(pin) == LOW) + #endif #endif #if defined(WIN32) || defined(__linux__) #define digitalLow(P) pinMode(P,LOW) #define digitalHigh(P) pinMode(P,HIGH) #else - #define pinMask(P)((uint8_t)(1<0) - #define isLow(P)((*(pinOfPin(P))& pinMask(P))==0) - #define digitalState(P)((uint8_t)isHigh(P)) + #ifndef ARDUINO_MAPLEMINI_F103CB + #define pinMask(P)((uint8_t)(1<0) + #define isLow(P)((*(pinOfPin(P))& pinMask(P))==0) + #define digitalState(P)((uint8_t)isHigh(P)) + #endif #endif #else #define pinAsInput(pin) pinMode(pin, INPUT) diff --git a/src/_micro-api/libraries/signalDecoder/src/signalDecoder.cpp b/src/_micro-api/libraries/signalDecoder/src/signalDecoder.cpp index 90f6fd10..54b5665f 100644 --- a/src/_micro-api/libraries/signalDecoder/src/signalDecoder.cpp +++ b/src/_micro-api/libraries/signalDecoder/src/signalDecoder.cpp @@ -847,7 +847,9 @@ void SignalDetectorClass::processMessage() if (!m_truncated) // Todo: Eventuell auf vollen Puffer prüfen { + bool _success=success; // save success because it is set to false in reset() reset(); + success=_success; // restore success } //SDC_PRINTLN("process finished"); @@ -946,6 +948,8 @@ void SignalDetectorClass::printOut() DBG_PRINT("]"); } DBG_PRINTLN(); +#else +delay(0); #endif } diff --git a/src/_micro-api/libraries/signalDecoder/src/signalDecoder.h b/src/_micro-api/libraries/signalDecoder/src/signalDecoder.h index 48be3f7f..1cd233b8 100644 --- a/src/_micro-api/libraries/signalDecoder/src/signalDecoder.h +++ b/src/_micro-api/libraries/signalDecoder/src/signalDecoder.h @@ -43,7 +43,14 @@ #endif #ifndef DEC +/* UB +no PlattformIO compatible #define DEC 10 + +---- + no ERROR PlattformIO +#define DEZ 10 +*/ #endif diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson.h b/src/arduino-ide/SIGNALDuino/ArduinoJson.h new file mode 120000 index 00000000..6eaf90db --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson.h @@ -0,0 +1 @@ +../../_micro-api/libraries/ArduinoJson/src/ArduinoJson.h \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson.hpp new file mode 120000 index 00000000..048e767e --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson.hpp @@ -0,0 +1 @@ +../../_micro-api/libraries/ArduinoJson/src/ArduinoJson.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Configuration.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Configuration.hpp new file mode 120000 index 00000000..8737c9d3 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Configuration.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Configuration.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/Encoding.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/Encoding.hpp new file mode 120000 index 00000000..5be32a1e --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/Encoding.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Data/Encoding.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonBufferAllocated.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonBufferAllocated.hpp new file mode 120000 index 00000000..2b139f6d --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonBufferAllocated.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Data/JsonBufferAllocated.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonFloat.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonFloat.hpp new file mode 120000 index 00000000..e8d881cb --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonFloat.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Data/JsonFloat.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonInteger.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonInteger.hpp new file mode 120000 index 00000000..8034cb0f --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonInteger.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Data/JsonInteger.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonVariantAs.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonVariantAs.hpp new file mode 120000 index 00000000..b6c152fa --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonVariantAs.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Data/JsonVariantAs.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonVariantContent.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonVariantContent.hpp new file mode 120000 index 00000000..bbbd52f0 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonVariantContent.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Data/JsonVariantContent.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonVariantDefault.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonVariantDefault.hpp new file mode 120000 index 00000000..da2db308 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonVariantDefault.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Data/JsonVariantDefault.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonVariantType.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonVariantType.hpp new file mode 120000 index 00000000..b5b9acde --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/JsonVariantType.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Data/JsonVariantType.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/List.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/List.hpp new file mode 120000 index 00000000..a489b6fd --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/List.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Data/List.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/ListConstIterator.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/ListConstIterator.hpp new file mode 120000 index 00000000..b6f0355f --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/ListConstIterator.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Data/ListConstIterator.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/ListIterator.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/ListIterator.hpp new file mode 120000 index 00000000..304a8acd --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/ListIterator.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Data/ListIterator.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/ListNode.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/ListNode.hpp new file mode 120000 index 00000000..515309f1 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/ListNode.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Data/ListNode.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/NonCopyable.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/NonCopyable.hpp new file mode 120000 index 00000000..aed5c6fb --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/NonCopyable.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Data/NonCopyable.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/ReferenceType.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/ReferenceType.hpp new file mode 120000 index 00000000..cd2c6f25 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/ReferenceType.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Data/ReferenceType.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/ValueSaver.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/ValueSaver.hpp new file mode 120000 index 00000000..08824850 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Data/ValueSaver.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Data/ValueSaver.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Deserialization/Comments.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Deserialization/Comments.hpp new file mode 120000 index 00000000..cb0210df --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Deserialization/Comments.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Deserialization/Comments.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Deserialization/JsonParser.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Deserialization/JsonParser.hpp new file mode 120000 index 00000000..dfbf73c1 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Deserialization/JsonParser.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Deserialization/JsonParser.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Deserialization/JsonParserImpl.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Deserialization/JsonParserImpl.hpp new file mode 120000 index 00000000..b9337a2b --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Deserialization/JsonParserImpl.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Deserialization/JsonParserImpl.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Deserialization/StringWriter.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Deserialization/StringWriter.hpp new file mode 120000 index 00000000..f208dc7e --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Deserialization/StringWriter.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Deserialization/StringWriter.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/DynamicJsonBuffer.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/DynamicJsonBuffer.hpp new file mode 120000 index 00000000..3fd27171 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/DynamicJsonBuffer.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/DynamicJsonBuffer.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonArray.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonArray.hpp new file mode 120000 index 00000000..2ac721a5 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonArray.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/JsonArray.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonArrayImpl.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonArrayImpl.hpp new file mode 120000 index 00000000..227d2115 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonArrayImpl.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/JsonArrayImpl.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonArraySubscript.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonArraySubscript.hpp new file mode 120000 index 00000000..f4c9b49f --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonArraySubscript.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/JsonArraySubscript.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonBuffer.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonBuffer.hpp new file mode 120000 index 00000000..6c858cf2 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonBuffer.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/JsonBuffer.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonBufferBase.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonBufferBase.hpp new file mode 120000 index 00000000..9667726e --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonBufferBase.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/JsonBufferBase.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonBufferImpl.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonBufferImpl.hpp new file mode 120000 index 00000000..18d18724 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonBufferImpl.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/JsonBufferImpl.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonObject.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonObject.hpp new file mode 120000 index 00000000..cd651af8 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonObject.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/JsonObject.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonObjectImpl.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonObjectImpl.hpp new file mode 120000 index 00000000..fc120e51 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonObjectImpl.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/JsonObjectImpl.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonObjectSubscript.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonObjectSubscript.hpp new file mode 120000 index 00000000..aff8cedf --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonObjectSubscript.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/JsonObjectSubscript.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonPair.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonPair.hpp new file mode 120000 index 00000000..5ab9e37f --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonPair.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/JsonPair.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariant.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariant.hpp new file mode 120000 index 00000000..88938191 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariant.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/JsonVariant.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantBase.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantBase.hpp new file mode 120000 index 00000000..ef96687a --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantBase.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/JsonVariantBase.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantCasts.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantCasts.hpp new file mode 120000 index 00000000..7b151811 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantCasts.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/JsonVariantCasts.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantComparisons.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantComparisons.hpp new file mode 120000 index 00000000..fbde472a --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantComparisons.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/JsonVariantComparisons.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantImpl.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantImpl.hpp new file mode 120000 index 00000000..1cf762da --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantImpl.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/JsonVariantImpl.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantOr.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantOr.hpp new file mode 120000 index 00000000..2e681038 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantOr.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/JsonVariantOr.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantSubscripts.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantSubscripts.hpp new file mode 120000 index 00000000..b9c68719 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/JsonVariantSubscripts.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/JsonVariantSubscripts.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/attributes.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/attributes.hpp new file mode 120000 index 00000000..155f0297 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/attributes.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Polyfills/attributes.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/ctype.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/ctype.hpp new file mode 120000 index 00000000..ead7311e --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/ctype.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Polyfills/ctype.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/isFloat.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/isFloat.hpp new file mode 120000 index 00000000..26c25ec1 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/isFloat.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Polyfills/isFloat.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/isInteger.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/isInteger.hpp new file mode 120000 index 00000000..b089ddda --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/isInteger.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Polyfills/isInteger.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/math.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/math.hpp new file mode 120000 index 00000000..08dc4a07 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/math.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Polyfills/math.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/parseFloat.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/parseFloat.hpp new file mode 120000 index 00000000..807d79cc --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/parseFloat.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Polyfills/parseFloat.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/parseInteger.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/parseInteger.hpp new file mode 120000 index 00000000..f8b71c49 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Polyfills/parseInteger.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Polyfills/parseInteger.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/RawJson.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/RawJson.hpp new file mode 120000 index 00000000..776d6fa6 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/RawJson.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/RawJson.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/DummyPrint.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/DummyPrint.hpp new file mode 120000 index 00000000..a678b3fa --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/DummyPrint.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Serialization/DummyPrint.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/DynamicStringBuilder.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/DynamicStringBuilder.hpp new file mode 120000 index 00000000..1cbefc2d --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/DynamicStringBuilder.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Serialization/DynamicStringBuilder.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/FloatParts.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/FloatParts.hpp new file mode 120000 index 00000000..e5517b17 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/FloatParts.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Serialization/FloatParts.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/IndentedPrint.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/IndentedPrint.hpp new file mode 120000 index 00000000..dd237b25 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/IndentedPrint.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Serialization/IndentedPrint.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/JsonPrintable.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/JsonPrintable.hpp new file mode 120000 index 00000000..9302620e --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/JsonPrintable.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Serialization/JsonPrintable.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/JsonSerializer.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/JsonSerializer.hpp new file mode 120000 index 00000000..c5d7fc18 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/JsonSerializer.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Serialization/JsonSerializer.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/JsonSerializerImpl.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/JsonSerializerImpl.hpp new file mode 120000 index 00000000..90c86927 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/JsonSerializerImpl.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Serialization/JsonSerializerImpl.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/JsonWriter.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/JsonWriter.hpp new file mode 120000 index 00000000..6c29719a --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/JsonWriter.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Serialization/JsonWriter.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/Prettyfier.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/Prettyfier.hpp new file mode 120000 index 00000000..d9b8b399 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/Prettyfier.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Serialization/Prettyfier.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/StaticStringBuilder.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/StaticStringBuilder.hpp new file mode 120000 index 00000000..abd7ad00 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/StaticStringBuilder.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Serialization/StaticStringBuilder.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/StreamPrintAdapter.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/StreamPrintAdapter.hpp new file mode 120000 index 00000000..0b2fb7e1 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/Serialization/StreamPrintAdapter.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/Serialization/StreamPrintAdapter.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/StaticJsonBuffer.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/StaticJsonBuffer.hpp new file mode 120000 index 00000000..58a1671f --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/StaticJsonBuffer.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/StaticJsonBuffer.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/ArduinoStream.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/ArduinoStream.hpp new file mode 120000 index 00000000..72294922 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/ArduinoStream.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/StringTraits/ArduinoStream.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/CharPointer.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/CharPointer.hpp new file mode 120000 index 00000000..199e2268 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/CharPointer.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/StringTraits/CharPointer.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/FlashString.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/FlashString.hpp new file mode 120000 index 00000000..b54ce1e3 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/FlashString.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/StringTraits/FlashString.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/StdStream.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/StdStream.hpp new file mode 120000 index 00000000..43f79ec8 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/StdStream.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/StringTraits/StdStream.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/StdString.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/StdString.hpp new file mode 120000 index 00000000..25212999 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/StdString.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/StringTraits/StdString.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/StringTraits.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/StringTraits.hpp new file mode 120000 index 00000000..625cd485 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/StringTraits/StringTraits.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/StringTraits/StringTraits.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/EnableIf.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/EnableIf.hpp new file mode 120000 index 00000000..287369f7 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/EnableIf.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/TypeTraits/EnableIf.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/FloatTraits.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/FloatTraits.hpp new file mode 120000 index 00000000..fdec4e7d --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/FloatTraits.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/TypeTraits/FloatTraits.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsArray.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsArray.hpp new file mode 120000 index 00000000..971d1e9b --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsArray.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/TypeTraits/IsArray.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsBaseOf.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsBaseOf.hpp new file mode 120000 index 00000000..090b4976 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsBaseOf.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/TypeTraits/IsBaseOf.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsChar.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsChar.hpp new file mode 120000 index 00000000..4b6b66df --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsChar.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/TypeTraits/IsChar.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsConst.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsConst.hpp new file mode 120000 index 00000000..45d0ca21 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsConst.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/TypeTraits/IsConst.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsFloatingPoint.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsFloatingPoint.hpp new file mode 120000 index 00000000..570741b3 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsFloatingPoint.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/TypeTraits/IsFloatingPoint.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsIntegral.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsIntegral.hpp new file mode 120000 index 00000000..96d7de10 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsIntegral.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/TypeTraits/IsIntegral.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsSame.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsSame.hpp new file mode 120000 index 00000000..05441bf0 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsSame.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/TypeTraits/IsSame.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsSignedIntegral.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsSignedIntegral.hpp new file mode 120000 index 00000000..0a12c043 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsSignedIntegral.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/TypeTraits/IsSignedIntegral.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsUnsignedIntegral.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsUnsignedIntegral.hpp new file mode 120000 index 00000000..4f557835 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsUnsignedIntegral.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/TypeTraits/IsUnsignedIntegral.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsVariant.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsVariant.hpp new file mode 120000 index 00000000..d16e5acb --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/IsVariant.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/TypeTraits/IsVariant.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/RemoveConst.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/RemoveConst.hpp new file mode 120000 index 00000000..9ac2769b --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/RemoveConst.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/TypeTraits/RemoveConst.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/RemoveReference.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/RemoveReference.hpp new file mode 120000 index 00000000..398d7679 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/TypeTraits/RemoveReference.hpp @@ -0,0 +1 @@ +../../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/TypeTraits/RemoveReference.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/ArduinoJson/version.hpp b/src/arduino-ide/SIGNALDuino/ArduinoJson/version.hpp new file mode 120000 index 00000000..36ce14f1 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/ArduinoJson/version.hpp @@ -0,0 +1 @@ +../../../_micro-api/libraries/ArduinoJson/src/ArduinoJson/version.hpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/FastDelegate.h b/src/arduino-ide/SIGNALDuino/FastDelegate.h new file mode 120000 index 00000000..3f0e43d9 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/FastDelegate.h @@ -0,0 +1 @@ +../../_micro-api/libraries/fastdelegate/src/FastDelegate.h \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/FastDelegateBind.h b/src/arduino-ide/SIGNALDuino/FastDelegateBind.h new file mode 120000 index 00000000..3ec476cd --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/FastDelegateBind.h @@ -0,0 +1 @@ +../../_micro-api/libraries/fastdelegate/src/FastDelegateBind.h \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/SIGNALDuino.ino b/src/arduino-ide/SIGNALDuino/SIGNALDuino.ino new file mode 100644 index 00000000..46015fa2 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/SIGNALDuino.ino @@ -0,0 +1 @@ +#include "main.h" diff --git a/src/arduino-ide/SIGNALDuino/SimpleFIFO.cpp b/src/arduino-ide/SIGNALDuino/SimpleFIFO.cpp new file mode 120000 index 00000000..8771bb53 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/SimpleFIFO.cpp @@ -0,0 +1 @@ +../../_micro-api/libraries/SimpleFIFO/src/SimpleFIFO.cpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/SimpleFIFO.h b/src/arduino-ide/SIGNALDuino/SimpleFIFO.h new file mode 120000 index 00000000..ca5e7567 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/SimpleFIFO.h @@ -0,0 +1 @@ +../../_micro-api/libraries/SimpleFIFO/src/SimpleFIFO.h \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/TimerOne.cpp b/src/arduino-ide/SIGNALDuino/TimerOne.cpp new file mode 120000 index 00000000..608f41e8 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/TimerOne.cpp @@ -0,0 +1 @@ +../../_micro-api/libraries/TimerOne/src/TimerOne.cpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/TimerOne.h b/src/arduino-ide/SIGNALDuino/TimerOne.h new file mode 120000 index 00000000..ea24ad08 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/TimerOne.h @@ -0,0 +1 @@ +../../_micro-api/libraries/TimerOne/src/TimerOne.h \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/WiFiManager.cpp b/src/arduino-ide/SIGNALDuino/WiFiManager.cpp new file mode 120000 index 00000000..9c316a78 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/WiFiManager.cpp @@ -0,0 +1 @@ +../../_micro-api/libraries/WIFIManager/WiFiManager.cpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/WiFiManager.h b/src/arduino-ide/SIGNALDuino/WiFiManager.h new file mode 120000 index 00000000..a54a4c87 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/WiFiManager.h @@ -0,0 +1 @@ +../../_micro-api/libraries/WIFIManager/WiFiManager.h \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/bitstore.cpp b/src/arduino-ide/SIGNALDuino/bitstore.cpp new file mode 120000 index 00000000..cbf2e55e --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/bitstore.cpp @@ -0,0 +1 @@ +../../_micro-api/libraries/bitstore/src/bitstore.cpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/bitstore.h b/src/arduino-ide/SIGNALDuino/bitstore.h new file mode 120000 index 00000000..f7e692a1 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/bitstore.h @@ -0,0 +1 @@ +../../_micro-api/libraries/bitstore/src/bitstore.h \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/cc1101.cpp b/src/arduino-ide/SIGNALDuino/cc1101.cpp new file mode 120000 index 00000000..480f4d85 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/cc1101.cpp @@ -0,0 +1 @@ +../../cc1101.cpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/cc1101.h b/src/arduino-ide/SIGNALDuino/cc1101.h new file mode 120000 index 00000000..a453c48c --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/cc1101.h @@ -0,0 +1 @@ +../../cc1101.h \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/commands.h b/src/arduino-ide/SIGNALDuino/commands.h new file mode 120000 index 00000000..850f55ba --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/commands.h @@ -0,0 +1 @@ +../../commands.h \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/compile_config.h b/src/arduino-ide/SIGNALDuino/compile_config.h new file mode 120000 index 00000000..6da54608 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/compile_config.h @@ -0,0 +1 @@ +../../compile_config.h \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/config/known_16bit_timers.h b/src/arduino-ide/SIGNALDuino/config/known_16bit_timers.h new file mode 120000 index 00000000..6ea3e900 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/config/known_16bit_timers.h @@ -0,0 +1 @@ +../../../_micro-api/libraries/TimerOne/src/config/known_16bit_timers.h \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/functions.h b/src/arduino-ide/SIGNALDuino/functions.h new file mode 120000 index 00000000..2022694e --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/functions.h @@ -0,0 +1 @@ +../../functions.h \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/main.h b/src/arduino-ide/SIGNALDuino/main.h new file mode 120000 index 00000000..c57517f8 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/main.h @@ -0,0 +1 @@ +../../main.h \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/output.h b/src/arduino-ide/SIGNALDuino/output.h new file mode 120000 index 00000000..eff7fdb7 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/output.h @@ -0,0 +1 @@ +../../_micro-api/libraries/output/src/output.h \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/send.h b/src/arduino-ide/SIGNALDuino/send.h new file mode 120000 index 00000000..cb674a42 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/send.h @@ -0,0 +1 @@ +../../send.h \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/signalDecoder.cpp b/src/arduino-ide/SIGNALDuino/signalDecoder.cpp new file mode 120000 index 00000000..88c12322 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/signalDecoder.cpp @@ -0,0 +1 @@ +../../_micro-api/libraries/signalDecoder/src/signalDecoder.cpp \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/signalDecoder.h b/src/arduino-ide/SIGNALDuino/signalDecoder.h new file mode 120000 index 00000000..26df6bdb --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/signalDecoder.h @@ -0,0 +1 @@ +../../_micro-api/libraries/signalDecoder/src/signalDecoder.h \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/signalSTM.h b/src/arduino-ide/SIGNALDuino/signalSTM.h new file mode 120000 index 00000000..19e0a5eb --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/signalSTM.h @@ -0,0 +1 @@ +../../signalSTM.h \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/signalduino.h b/src/arduino-ide/SIGNALDuino/signalduino.h new file mode 120000 index 00000000..df32bed4 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/signalduino.h @@ -0,0 +1 @@ +../../signalduino.h \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/signalesp.h b/src/arduino-ide/SIGNALDuino/signalesp.h new file mode 120000 index 00000000..381b884e --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/signalesp.h @@ -0,0 +1 @@ +../../signalesp.h \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/strings_en.h b/src/arduino-ide/SIGNALDuino/strings_en.h new file mode 120000 index 00000000..3316e7a6 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/strings_en.h @@ -0,0 +1 @@ +../../_micro-api/libraries/WIFIManager/strings_en.h \ No newline at end of file diff --git a/src/arduino-ide/SIGNALDuino/wifi-config.h b/src/arduino-ide/SIGNALDuino/wifi-config.h new file mode 120000 index 00000000..6fd28799 --- /dev/null +++ b/src/arduino-ide/SIGNALDuino/wifi-config.h @@ -0,0 +1 @@ +../../wifi-config.h \ No newline at end of file diff --git a/cc1101.cpp b/src/cc1101.cpp similarity index 56% rename from cc1101.cpp rename to src/cc1101.cpp index 31a377b6..07064ae3 100644 --- a/cc1101.cpp +++ b/src/cc1101.cpp @@ -1,40 +1,43 @@ - -#include "cc1101.h" +#include "cc1101.h" + +#ifdef ARDUINO_MAPLEMINI_F103CB + SPIClass SPI_2(mosiPin, misoPin, sckPin); +#endif uint8_t cc1101::revision = 0x01; - const uint8_t cc1101::initVal[] PROGMEM = +const uint8_t cc1101::initVal[] PROGMEM = { - // IDX NAME RESET COMMENT + // IDX NAME RESET COMMENT 0x0D, // 00 IOCFG2 29 GDO2 as serial output 0x2E, // 01 IOCFG1 Tri-State 0x2D, // 02 IOCFG0 3F GDO0 for input //0x07, // 03 FIFOTHR RX filter bandwidth > 325 kHz, FIFOTHR = 0x07 0x47, // 03 FIFOTHR RX filter bandwidth = 325 kHz, FIFOTHR = 0x47 -0xD3, // 04 SYNC1 -0x91, // 05 SYNC0 +0xD3, // 04 SYNC1 +0x91, // 05 SYNC0 0x3D, // 06 PKTLEN 0F -0x04, // 07 PKTCTRL1 -0x32, // 08 PKTCTRL0 45 -0x00, // 09 ADDR -0x00, // 0A CHANNR +0x04, // 07 PKTCTRL1 +0x32, // 08 PKTCTRL0 45 +0x00, // 09 ADDR +0x00, // 0A CHANNR 0x06, // 0B FSCTRL1 0F 152kHz IF Frquency 0x00, // 0C FSCTRL0 0x10, // 0D FREQ2 1E Freq #12 Reg Pos 0C -0xB0, // 0E FREQ1 C4 Reg Pos 0D -0x71, // 0F FREQ0 EC Reg Pos 0E +0xB0, // 0E FREQ1 C4 Reg Pos 0D +0x71, // 0F FREQ0 EC Reg Pos 0E 0x57, // 10 MDMCFG4 8C bWidth 325kHz 0xC4, // 11 MDMCFG3 22 DataRate 0x30, // 12 MDMCFG2 02 Modulation: ASK -0x23, // 13 MDMCFG1 22 +0x23, // 13 MDMCFG1 22 0xb9, // 14 MDMCFG0 F8 ChannelSpace: 350kHz -0x00, // 15 DEVIATN 47 -0x07, // 16 MCSM2 07 +0x00, // 15 DEVIATN 47 +0x07, // 16 MCSM2 07 0x00, // 17 MCSM1 30 Bit 3:2 RXOFF_MODE: Select what should happen when a packet has been received: 0 = IDLE 3 = Stay in RX #### 0x18, // 18 MCSM0 04 Calibration: RX/TX->IDLE -0x14, // 19 FOCCFG 36 +0x14, // 19 FOCCFG 36 0x6C, // 1A BSCFG 0x07, // 1B AGCCTRL2 03 42 dB instead of 33dB -0x00, // 1C AGCCTRL1 40 +0x00, // 1C AGCCTRL1 40 //0x90, // 1D AGCCTRL0 90 4dB decision boundery 0x91, // 1D AGCCTRL0 91 8dB decision boundery 0x87, // 1E WOREVT1 @@ -43,52 +46,57 @@ uint8_t cc1101::revision = 0x01; //0x56, // 21 FREND1 56 RX filter bandwidth = 101 kHz, FREND1 = 0x56 0xB6, // 21 FREND1 B6 RX filter bandwidth > 101 kHz, FREND1 = 0xB6 0x11, // 22 FREND0 16 0x11 for no PA ramping -0xE9, // 23 FSCAL3 A9 E9 ?? -0x2A, // 24 FSCAL2 0A +0xE9, // 23 FSCAL3 A9 E9 ?? +0x2A, // 24 FSCAL2 0A 0x00, // 25 FSCAL1 20 19 ?? -0x1F, // 26 FSCAL0 0D +0x1F, // 26 FSCAL0 0D 0x41, // 27 RCCTRL1 0x00, // 28 RCCTRL0 }; - byte cc1101::hex2int(byte hex) { // convert a hexdigit to int // Todo: printf oder scanf nutzen - if (hex >= '0' && hex <= '9') hex = hex - '0'; - else if (hex >= 'a' && hex <= 'f') hex = hex - 'a' + 10; - else if (hex >= 'A' && hex <= 'F') hex = hex - 'A' + 10; - return hex; - // printf ("%d\n",$hex) ?? - } +byte cc1101::hex2int(byte hex) { // convert a hexdigit to int // Todo: printf oder scanf nutzen + if (hex >= '0' && hex <= '9') hex = hex - '0'; + else if (hex >= 'a' && hex <= 'f') hex = hex - 'a' + 10; + else if (hex >= 'A' && hex <= 'F') hex = hex - 'A' + 10; + return hex; + // printf ("%d\n",$hex) ?? +} -uint8_t cc1101::sendSPI(const uint8_t val) { // send byte via SPI -#if !defined(ESP8266) && !defined(ESP32) - SPDR = val; // transfer byte via SPI - while (!(SPSR & _BV(SPIF))); // wait until SPI operation is terminated - return SPDR; +uint8_t cc1101::sendSPI(const uint8_t val) { // send byte via SPI +#if !defined(ESP8266) && !defined(ESP32) && !defined(ARDUINO_MAPLEMINI_F103CB) + SPDR = val; // transfer byte via SPI + while (!(SPSR & _BV(SPIF))); // wait until SPI operation is terminated + return SPDR; #else - return SPI.transfer(val); + #ifdef ARDUINO_MAPLEMINI_F103CB + return SPI_2.transfer(val); // transfer use SPI2 on ARDUINO_MAPLEMINI_F103CB board + #else + return SPI.transfer(val); + #endif #endif - } +} -uint8_t cc1101::cmdStrobe(const uint8_t cmd) { // send command strobe to the CC1101 IC via SPI +uint8_t cc1101::cmdStrobe(const uint8_t cmd) { // send command strobe to the CC1101 IC via SPI cc1101_Select(); // select CC1101 wait_Miso_rf(); // wait until MISO goes low uint8_t ret = sendSPI(cmd); // send strobe command wait_Miso_rf(); // wait until MISO goes low cc1101_Deselect(); // deselect CC1101 - return ret; // Chip Status Byte - } + return ret; // Chip Status Byte +} + uint8_t cc1101::readReg(const uint8_t regAddr, const uint8_t regType) { // read CC1101 register via SPI cc1101_Select(); // select CC1101 - wait_Miso_rf(); // wait until MISO goes low + wait_Miso_rf(); // wait until MISO goes low sendSPI(regAddr | regType); // send register address uint8_t val = sendSPI(0x00); // read result cc1101_Deselect(); // deselect CC1101 return val; } -void cc1101::writeReg(const uint8_t regAddr, const uint8_t val) { // write single register into the CC1101 IC via SPI +void cc1101::writeReg(const uint8_t regAddr, const uint8_t val) { // write single register into the CC1101 IC via SPI cc1101_Select(); // select CC1101 wait_Miso(); // wait until MISO goes low sendSPI(regAddr); // send register address @@ -103,9 +111,9 @@ void cc1101::readPatable(void) { cc1101_Select(); // select CC1101 wait_Miso(); // wait until MISO goes low - sendSPI(CC1100_PATABLE | CC1100_READ_BURST); // send register address + sendSPI(CC1101_PATABLE | CC1101_READ_BURST); // send register address for (uint8_t i = 0; i < 8; i++) { - PatableArray[i] = sendSPI(0x00); // read result + PatableArray[i] = sendSPI(0x00); // read result } cc1101_Deselect(); char b[4]; @@ -120,15 +128,14 @@ void cc1101::readPatable(void) { void cc1101::writePatable(void) { cc1101_Select(); // select CC1101 wait_Miso(); // wait until MISO goes low - sendSPI(CC1100_PATABLE | CC1100_WRITE_BURST); // send register address + sendSPI(CC1101_PATABLE | CC1101_WRITE_BURST); // send register address for (uint8_t i = 0; i < 8; i++) { - sendSPI(EEPROM.read(EE_CC1100_PA + i)); // send value + sendSPI(EEPROM.read(EE_CC1101_PA + i)); // send value } cc1101_Deselect(); } - -void cc1101::readCCreg(const uint8_t reg) { // read CC11001 register +void cc1101::readCCreg(const uint8_t reg) { // read CC1101 register uint8_t var; uint8_t n; char b[11]; @@ -182,14 +189,13 @@ void cc1101::readCCreg(const uint8_t reg) { // read CC11001 register } void cc1101::commandStrobes(void) { - uint8_t reg; uint8_t val; uint8_t val1; if (isHexadecimalDigit(IB_1[3])) { - reg = (uint8_t)strtol(&IB_1[3], nullptr, 16); - if (reg < 0x3e) { + reg = (uint8_t)strtol(&IB_1[2], nullptr, 16); // address strobe command | CC1101 - Table 42: Command Strobes + if (reg < 0x3E) { val = cmdStrobe(reg); delay(1); val1 = cmdStrobe(0x3D); // No operation. May be used to get access to the chip status byte. @@ -200,25 +206,27 @@ void cc1101::commandStrobes(void) { } } -void cc1101::writeCCreg(uint8_t reg, uint8_t var) { // write CC11001 register +void cc1101::writeCCreg(uint8_t reg, uint8_t var) { // write CC1101 register if (reg > 1 && reg < 0x40) { - writeReg(reg - EE_CC1100_CFG, var); + writeReg(reg - EE_CC1101_CFG, var); char b[6]; - sprintf_P(b, PSTR("W%02X%02X"), reg, var); + // sprintf_P(b, PSTR("W%02X%02X"), reg, var); + sprintf(b,"W%02X%02X",reg,var); MSG_PRINTLN(b); } } -void cc1101::writeCCpatable(uint8_t var) { // write 8 byte to patable (kein pa ramping) + +void cc1101::writeCCpatable(uint8_t var) { // write 8 byte to patable (kein pa ramping) for (uint8_t i = 0; i < 8; i++) { if (i == 1) { - EEPROM.write(EE_CC1100_PA + i, var); + EEPROM.write(EE_CC1101_PA + i, var); } else { - EEPROM.write(EE_CC1100_PA + i, 0); + EEPROM.write(EE_CC1101_PA + i, 0); } } - #ifdef ESP8266 - EEPROM.commit(); + #if defined(ESP8266) || defined(ESP32) + EEPROM.commit(); #endif writePatable(); } @@ -240,20 +248,21 @@ uint8_t cc1101::chipVersion() { } bool cc1101::checkCC1101() { - +#ifdef CMP_CC1101 uint8_t version = chipVersion(); // Version -#ifdef DEBUG - uint8_t partnum = readReg((revision == 0x01 ? CC1101_PARTNUM_REV01 : CC1101_PARTNUM_REV00), CC1101_READ_SINGLE); // Partnum - DBG_PRINT(FPSTR(TXT_CCREVISION)); DBG_PRINTLN("0x" + String(version, HEX)); - DBG_PRINT(FPSTR(TXT_CCPARTNUM)); DBG_PRINTLN("0x" + String(partnum, HEX)); //TODO String Klasse entfernen -#endif + #ifdef DEBUG + uint8_t partnum = readReg((revision == 0x01 ? CC1101_PARTNUM_REV01 : CC1101_PARTNUM_REV00), CC1101_READ_SINGLE); // Partnum + DBG_PRINT(FPSTR(TXT_CCREVISION)); DBG_PRINTLN("0x" + String(version, HEX)); + DBG_PRINT(FPSTR(TXT_CCPARTNUM)); DBG_PRINTLN("0x" + String(partnum, HEX)); // TODO String Klasse entfernen + #endif //checks if valid Chip ID is found. Usualy 0x03 or 0x14. if not -> abort if (version == 0x00 || version == 0xFF) { - DBG_PRINT(F("no ")); DBG_PRINT(FPSTR(TXT_CC1101)); DBG_PRINTLN(FPSTR(TXT_FOUND));// F("no CC11xx found!")); + DBG_PRINT(F("no ")); DBG_PRINT(FPSTR(TXT_CC1101)); DBG_PRINTLN(FPSTR(TXT_FOUND)); // F("no CC11xx found!")); return false; // Todo: power down SPI etc } - return true; +#endif // CMP_CC1101 +return true; } @@ -264,26 +273,53 @@ void cc1101::setup() pinAsOutput(mosiPin); pinAsInput(misoPin); #endif - pinAsOutput(csPin); // set pins for SPI communication + +#ifndef ARDUINO_MAPLEMINI_F103CB + pinAsOutput(csPin); // set pins for SPI communication +#endif #ifdef PIN_MARK433 pinAsInputPullUp(PIN_MARK433); #endif -#if !defined(ESP8266) && !defined(ESP32) - SPCR = _BV(SPE) | _BV(MSTR); // SPI speed = CLK/4 - digitalHigh(csPin); // SPI init +#if !defined(ESP8266) && !defined(ESP32) && !defined(ARDUINO_MAPLEMINI_F103CB) + SPCR = _BV(SPE) | _BV(MSTR); // SPI speed = CLK/4 + digitalHigh(csPin); // SPI init digitalHigh(sckPin); digitalLow(mosiPin); +#elif ARDUINO_MAPLEMINI_F103CB + // Setup SPI 2 + SPI_2.begin(); // Initialize the SPI_2 port. + SPI_2.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE0)); + + /* these are preparations if the project can be expanded to 4 cc110x + pinAsOutput(radioCsPin[0]); + digitalHigh(radioCsPin[0]); + */ + + pinAsOutput(radioCsPin[1]); + digitalHigh(radioCsPin[1]); + + /* these are preparations if the project can be expanded to 4 cc110x + pinAsOutput(radioCsPin[2]); + digitalHigh(radioCsPin[2]); + pinAsOutput(radioCsPin[3]); + digitalHigh(radioCsPin[3]); + */ #else SPI.setDataMode(SPI_MODE0); SPI.setBitOrder(MSBFIRST); SPI.begin(); SPI.setClockDivider(SPI_CLOCK_DIV4); #endif - pinAsInput(PIN_RECEIVE); // gdo2 - pinAsInput(PIN_SEND); // gdo0Pi, sicherheitshalber bis zum CC1101 init erstmal input +pinAsInput(PIN_RECEIVE); // gdo2 +pinAsInput(PIN_SEND); // gdo0Pi, sicherheitshalber bis zum CC1101 init erstmal input + +#ifndef ARDUINO_MAPLEMINI_F103CB + digitalHigh(sckPin); + digitalLow(mosiPin); +#endif } uint8_t cc1101::getRevision() @@ -291,17 +327,17 @@ uint8_t cc1101::getRevision() uint8_t cc1101::getRSSI() { - return readReg((revision == 0x01 ? CC1100_RSSI_REV01 : CC1100_RSSI_REV00), CC1101_STATUS); + return readReg((revision == 0x01 ? CC1101_RSSI_REV01 : CC1101_RSSI_REV00), CC1101_STATUS); } void cc1101::setIdleMode() { - cmdStrobe(CC1100_SIDLE); // Idle mode + cmdStrobe(CC1101_SIDLE); // Idle mode delay(1); } uint8_t cc1101::currentMode() { - return readReg((revision == 0x01 ? CC1100_MARCSTATE_REV01 : CC1100_MARCSTATE_REV00), CC1100_READ_BURST); + return readReg((revision == 0x01 ? CC1101_MARCSTATE_REV01 : CC1101_MARCSTATE_REV00), CC1101_READ_BURST); } void cc1101::setReceiveMode() @@ -309,7 +345,7 @@ void cc1101::setReceiveMode() setIdleMode(); uint8_t maxloop = 0xff; - while (maxloop-- && (cmdStrobe(CC1100_SRX) & CC1100_STATUS_STATE_BM) != CC1100_STATE_RX) // RX enable + while (maxloop-- && (cmdStrobe(CC1101_SRX) & CC1101_STATUS_STATE_BM) != CC1101_STATE_RX) // RX enable delay(1); if (maxloop == 0) DBG_PRINTLN("CC1101: Setting RX failed"); pinAsInput(PIN_SEND); @@ -317,14 +353,15 @@ void cc1101::setReceiveMode() void cc1101::setTransmitMode() { - cmdStrobe(CC1100_SFTX); // wird dies benoetigt? Wir verwenden kein FIFO + cmdStrobe(CC1101_SFTX); // wird dies benoetigt? Wir verwenden kein FIFO setIdleMode(); uint8_t maxloop = 0xff; - while (maxloop-- && (cmdStrobe(CC1100_STX) & CC1100_STATUS_STATE_BM) != CC1100_STATE_TX) // TX enable + while (maxloop-- && (cmdStrobe(CC1101_STX) & CC1101_STATUS_STATE_BM) != CC1101_STATE_TX) // TX enable delay(1); +#ifdef CMP_CC1101 if (maxloop == 0) DBG_PRINT(FPSTR(TXT_CC1101)); DBG_PRINTLN(F(": Setting TX failed")); +#endif pinAsOutput(PIN_SEND); // gdo0Pi, sicherheitshalber bis zum CC1101 init erstmal input - } @@ -332,68 +369,71 @@ bool cc1101::regCheck() { //char b[3]; //uint8_t val; - +#ifdef CMP_CC1101 DBG_PRINT(FPSTR(TXT_CC1101)); - DBG_PRINT(F("_PKTCTRL0=")); DBG_PRINT(readReg(CC1100_PKTCTRL0, CC1101_CONFIG)); - DBG_PRINT(F(" vs initval PKTCTRL0=")); DBG_PRINTLN(cc1101::initVal[CC1100_PKTCTRL0]); + DBG_PRINT(F("_PKTCTRL0=")); DBG_PRINT(readReg(CC1101_PKTCTRL0, CC1101_CONFIG)); + DBG_PRINT(F(" vs initval PKTCTRL0=")); DBG_PRINTLN(cc1101::initVal[CC1101_PKTCTRL0]); DBG_PRINT(FPSTR(TXT_CC1101)); - DBG_PRINT(F("_IOCFG2=")); DBG_PRINT(readReg(CC1100_IOCFG2, CC1101_CONFIG)); - DBG_PRINT(F(" vs initval IOCFG2=")); DBG_PRINTLN(cc1101::initVal[CC1100_IOCFG2]); + DBG_PRINT(F("_IOCFG2=")); DBG_PRINT(readReg(CC1101_IOCFG2, CC1101_CONFIG)); + DBG_PRINT(F(" vs initval IOCFG2=")); DBG_PRINTLN(cc1101::initVal[CC1101_IOCFG2]); /* DBG_PRINT(FPSTR(TXT_CC1101)); - DBG_PRINT(F("_FREQ0=")); DBG_PRINT(readReg(CC1100_FREQ0, CC1101_CONFIG)); - DBG_PRINT(F(" vs initval FREQ0=")); DBG_PRINT(cc1101::initVal[CC1100_FREQ0]); + DBG_PRINT(F("_FREQ0=")); DBG_PRINT(readReg(CC1101_FREQ0, CC1101_CONFIG)); + DBG_PRINT(F(" vs initval FREQ0=")); DBG_PRINT(cc1101::initVal[CC1101_FREQ0]); DBG_PRINT(F(" vs EEPROM FREQ0")); - val = EEPROM.read(EE_CC1100_CFG + CC1100_FREQ0); + val = EEPROM.read(EE_CC1101_CFG + CC1101_FREQ0); sprintf(b, " %d", val); DBG_PRINTLN(b); DBG_PRINT(FPSTR(TXT_CC1101)); - DBG_PRINT(F("_FREQ1=")); DBG_PRINT(readReg(CC1100_FREQ1, CC1101_CONFIG)); - DBG_PRINT(F(" vs initval FREQ1=")); DBG_PRINT(cc1101::initVal[CC1100_FREQ1]); + DBG_PRINT(F("_FREQ1=")); DBG_PRINT(readReg(CC1101_FREQ1, CC1101_CONFIG)); + DBG_PRINT(F(" vs initval FREQ1=")); DBG_PRINT(cc1101::initVal[CC1101_FREQ1]); DBG_PRINT(F(" vs EEPROM FREQ1=")); - val = EEPROM.read(EE_CC1100_CFG + CC1100_FREQ1); + val = EEPROM.read(EE_CC1101_CFG + CC1101_FREQ1); sprintf(b, " %d", val); DBG_PRINTLN(b); DBG_PRINT(FPSTR(TXT_CC1101)); - DBG_PRINT(F("_FREQ2=")); DBG_PRINT(readReg(CC1100_FREQ2, CC1101_CONFIG)); - DBG_PRINT(F(" vs initval FREQ2=")); DBG_PRINT(cc1101::initVal[CC1100_FREQ2]); + DBG_PRINT(F("_FREQ2=")); DBG_PRINT(readReg(CC1101_FREQ2, CC1101_CONFIG)); + DBG_PRINT(F(" vs initval FREQ2=")); DBG_PRINT(cc1101::initVal[CC1101_FREQ2]); DBG_PRINT(F(" vs EEPROM FREQ2=")); - val = EEPROM.read(EE_CC1100_CFG+CC1100_FREQ2); + val = EEPROM.read(EE_CC1101_CFG+CC1101_FREQ2); sprintf(b, " %d", val); DBG_PRINTLN(b); */ - return (readReg(CC1100_PKTCTRL0, CC1101_CONFIG) == cc1101::initVal[CC1100_PKTCTRL0]) && (readReg(CC1100_IOCFG2, CC1101_CONFIG) == cc1101::initVal[CC1100_IOCFG2]); + return (readReg(CC1101_PKTCTRL0, CC1101_CONFIG) == cc1101::initVal[CC1101_PKTCTRL0]) && (readReg(CC1101_IOCFG2, CC1101_CONFIG) == cc1101::initVal[CC1101_IOCFG2]); +#else + return (""); +#endif } -void cc1101::ccFactoryReset() { +void cc1101::ccFactoryReset() { // reset CC1101 and set default values for (uint8_t i = 0; i < sizeof(cc1101::initVal); i++) { - EEPROM.write(EE_CC1100_CFG + i, pgm_read_byte(&initVal[i])); + EEPROM.write(EE_CC1101_CFG + i, pgm_read_byte(&initVal[i])); DBG_PRINT("."); } for (uint8_t i = 0; i < 8; i++) { if (i == 1) { - EEPROM.write(EE_CC1100_PA + i, PATABLE_DEFAULT); + EEPROM.write(EE_CC1101_PA + i, PATABLE_DEFAULT); } else { - EEPROM.write(EE_CC1100_PA + i, 0); + EEPROM.write(EE_CC1101_PA + i, 0); } } - #ifdef ESP8266 - EEPROM.commit(); + #if defined(ESP8266) || defined(ESP32) + EEPROM.commit(); #endif MSG_PRINTLN("ccFactoryReset done"); } -void cc1101::CCinit(void) { // initialize CC1101 - +void cc1101::CCinit(void) { // initialize CC1101 +#ifdef CMP_CC1101 DBG_PRINT(FPSTR(TXT_CCINIT)); - cc1101_Deselect(); // some deselect and selects to init the cc1101 + cc1101_Deselect(); // some deselect and selects to init the cc1101 delayMicroseconds(30); // Begin of power on reset @@ -404,25 +444,28 @@ void cc1101::CCinit(void) { // initialize CC1101 delayMicroseconds(45); DBG_PRINT(F("SRES Started,")); - cmdStrobe(CC1101_SRES); // send reset + cmdStrobe(CC1101_SRES); // send reset DBG_PRINT(F("POR Done,")); delay(10); cc1101_Select(); DBG_PRINT(FPSTR(TXT_EEPROM)); DBG_PRINT(FPSTR(TXT_BLANK)); DBG_PRINT(FPSTR(TXT_READ)); + wait_Miso(); // Wait until MISO goes low - sendSPI(CC1100_WRITE_BURST); - for (uint8_t i = 0; i < sizeof(cc1101::initVal); i++) { // write EEPROM value to cc11001 - sendSPI(EEPROM.read(EE_CC1100_CFG + i)); + sendSPI(0x00 | CC1101_WRITE_BURST); + for (uint8_t i = 0; i < sizeof(cc1101::initVal); i++) { // write EEPROM value to cc1101 + sendSPI(EEPROM.read(EE_CC1101_CFG + i)); DBG_PRINT("."); - + } cc1101_Deselect(); delayMicroseconds(10); // ### todo: welcher Wert ist als delay sinnvoll? ### - writePatable(); // write PatableArray to patable reg + writePatable(); // write PatableArray to patable reg DBG_PRINTLN(F("done")); delay(1); setReceiveMode(); + +#endif } diff --git a/src/cc1101.h b/src/cc1101.h new file mode 100644 index 00000000..b87aeee4 --- /dev/null +++ b/src/cc1101.h @@ -0,0 +1,208 @@ +// cc1101.h esp +#pragma once +#ifndef _CC1101_h +#define _CC1101_h + +#if defined(ARDUINO) && ARDUINO >= 100 + #include "Arduino.h" +#else +// #include "WProgram.h" +#endif +#include "compile_config.h" + +#include +#include "output.h" + +extern char IB_1[14]; + +#ifdef ARDUINO_MAPLEMINI_F103CB // only ARDUINO_MAPLEMINI_F103CB / MAPLE_Mini + extern uint8_t radionr; +#endif + + +#if defined(ESP8266) || defined(ESP32) || defined(ARDUINO_MAPLEMINI_F103CB) +#include +#endif +namespace cc1101 { + /* + #ifdef ARDUINO_AVR_ICT_BOARDS_ICT_BOARDS_AVR_RADINOCC1101 + #define SS 8 + #define PIN_MARK433 4 // LOW -> 433Mhz | HIGH -> 868Mhz + + #elif ARDUINO_ATMEGA328P_MINICUL // 8Mhz + #define PIN_MARK433 0 + #endif + */ + +#ifdef ARDUINO_MAPLEMINI_F103CB +/* + https://forum.fhem.de/index.php/topic,106278.0.html | https://forum.fhem.de/index.php/topic,109220.0.html +*/ + const uint8_t radioCsPin[] = {31, 12, 15, 3}; // PINs from Circuit board for 4 cc110x + #define csPin 12 // CSN out - SPI2 , default PIN radionbank 1 -> compatible with other project + #define mosiPin 28 // MOSI out - SPI2 + #define misoPin 29 // MISO in - SPI2 + #define sckPin 30 // SCLK out - SPI2 +#else + #define csPin SS // CSN out + #define mosiPin MOSI // MOSI out + #define misoPin MISO // MISO in + #define sckPin SCK // SCLK out +#endif + + #define CC1101_WRITE_BURST 0x40 + #define CC1101_WRITE_SINGLE 0x00 + #define CC1101_READ_BURST 0xC0 + #define CC1101_READ_SINGLE 0x80 + #define CC1101_CONFIG CC1101_READ_SINGLE + #define CC1101_STATUS CC1101_READ_BURST + + #define CC1101_FREQ2 0x0D // Frequency control word, high byte + #define CC1101_FREQ1 0x0E // Frequency control word, middle byte + #define CC1101_FREQ0 0x0F // Frequency control word, low byte + #define CC1101_PATABLE 0x3E // 8 byte memory + #define CC1101_IOCFG2 0x00 // GDO2 output configuration + #define CC1101_PKTCTRL0 0x08 // Packet config register + + extern uint8_t revision; + extern const uint8_t initVal[]; + // Status registers - newer version base on 0xF0 + #define CC1101_PARTNUM_REV01 0xF0 // Chip ID + #define CC1101_VERSION_REV01 0xF1 // Chip ID + #define CC1101_RSSI_REV01 0xF4 // Received signal strength indication + #define CC1101_MARCSTATE_REV01 0xF5 // Control state machine state + + // Status registers - older version base on 0x30 + #define CC1101_PARTNUM_REV00 0x30 // Chip ID + #define CC1101_VERSION_REV00 0x31 // Chip ID + #define CC1101_RSSI_REV00 0x34 // Received signal strength indication + #define CC1101_MARCSTATE_REV00 0x35 // Control state machine state + + // Strobe commands + #define CC1101_SRES 0x30 // reset + #define CC1101_SFSTXON 0x31 // Enable and calibrate frequency synthesizer (if MCSM0.FS_AUTOCAL=1). + #define CC1101_SCAL 0x33 // Calibrate frequency synthesizer and turn it off + #define CC1101_SRX 0x34 // Enable RX. Perform calibration first if coming from IDLE and MCSM0.FS_AUTOCAL=1 + #define CC1101_STX 0x35 // In IDLE state: Enable TX. Perform calibration first if MCSM0.FS_AUTOCAL=1 + #define CC1101_SIDLE 0x36 // Exit RX / TX, turn off frequency synthesizer + #define CC1101_SAFC 0x37 // Perform AFC adjustment of the frequency synthesizer + #define CC1101_SFTX 0x3B // Flush the TX FIFO buffer. + #define CC1101_SNOP 0x3D // + + enum CC1101_MarcState { + MarcStateSleep = 0x00u + , MarcStateIdle = 0x01u + , MarcStateXOff = 0x02u + , MarcStateVConnManCal = 0x03u + , MarcStateRegOnManCal = 0x04u + , MarcStateManCal = 0x05u + , MarcStateVConnFSWakeUp = 0x06u + , MarcStateRegOnFSWakeUp = 0x07u + , MarcStateStartCalibrate = 0x08u + , MarcStateBWBoost = 0x09u + , MarcStateFSLock = 0x0Au + , MarcStateIfadCon = 0x0Bu + , MarcStateEndCalibrate = 0x0Cu + , MarcStateRx = 0x0Du + , MarcStateRxEnd = 0x0Eu + , MarcStateRxRst = 0x0Fu + , MarcStateTxRxSwitch = 0x10u + , MarcStateRxFifoOverflow = 0x11u + , MarcStateFsTxOn = 0x12u + , MarcStateTx = 0x13u + , MarcStateTxEnd = 0x14u + , MarcStateRxTxSwitch = 0x15u + , MarcStateTxFifoUnerflow = 0x16u + }; + +#if defined(ESP8266) || defined(ESP32) + #define pinAsInput(pin) pinMode(pin, INPUT) + #define pinAsOutput(pin) pinMode(pin, OUTPUT) + #define pinAsInputPullUp(pin) pinMode(pin, INPUT_PULLUP) + + #ifndef digitalLow + #define digitalLow(pin) digitalWrite(pin, LOW) + #endif + #ifndef digitalHigh + #define digitalHigh(pin) digitalWrite(pin, HIGH) + #endif + #ifndef isHigh + #define isHigh(pin) (digitalRead(pin) == HIGH) + #endif +#endif + + #define wait_Miso() while(isHigh(misoPin) ) { static uint8_t miso_count=255;delay(1); if(miso_count==0) return; miso_count--; } // wait until SPI MISO line goes low + #define wait_Miso_rf() while(isHigh(misoPin) ) { static uint8_t miso_count=255;delay(1); if(miso_count==0) return false; miso_count--; } // wait until SPI MISO line goes low + +#ifdef ARDUINO_MAPLEMINI_F103CB + #define cc1101_Select() digitalLow(radioCsPin[radionr]) // select (SPI) CC1101 | variant from array, Circuit board for 4 cc110x + #define cc1101_Deselect() digitalHigh(radioCsPin[radionr]) +#else + #define cc1101_Select() digitalLow(csPin) // select (SPI) CC1101 + #define cc1101_Deselect() digitalHigh(csPin) +#endif + + #define EE_CC1101_CFG 2 + #define EE_CC1101_CFG_SIZE 0x29 + #define EE_CC1101_PA 0x30 // (EE_CC1101_CFG+EE_CC1101_CFG_SIZE) // 2C + #define EE_CC1101_PA_SIZE 8 + + #define PATABLE_DEFAULT 0x84 // 5 dB default value for factory reset + + //------------------------------------------------------------------------------ + // Chip Status Byte + //------------------------------------------------------------------------------ + + // Bit fields in the chip status byte + #define CC1101_STATUS_CHIP_RDYn_BM 0x80 + #define CC1101_STATUS_STATE_BM 0x70 + #define CC1101_STATUS_FIFO_BYTES_AVAILABLE_BM 0x0F + + // Chip states + #define CC1101_STATE_IDLE 0x00 + #define CC1101_STATE_RX 0x10 + #define CC1101_STATE_TX 0x20 + #define CC1101_STATE_FSTXON 0x30 + #define CC1101_STATE_CALIBRATE 0x40 + #define CC1101_STATE_SETTLING 0x50 + #define CC1101_STATE_RX_OVERFLOW 0x60 + #define CC1101_STATE_TX_UNDERFLOW 0x70 + + + #ifdef ARDUINO_AVR_ICT_BOARDS_ICT_BOARDS_AVR_RADINOCC1101 + //uint8_t RADINOVARIANT = 0; // Standardwert welcher je radinoVarinat geaendert wird + #endif + + + + byte hex2int(byte hex); // convert a hexdigit to int // Todo: printf oder scanf nutzen + uint8_t sendSPI(const uint8_t val); // send byte via SPI + uint8_t cmdStrobe(const uint8_t cmd); + uint8_t readReg(const uint8_t regAddr, const uint8_t regType); // read CC1101 register via SPI + void writeReg(const uint8_t regAddr, const uint8_t val); // write single register into the CC1101 IC via SPI + void readPatable(void); + void writePatable(void); + void readCCreg(const uint8_t reg); // read CC1101 register + void commandStrobes(void); + void writeCCreg(uint8_t reg, uint8_t var); // write CC1101 register + void writeCCpatable(uint8_t var); // write 8 byte to patable (kein pa ramping) + void ccFactoryReset(); + + uint8_t chipVersionRev(); + uint8_t chipVersion(); + bool checkCC1101(); + void setup(); + uint8_t getRevision(); + uint8_t getRSSI(); + void setIdleMode(); + uint8_t currentMode(); + void setReceiveMode(); + void setTransmitMode(); + + void CCinit(void); // initialize CC1101 + + bool regCheck(); + +} + +#endif diff --git a/commands.h b/src/commands.h similarity index 95% rename from commands.h rename to src/commands.h index 5be13402..a0739852 100644 --- a/commands.h +++ b/src/commands.h @@ -27,7 +27,7 @@ extern volatile bool blinkLED; namespace commands { - + inline void getPing() @@ -159,6 +159,7 @@ namespace commands { break; case cmd_ping: getPing(); + break; case cmd_Version: MSG_PRINT(F("V " PROGVERS PROGNAME)); #ifdef CMP_CC1101 @@ -186,9 +187,9 @@ namespace commands { MSG_PRINT("0E"); break; case 0x07: + case 0x17: MSG_PRINT("L"); break; - break; default: MSG_PRINT(" unknown"); break; @@ -198,6 +199,14 @@ namespace commands { #endif #ifdef CMP_CC1101 } +#endif +#ifdef DEBUG + MSG_PRINT(F(" DBG")); +#endif +#ifdef WATCHDOG_STM32 + if (watchRes) { + MSG_PRINT(F(" wr")); + } #endif MSG_PRINTLN(F(" - compiled at " __DATE__ " " __TIME__)); break; @@ -237,6 +246,7 @@ namespace commands { if (hasCC1101) { cc1101::ccFactoryReset(); cc1101::CCinit(); + dumpEEPROM(); } break; case cmd_patable: @@ -266,14 +276,14 @@ namespace commands { MSG_PRINT(" :"); for (uint8_t i = 0; i < 16; i++) { const uint8_t val = EEPROM.read(reg + i); - sprintf(b, " %02X", val); + sprintf(b, "%02X", val); MSG_PRINT(b); } } else { MSG_PRINT(" = "); const uint8_t val = EEPROM.read(reg); - sprintf(b, " %02X", val); + sprintf(b, "%02X", val); MSG_PRINT(b); //printHex2(EEPROM.read(reg)); } @@ -295,7 +305,7 @@ namespace commands { memcpy(b, &IB_1[3], 2); uint8_t val = strtol(b, nullptr, 16); - EEPROM.write(reg, val); //Todo prüfen ob reg hier um 1 erhöht werden muss + EEPROM.write(reg, val); //Todo pr�fen ob reg hier um 1 erh�ht werden muss DBG_PRINT(reg); DBG_PRINT("="); @@ -338,7 +348,7 @@ namespace commands { } #endif } -#ifdef ESP8266 +#if defined(ESP32) || defined(ESP8266) EEPROM.commit(); #endif break; @@ -357,7 +367,7 @@ namespace commands { #endif break; default: - MSG_PRINTLN(TXT_UNSUPPORTED1); + MSG_PRINTLN(FPSTR(TXT_UNSUPPORTED1)); return; } blinkLED = true; @@ -367,4 +377,4 @@ namespace commands { } -#endif \ No newline at end of file +#endif diff --git a/src/compile_config.h b/src/compile_config.h new file mode 100644 index 00000000..7228b08f --- /dev/null +++ b/src/compile_config.h @@ -0,0 +1,111 @@ +#pragma once + + +// Config flags for compiling correct options / boards Define only one! +// nothing to define // boards without CC1101 (example, ESP8266, ESP32, nano) +//#define CMP_CC1101 +//#define ARDUINO_ATMEGA328P_MINICUL 1 // minicul with CC1101 +//#define ARDUINO_AVR_ICT_BOARDS_ICT_BOARDS_AVR_RADINOCC1101 1; // radino with CC1101 +//#define OTHER_BOARD_WITH_CC1101 1 // boards with CC1101 (example, ESP8266, ESP32, Maple Mini ...) + +//Enable debug option here: +//#define DEBUG + + +/* + + Do not Change anything below this line + +*/ + +#define PROGVERS "3.4.0" + +#ifdef OTHER_BOARD_WITH_CC1101 + #define CMP_CC1101 +#endif +#ifdef ARDUINO_ATMEGA328P_MINICUL + #define CMP_CC1101 +#endif + +// Get compatibility with Arduino IDE and VisualMicro +#ifdef ARDUINO_AVR_ICT_BOARDS_ICT_BOARDS_AVR_RADINOCC1101 + #define ARDUINO_RADINOCC1101 +#endif + +#ifdef ARDUINO_RADINOCC1101 + #define CMP_CC1101 +#endif + + +#ifdef ARDUINO_MAPLEMINI_F103CB // STM32F103CBT6 + //#define WATCHDOG_STM32 1 // enabled ARDUINO_MAPLEMINI_F103CB Watchdog option +#endif + + +#ifdef ESP8266 + +#endif + +#ifdef ESP32 + +#endif + +#ifdef CMP_CC1101 + #ifdef ARDUINO_RADINOCC1101 + #define PIN_LED 13 + #define PIN_SEND 9 // gdo0Pin TX out + #define PIN_RECEIVE 7 + #define digitalPinToInterrupt(p) ((p) == 0 ? 2 : ((p) == 1 ? 3 : ((p) == 2 ? 1 : ((p) == 3 ? 0 : ((p) == 7 ? 4 : NOT_AN_INTERRUPT))))) + #define PIN_MARK433 4 + #define SS 8 + #elif ARDUINO_ATMEGA328P_MINICUL // 8Mhz + #define PIN_LED 4 + #define PIN_SEND 2 // gdo0Pin TX out + #define PIN_RECEIVE 3 + #define PIN_MARK433 A0 + #elif ARDUINO_MAPLEMINI_F103CB + const uint8_t pinReceive[] = {11, 18, 16, 14}; // compatible to variant -> Circuit board for four connected cc110x devices + + #define PIN_LED 33 + #define PIN_SEND 17 // gdo0 Pin TX out + #define PIN_RECEIVE pinReceive[1] // gdo2 + #define PIN_WIZ_RST 27 // for LAN + #elif defined(ESP8266) + #define PIN_RECEIVE 5 // D1 + #define PIN_LED 16 + #define PIN_SEND 4 // D2 // gdo0Pin TX out + #define ETHERNET_PRINT +// #define PIN_LED_INVERSE // use this setting for the LED_BUILTIN on WEMOS boards + #elif defined(ESP32) + #define PIN_RECEIVE 16 // D16 | G16 (depending on type / clone / seller) + #define PIN_LED 2 // D2 | G2 (depending on type / clone / seller) + #define PIN_SEND 4 // D4 | G4 (depending on type / clone / seller) // gdo0Pin TX out + #define ETHERNET_PRINT + #else + #define PIN_LED 9 + #define PIN_SEND 3 // gdo0Pin TX out + #define PIN_RECEIVE 2 + #endif +#else + #ifdef ESP8266 + #define PIN_RECEIVE 5 // D1 + #define PIN_LED 16 + #define PIN_SEND 4 // D2 // gdo0Pin TX out + #define ETHERNET_PRINT +// #define PIN_LED_INVERSE // use this setting for the LED_BUILTIN on WEMOS boards + #elif defined(ESP32) + #define PIN_RECEIVE 16 // D16 | G16 (depending on type / clone / seller) + #define PIN_LED 2 // D2 | G2 (depending on type / clone / seller) + #define PIN_SEND 4 // D4 | G4 (depending on type / clone / seller) // gdo0Pin TX out + #define ETHERNET_PRINT + #elif ARDUINO_MAPLEMINI_F103CB + #define PIN_LED 33 + #define PIN_SEND 17 // gdo0 Pin TX out + #define PIN_RECEIVE 18 // gdo2 + #define PIN_WIZ_RST 27 // for LAN + #else + #define PIN_RECEIVE 2 + #define PIN_LED 13 // Message-LED + #define PIN_SEND 11 + #endif +#endif diff --git a/functions.h b/src/functions.h similarity index 87% rename from functions.h rename to src/functions.h index 745ec152..eff8d744 100644 --- a/functions.h +++ b/src/functions.h @@ -23,18 +23,25 @@ extern bool hasCC1101; #define pulseMin 90 -#ifndef ESP8266 -#define ICACHE_RAM_ATTR +#if !defined(ESP8266) && !defined(ESP32) + #define ICACHE_RAM_ATTR #else -extern os_timer_t cronTimer; - + #ifdef ESP8266 + extern os_timer_t cronTimer; + #endif + #ifdef ESP32 + extern esp_timer_handle_t cronTimer; + #endif #endif //========================= Pulseauswertung ================================================ void ICACHE_RAM_ATTR handleInterrupt() { - - cli(); +#ifdef ARDUINO_MAPLEMINI_F103CB + noInterrupts(); +#else + cli(); +#endif const unsigned long Time = micros(); const unsigned long duration = Time - lastTime; lastTime = Time; @@ -51,7 +58,11 @@ void ICACHE_RAM_ATTR handleInterrupt() { } FiFo.enqueue(sDuration); } // else => trash - sei(); +#ifdef ARDUINO_MAPLEMINI_F103CB + interrupts(); +#else + sei(); +#endif } @@ -82,7 +93,7 @@ void storeFunctions(const int8_t ms, int8_t mu, int8_t mc, int8_t red) int8_t dat = ms | mu | mc | red; EEPROM.write(addr_features, dat); - #ifdef ESP8266 + #if defined(ESP8266) || defined(ESP32) EEPROM.commit(); #endif } @@ -116,24 +127,24 @@ void dumpEEPROM() { void initEEPROM(void) { - #ifdef ESP8266 + #if defined(ESP8266) || defined(ESP32) EEPROM.begin(512); //Max bytes of eeprom to use #endif if (EEPROM.read(EE_MAGIC_OFFSET) == VERSION_1 && EEPROM.read(EE_MAGIC_OFFSET + 1) == VERSION_2) { DBG_PRINT(F("Reading values from ")); DBG_PRINT(FPSTR(TXT_EEPROM)); DBG_PRINT(FPSTR(TXT_DOT)); DBG_PRINT(FPSTR(TXT_DOT)); - } - else { + } else { storeFunctions(1, 1, 1, 1); // Init EEPROM with all flags enabled //hier fehlt evtl ein getFunctions() MSG_PRINTLN(F("Init eeprom to defaults after flash")); EEPROM.write(EE_MAGIC_OFFSET, VERSION_1); EEPROM.write(EE_MAGIC_OFFSET + 1, VERSION_2); -#ifdef CMP_CC1101 - cc1101::ccFactoryReset(); -#endif -#ifdef ESP8266 - EEPROM.commit(); -#endif + #ifdef CMP_CC1101 + cc1101::ccFactoryReset(); + #endif + + #if defined(ESP8266) || defined(ESP32) + EEPROM.commit(); + #endif } getFunctions(&musterDec.MSenabled, &musterDec.MUenabled, &musterDec.MCenabled, &musterDec.MredEnabled); DBG_PRINTLN(F("done")); @@ -159,4 +170,4 @@ inline unsigned long getUptime() -#endif \ No newline at end of file +#endif diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 00000000..61f734b2 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1 @@ +#include "main.h" \ No newline at end of file diff --git a/src/main.h b/src/main.h new file mode 100644 index 00000000..8fa00a1a --- /dev/null +++ b/src/main.h @@ -0,0 +1,5 @@ +#pragma once +#include +#include "signalduino.h" +#include "signalesp.h" +#include "signalSTM.h" diff --git a/send.h b/src/send.h similarity index 97% rename from send.h rename to src/send.h index 6a86e8a9..c11263f2 100644 --- a/send.h +++ b/src/send.h @@ -114,12 +114,13 @@ void send_cmd() s_sendcmd command[5]; uint8_t ccParamAnz = 0; // Anzahl der per F= uebergebenen cc1101 Register +#ifdef CMP_CC1101 uint8_t ccReg[6]; uint8_t val; +#endif uint8_t cmdNo = 255; - char buf[256] = {}; // Second Buffer 256 Bytes 0-255 char *msg_beginptr = IB_1; char *msg_endptr = buf; @@ -155,7 +156,7 @@ void send_cmd() } if (cmdNo == 0) { DBG_PRINTLN("rearrange beginptr"); - MSG_PRINT(IB_1); // echo command + MSG_WRITE(IB_1,3); // ccho command, only 3 chars string is not null terminated! msg_endptr = buf; // rearrange to beginning of buf msg_beginptr = nullptr; } @@ -203,7 +204,7 @@ void send_cmd() else if (msg_beginptr[0] == 'F' && msg_beginptr[1] == '=') { ccParamAnz = (msg_endptr - msg_beginptr - 1) / 2; - +#ifdef CMP_CC1101 if (ccParamAnz > 0 && ccParamAnz <= 5 && hasCC1101) { //uint8_t hex; DBG_PRINT("write new ccregs #"); DBG_PRINTLN(ccParamAnz); @@ -219,6 +220,7 @@ void send_cmd() } DBG_PRINTLN(""); } +#endif } if (msg_endptr == msg_beginptr) { @@ -253,9 +255,12 @@ void send_cmd() MSG_PRINTER.readBytesUntil('\n', buf, 255); MSG_PRINT(FPSTR(TXT_SENDCMD)); MSG_PRINTLN(FPSTR(TXT_TOLONG)); - //MSG_PRINTLN(F("send cmd to long")); return; } + if (msg_endptr[0] == '\n') { // End of command + break; + } + *(msg_endptr + 1) = '\0'; // Nullterminate the string } @@ -296,7 +301,9 @@ void send_cmd() { //val = ccReg[i]; //sprintf_P(b,PSTR("%02X"), val); +#ifdef CMP_CC1101 cc1101::writeReg(0x0d + i, ccReg[i]); // gemerkte Registerwerte zurueckschreiben +#endif //MSG_PRINT(b); } DBG_PRINTLN(""); diff --git a/src/signalSTM.h b/src/signalSTM.h new file mode 100644 index 00000000..05678c58 --- /dev/null +++ b/src/signalSTM.h @@ -0,0 +1,329 @@ +#pragma once + +#ifdef ARDUINO_ARCH_STM32 +/* + +* notes different boards: +* https://github.com/firmata/arduino/blob/master/Boards.h +* https://danieleff.github.io/STM32GENERIC/build_macros/ + +*/ + +#include "compile_config.h" + +/* + +* developer: +* 2020 S.Butzek, HomeAutoUser, elektron-bbs + +* Integration for compatibility with a similar project by Ralf9 + +* tested hardware: +* - Maple Mini STM32F103CBT6 + +*/ + +#define PROGNAME " SIGNALSTM32 " +#define VERSION_1 0x33 +#define VERSION_2 0x1d + +#define BAUDRATE 115200 +#define FIFO_LENGTH 170 + +#ifdef ARDUINO_MAPLEMINI_F103CB + #define defSelRadio 1 // variant -> Circuit board for four connected cc110x devices - standard value 1 = B + uint8_t radionr = defSelRadio; // variant -> Circuit board for four connected cc110x devices + uint8_t radio_bank[4]; // variant -> Circuit board for four connected cc110x devices +#endif + + +// EEProm Address +#define EE_MAGIC_OFFSET 0 +#define addr_features 0xff + + + +// Predeclation +void serialEvent(); +void cronjob(); +int freeRam(); +void configSET(); +uint8_t rssiCallback() { return 0; }; // Dummy return if no rssi value can be retrieved from receiver +size_t writeCallback(const uint8_t *buf, uint8_t len = 1); + +extern char _estack; +extern char _Min_Stack_Size; +static char *ramend = &_estack; +static char *minSP = (char*)(ramend - &_Min_Stack_Size); +extern "C" char *sbrk(int i); + +//Includes +#ifdef WATCHDOG_STM32 + #include + bool watchRes = false; +#endif +#include "FastDelegate.h" +#include "output.h" +#include "bitstore.h" +#include "signalDecoder.h" +#include +#include "commands.h" +#include "functions.h" +#include "send.h" +#include "SimpleFIFO.h" +SimpleFIFO FiFo; //store FIFO_LENGTH # ints +SignalDetectorClass musterDec; +#include +#include "cc1101.h" + +volatile bool blinkLED = false; +volatile unsigned long lastTime = micros(); +bool hasCC1101 = false; +char IB_1[14]; // Input Buffer one - capture commands + +HardwareTimer *Timer1 = new HardwareTimer(TIM1); + +void setup() { + pinAsOutput(PIN_WIZ_RST); + + Serial.begin(BAUDRATE); + while (!Serial) { + ; // wait for serial port to connect. Needed for native USB + } + + #ifdef WATCHDOG_STM32 + if (IWatchdog.isReset(true)) { + MSG_PRINTLN(F("Watchdog caused a reset")); + watchRes = true; + } else { + watchRes = false; + } + IWatchdog.begin(20000000); // Init the watchdog timer with 20 seconds timeout + if (IWatchdog.isEnabled()) { + MSG_PRINTLN(F("Watchdog enabled")); + } +#endif + + pinAsInput(PIN_RECEIVE); + pinAsOutput(PIN_LED); + // CC1101 + + #ifdef CMP_CC1101 + cc1101::setup(); + #endif + initEEPROM(); + #ifdef CMP_CC1101 + DBG_PRINT(FPSTR(TXT_CCINIT)); + // for variant Circuit board for 4 cc110x and compatible version with 1 cc110x + #if defined(DEBUG) + DBG_PRINT(FPSTR(("(misoPin="))); DBG_PRINT((misoPin)); + DBG_PRINT(FPSTR((" mosiPin="))); DBG_PRINT((mosiPin)); + DBG_PRINT(FPSTR((" sckPin="))); DBG_PRINT((sckPin)); + DBG_PRINT(FPSTR((" csPin="))); DBG_PRINT((csPin)); + DBG_PRINTLN(")"); + #endif + + cc1101::CCinit(); // CC1101 init + hasCC1101 = cc1101::checkCC1101(); // Check for cc1101 + + if (hasCC1101) + { + //DBG_PRINTLN("CC1101 found"); + DBG_PRINT(FPSTR(TXT_CC1101)); DBG_PRINTLN(FPSTR(TXT_FOUND)); + musterDec.setRSSICallback(&cc1101::getRSSI); // Provide the RSSI Callback + } else { + musterDec.setRSSICallback(&rssiCallback); // Provide the RSSI Callback + } + #endif + + pinAsOutput(PIN_SEND); + DBG_PRINTLN(F("Starting timerjob")); + delay(50); + + // https://github.com/stm32duino/wiki/wiki/HardwareTimer-library + Timer1->setMode(2, TIMER_OUTPUT_COMPARE); + Timer1->setOverflow(32001, MICROSEC_FORMAT); + Timer1->attachInterrupt(cronjob); + Timer1->resume(); + + /*MSG_PRINT("MS:"); MSG_PRINTLN(musterDec.MSenabled); + MSG_PRINT("MU:"); MSG_PRINTLN(musterDec.MUenabled); + MSG_PRINT("MC:"); MSG_PRINTLN(musterDec.MCenabled);*/ + //cmdstring.reserve(40); + + musterDec.setStreamCallback(&writeCallback); + + +#ifdef CMP_CC1101 + if (!hasCC1101 || cc1101::regCheck()) { +#endif + enableReceive(); + DBG_PRINT(FPSTR(TXT_RECENA)); +#ifdef CMP_CC1101 + } + else { + DBG_PRINT(FPSTR(TXT_CC1101)); + DBG_PRINT(FPSTR(TXT_DOFRESET)); + DBG_PRINTLN(FPSTR(TXT_COMMAND)); + } +#endif + MSG_PRINTER.setTimeout(400); +} + + +void cronjob() { + noInterrupts(); + static uint8_t cnt = 0; + const unsigned long duration = micros() - lastTime; + long timerTime = maxPulse - duration; + + if (timerTime < 1000) + timerTime=1000; + + // Timer1->pause(); // ToDo: Timer stopt, why ??? -> no blinkLED action + Timer1->setOverflow(timerTime, MICROSEC_FORMAT); + if (duration > maxPulse) { // Auf Maximalwert pruefen. + int sDuration = maxPulse; + if (isLow(PIN_RECEIVE)) { // Wenn jetzt low ist, ist auch weiterhin low + sDuration = -sDuration; + } + FiFo.enqueue(sDuration); + lastTime = micros(); + } + + #ifdef PIN_LED_INVERSE + digitalWrite(PIN_LED, !blinkLED); + #else + digitalWrite(PIN_LED, blinkLED); + #endif + blinkLED = false; + + interrupts(); + + // Infrequent time uncritical jobs (~ every 2 hours) + if (cnt++ == 0) // if cnt is 0 at start or during rollover + getUptime(); +} + + + /* + * not used now ! + * these are preparations if the project can be expanded to 4 cc110x + +uint16_t getBankOffset(uint8_t tmpBank) { + uint16_t bankOffs; + if (tmpBank == 0) { + bankOffs = 0; + } + else { + bankOffs = 0x100 + ((tmpBank - 1) * 0x40); + } + return bankOffs; +} + + */ + +void loop() { + + static int aktVal=0; + bool state; + + #ifdef WATCHDOG_STM32 + IWatchdog.reload(); + #endif + +/* + * not used now ! + * these are preparations if the project can be expanded to 4 cc110x + + uint8_t tmpBank; + uint16_t bankoff; + for (radionr = 0; radionr < 4; radionr++) { + if (radio_bank[radionr] > 9) { + continue; + } + tmpBank = radio_bank[radionr]; + bankoff = getBankOffset(tmpBank); + + //wdt_reset(); +*/ + while (FiFo.count()>0 ) { // Puffer auslesen und an Dekoder uebergeben + aktVal=FiFo.dequeue(); + state = musterDec.decode(&aktVal); + if (state) blinkLED=true; // LED blinken, wenn Meldung dekodiert + } + +/* + } +*/ + +} + + + + +//============================== Write callback ========================================= +size_t writeCallback(const uint8_t *buf, uint8_t len) +{ + while (!MSG_PRINTER.availableForWrite() ) + yield(); + //DBG_PRINTLN("Called writeCallback"); + + //MSG_PRINT(*buf); + //MSG_WRITE(buf, len); + return MSG_PRINTER.write(buf,len); + + //serverClient.write("test"); +} + + + + +//================================= Serielle verarbeitung ====================================== +void serialEvent() +{ + static uint8_t idx = 0; + while (MSG_PRINTER.available()) + { + if (idx == 14) { + // Short buffer is now full + MSG_PRINT("Command to long: "); + MSG_PRINTLN(IB_1); + idx = 0; + return; + } + else { + IB_1[idx] = (char)MSG_PRINTER.read(); + switch (IB_1[idx]) + { + case '\n': + case '\r': + case '\0': + case '#': + //wdt_reset(); + commands::HandleShortCommand(); // Short command received and can be processed now + idx = 0; + return; //Exit function + case ';': + DBG_PRINT("send cmd detected "); + DBG_PRINTLN(idx); + send_cmd(); + idx = 0; // increments to 1 + return; //Exit function + } + idx++; + } + } +} + + + +int freeRam () { + char *heapend = (char*)sbrk(0); + char * stack_ptr = (char*)__get_MSP(); + struct mallinfo mi = mallinfo(); + return (((stack_ptr < minSP) ? stack_ptr : minSP) - heapend + mi.fordblks); +} + + +#endif diff --git a/SIGNALDuino.ino b/src/signalduino.h similarity index 94% rename from SIGNALDuino.ino rename to src/signalduino.h index c274be74..ad11c833 100644 --- a/SIGNALDuino.ino +++ b/src/signalduino.h @@ -1,5 +1,5 @@ /* -* RF_RECEIVER v3.3.1 for Arduino +* RF_RECEIVER v3.4.0 for Arduino * Sketch to use an arduino as a receiver/sending device for digital signals * * The Sketch can also encode and send data via a transmitter, @@ -35,19 +35,18 @@ #include "compile_config.h" -#define PROGVERS "3.3.1" -#define VERSION_1 0x33 -#define VERSION_2 0x1d +#define VERSION_1 0x33 +#define VERSION_2 0x1d #if defined(__AVR__) #define PROGNAME " SIGNALduino " #define BAUDRATE 57600 // 500000 //57600 -#define FIFO_LENGTH 90 //150 +#define FIFO_LENGTH 90 // 150 // EEProm Address -#define EE_MAGIC_OFFSET 0 -#define addr_features 0xff +#define EE_MAGIC_OFFSET 0 +#define addr_features 0xff @@ -175,7 +174,11 @@ void cronjob() { } else if (duration > 10000) { Timer1.setPeriod(maxPulse-duration+16); } +#ifdef PIN_LED_INVERSE + digitalWrite(PIN_LED, !blinkLED); +#else digitalWrite(PIN_LED, blinkLED); +#endif blinkLED = false; sei(); @@ -207,7 +210,7 @@ void loop() { //============================== Write callback ========================================= -size_t writeCallback(const uint8_t *buf, uint8_t len = 1) +size_t writeCallback(const uint8_t *buf, uint8_t len) { while (!MSG_PRINTER.availableForWrite() ) yield(); @@ -271,16 +274,13 @@ void serialEvent() } + int freeRam () { extern int __heap_start, *__brkval; int v; return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); - } - - - #endif diff --git a/SIGNALESP.ino b/src/signalesp.h similarity index 84% rename from SIGNALESP.ino rename to src/signalesp.h index 7f83aafd..aca80db0 100644 --- a/SIGNALESP.ino +++ b/src/signalesp.h @@ -1,20 +1,21 @@ +#pragma once + #if defined (ESP32) || defined(ESP8266) #include "compile_config.h" #define PROGNAME " SIGNALESP " -#define PROGVERS "3.3.1-experimental" #define VERSION_1 0x33 #define VERSION_2 0x1d #define BAUDRATE 115200 -#define FIFO_LENGTH 200 +#define FIFO_LENGTH 200 #define ETHERNET_PRINT #define WIFI_MANAGER_OVERRIDE_STRINGS // EEProm Addresscommands -#define EE_MAGIC_OFFSET 0 -#define addr_features 0xff -#define MAX_SRV_CLIENTS 2 +#define EE_MAGIC_OFFSET 0 +#define addr_features 0xff +#define MAX_SRV_CLIENTS 2 #include "compile_config.h" @@ -27,7 +28,7 @@ inline void ethernetEvent(); //void getFunctions(bool *ms, bool *mu, bool *mc); //void initEEPROM(void); uint8_t rssiCallback() { return 0; }; // Dummy return if no rssi value can be retrieved from receiver -size_t writeCallback(const uint8_t *buf, uint8_t len); +size_t writeCallback(const uint8_t *buf, uint8_t len = 1); void ICACHE_RAM_ATTR sosBlink(void *pArg); #if defined(ESP8266) @@ -40,6 +41,8 @@ extern "C" { #if defined(ESP32) #include "esp_timer.h" #include "esp_task_wdt.h" +#include +#include #endif #include @@ -126,20 +129,52 @@ void ICACHE_RAM_ATTR sosBlink (void *pArg) { WiFiManager wifiManager; +#ifdef ESP8266 +WiFiEventHandler gotIpEventHandler, disconnectedEventHandler; +#endif void setup() { - char cfg_ipmode[7] = "dhcp"; + //char cfg_ipmode[7] = "dhcp"; + //Server.setNoDelay(true); +#if defined(ESP8266) + gotIpEventHandler = WiFi.onStationModeGotIP([](const WiFiEventStationModeGotIP& event) + { + //Server.stop(); + Server.begin(); // start telnet server + Server.setNoDelay(true); + }); + // added @Dattel #130 + disconnectedEventHandler = WiFi.onStationModeDisconnected([](const WiFiEventStationModeDisconnected & event) + { + Server.stop(); + Serial.print("WiFi lost connection. Reason: "); + Serial.println(event.reason); + }); + // added @Dattel #130 - END + +#elif defined(ESP32) + WiFi.onEvent([](WiFiEvent_t event, WiFiEventInfo_t info) { + Server.begin(); // start telnet server + Server.setNoDelay(true); + }, WiFiEvent_t::SYSTEM_EVENT_STA_CONNECTED); + + WiFi.onEvent([](WiFiEvent_t event, WiFiEventInfo_t info) { + Server.stop(); // end telnet server + Serial.print("WiFi lost connection. Reason: "); + Serial.println(info.sta_er_fail_reason); + }, WiFiEvent_t::SYSTEM_EVENT_STA_DISCONNECTED); +#endif - //ESP.wdtEnable(2000); + //ESP.wdtEnable(2000); #ifdef ESP32 blinksos_args.callback = sosBlink; blinksos_args.dispatch_method = ESP_TIMER_TASK; blinksos_args.name = "blinkSOS"; blinksos_args.arg = (void *)boot_sequence; esp_timer_create(&blinksos_args, &blinksos_handle); - esp_timer_start_periodic(blinksos_handle, 300); + esp_timer_start_periodic(blinksos_handle, 300000); #elif defined(ESP8266) os_timer_setfn(&blinksos, &sosBlink, (void *)boot_sequence); os_timer_arm(&blinksos, 300, true); @@ -181,6 +216,7 @@ void setup() { #endif wifiManager.setShowStaticFields(true); + // wifiManager.setCountry("US"); /* 1. starts a config portal in access point mode (timeout 60 seconds) @@ -191,9 +227,9 @@ void setup() { ip configuration can be switched between static and dhcp mode */ IPAddress _ip, _gw, _sn; - +/* DBG_PRINTLN("mounting FS..."); - /* + if (SPIFFS.begin()) { DBG_PRINTLN("mounted file system"); if (SPIFFS.exists("/config.json")) { @@ -358,10 +394,7 @@ void setup() { } */ - Server.setNoDelay(true); - Server.begin(); // telnet server #ifdef ESP32 - esp_timer_stop(cronTimer_handle); cronTimer_args.callback = cronjob; cronTimer_args.name = "cronTimer"; cronTimer_args.dispatch_method = ESP_TIMER_TASK; @@ -371,7 +404,6 @@ void setup() { os_timer_setfn(&cronTimer, &cronjob, 0); #endif - musterDec.setStreamCallback(writeCallback); #ifdef CMP_CC1101 if (!hasCC1101 || cc1101::regCheck()) { @@ -393,7 +425,7 @@ void setup() { // wifiManager.startConfigPortal(); wifiManager.startWebPortal(); #ifdef ESP32 - esp_timer_start_periodic(cronTimer_handle, 31); + esp_timer_start_periodic(cronTimer_handle, 31000); esp_timer_stop(blinksos_handle); #elif defined(ESP8266) os_timer_arm(&cronTimer, 31, true); @@ -409,13 +441,16 @@ void ICACHE_RAM_ATTR cronjob(void *pArg) { static uint8_t cnt = 0; const unsigned long duration = micros() - lastTime; + long timerTime = maxPulse - duration + 1000; + if (timerTime < 1000) + timerTime=1000; + #ifdef ESP32 esp_timer_stop(cronTimer_handle); - esp_timer_start_periodic(cronTimer_handle, (maxPulse - duration + 1000) / 1000); - + esp_timer_start_periodic(cronTimer_handle, timerTime); #elif defined(ESP8266) os_timer_disarm(&cronTimer); - os_timer_arm(&cronTimer, (maxPulse - duration + 1000) / 1000, true); + os_timer_arm(&cronTimer, timerTime / 1000, true); #endif @@ -431,7 +466,11 @@ void ICACHE_RAM_ATTR cronjob(void *pArg) { //os_timer_disarm(&cronTimer); //os_timer_arm(&cronTimer, 20, true); } +#ifdef PIN_LED_INVERSE + digitalWrite(PIN_LED, !blinkLED); +#else digitalWrite(PIN_LED, blinkLED); +#endif blinkLED = false; sei(); @@ -443,6 +482,7 @@ void ICACHE_RAM_ATTR cronjob(void *pArg) { void loop() { + wifiManager.process(); static int aktVal = 0; @@ -467,8 +507,8 @@ void loop() { const size_t writeBufferSize = 128; size_t writeBufferCurrent = 0; uint8_t writeBuffer[writeBufferSize]; -#endif; -size_t writeCallback(const uint8_t *buf, uint8_t len = 1) +#endif +size_t writeCallback(const uint8_t *buf, uint8_t len) { #ifdef _USE_WRITE_BUFFER if (!serverClient || !serverClient.connected()) @@ -528,24 +568,33 @@ inline void ethernetEvent() { //check if there are any new clients if (Server.hasClient()) { + if (!serverClient || !serverClient.connected()) { if (serverClient) serverClient.stop(); serverClient = Server.available(); - DBG_PRINTLN("New client: "); - DBG_PRINTLN(serverClient.remoteIP()); - return; + serverClient.flush(); + //DBG_PRINTLN("New client: "); + //DBG_PRINTLN(serverClient.remoteIP()); + } else { + WiFiClient rejectClient = Server.available(); + rejectClient.stop(); + //DBG_PRINTLN("Reject new Client: "); + //DBG_PRINTLN(rejectClient.remoteIP()); } - //no free/disconnected spot so reject -// WiFiClient newClient = Server.available(); -// newClient.stop(); } - //yield(); + + if(serverClient && !serverClient.connected()) + { + //DBG_PRINTLN("Client disconnected: "); + //DBG_PRINTLN(serverClient.remoteIP()); + serverClient.stop(); + } } void serialEvent() { static uint8_t idx = 0; - while (MSG_PRINTER.available()) + while (MSG_PRINTER.connected() > 0 && MSG_PRINTER.available()) { if (idx == 14) { // Short buffer is now full @@ -556,26 +605,33 @@ void serialEvent() } else { IB_1[idx] = (char)MSG_PRINTER.read(); + // DBG_PRINTLN(idx); + // DBG_PRINT(IB_1[idx]); + switch (IB_1[idx]) { case '\n': case '\r': case '\0': case '#': -#ifdef ESP32 +#if defined(ESP32) esp_task_wdt_reset(); yield(); #elif defined(ESP8266) wdt_reset(); #endif - commands::HandleShortCommand(); // Short command received and can be processed now + if (idx > 0) { + // DBG_PRINT("HSC"); + commands::HandleShortCommand(); // Short command received and can be processed now + } idx = 0; return; //Exit function case ';': DBG_PRINT("send cmd detected "); - DBG_PRINTLN(idx); + // DBG_PRINTLN(idx); IB_1[idx + 1] = '\0'; - send_cmd(); + if (idx > 0) + send_cmd(); idx = 0; // increments to 1 return; //Exit function } @@ -594,16 +650,4 @@ int freeRam() { #endif } - - - - - - - - - - - - -#endif \ No newline at end of file +#endif diff --git a/wifi-config.h b/src/wifi-config.h similarity index 97% rename from wifi-config.h rename to src/wifi-config.h index a9f8c592..6e78719d 100644 --- a/wifi-config.h +++ b/src/wifi-config.h @@ -1,3 +1,5 @@ +#pragma once + #if defined (ESP32) || defined(ESP8266) #ifdef ESP8266 @@ -50,4 +52,4 @@ void resetwifi() { } -#endif \ No newline at end of file +#endif diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index aa128008..3598fff8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -32,9 +32,9 @@ endif() # Find all library source and unit test files file( GLOB_RECURSE ARDUINO_LIBRARY_SOURCE_FILES ${PROJECT_SOURCE_DIR}/../src/_micro-api/libraries/output/src/*.h ${PROJECT_SOURCE_DIR}/../src/_micro-api/libraries/output/src/*.cpp ${PROJECT_SOURCE_DIR}/../src/_micro-api/libraries/bitstore/*.cpp ${PROJECT_SOURCE_DIR}/../src/_micro-api/libraries/fastdelegate/src/*.cpp ${PROJECT_SOURCE_DIR}/../src/_micro-api/libraries/signalDecoder/src/*.cpp ${PROJECT_SOURCE_DIR}/../src/_micro-api/libraries/bitstore/src/*.h ${PROJECT_SOURCE_DIR}/../src/_micro-api/libraries/fastdelegate/src/*.h ${PROJECT_SOURCE_DIR}/../src/_micro-api/libraries/signalDecoder/src/*.h - ${PROJECT_SOURCE_DIR}/../commands.h - ${PROJECT_SOURCE_DIR}/../functions.h - ${PROJECT_SOURCE_DIR}/../send.h) + ${PROJECT_SOURCE_DIR}/../src/commands.h + ${PROJECT_SOURCE_DIR}/../src/functions.h + ${PROJECT_SOURCE_DIR}/../src/send.h) file( GLOB ARDUINO_LIBRARY_TEST_FILES ${PROJECT_SOURCE_DIR}/testSignalDecoder/tests.cpp ${PROJECT_SOURCE_DIR}/testSignalDecoder/tests.h ${PROJECT_SOURCE_DIR}/testSignalDecoder/targetver.h ) # Create unit test executable