From ca8ed709b87bf4b35a20bf9ad5201fb4c803d576 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Wed, 14 May 2014 19:37:04 +0200 Subject: [PATCH] initial --- .cproject | 67 +++++ .project | 69 ++++++ .settings/language.settings.xml | 13 + .settings/org.eclipse.cdt.core.prefs | 357 +++++++++++++++++++++++++++ NetMeterBusMaster2.cpp | 64 +++++ NetMeterBusMaster2.h | 29 +++ cmd.cpp | 102 ++++++++ cmd.h | 47 ++++ fatal.cpp | 10 + fatal.h | 15 ++ mBusDialog.h | 20 ++ meterBusMaster.cpp | 279 +++++++++++++++++++++ meterBusMaster.h | 90 +++++++ meterBusServer.cpp | 41 +++ meterBusServer.h | 31 +++ overCurrentProt.cpp | 68 +++++ overCurrentProt.h | 56 +++++ spec.d | 2 + test.cpp | 7 + test.h | 14 ++ uptime.cpp | 48 ++++ uptime.h | 39 +++ 22 files changed, 1468 insertions(+) create mode 100644 .cproject create mode 100644 .project create mode 100644 .settings/language.settings.xml create mode 100644 .settings/org.eclipse.cdt.core.prefs create mode 100644 NetMeterBusMaster2.cpp create mode 100644 NetMeterBusMaster2.h create mode 100644 cmd.cpp create mode 100644 cmd.h create mode 100644 fatal.cpp create mode 100644 fatal.h create mode 100644 mBusDialog.h create mode 100644 meterBusMaster.cpp create mode 100644 meterBusMaster.h create mode 100644 meterBusServer.cpp create mode 100644 meterBusServer.h create mode 100644 overCurrentProt.cpp create mode 100644 overCurrentProt.h create mode 100644 spec.d create mode 100644 test.cpp create mode 100644 test.h create mode 100644 uptime.cpp create mode 100644 uptime.h diff --git a/.cproject b/.cproject new file mode 100644 index 0000000..7f06a4f --- /dev/null +++ b/.cproject @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..7010f88 --- /dev/null +++ b/.project @@ -0,0 +1,69 @@ + + + NetMeterBusMaster2 + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + it.baeyens.arduinonature + + + + Libraries/EEPROM + 2 + ArduinoHardwareLibPath/EEPROM + + + Libraries/Ethernet + 2 + ArduinoHardwareLibPath/Ethernet + + + Libraries/SPI + 2 + ArduinoHardwareLibPath/SPI + + + Libraries/Streaming + 2 + ArduinoPivateLibPath/Streaming + + + arduino/core + 2 + ArduinoPlatformPath/cores/teensy3 + + + + + ArduinoHardwareLibPath + file:/Applications/Arduino.app/Contents/Resources/Java/hardware/teensy/all/libraries + + + ArduinoPinPath + file:/Applications/Arduino.app/Contents/Resources/Java/hardware/teensy/all/variants + + + ArduinoPlatformPath + file:/Applications/Arduino.app/Contents/Resources/Java/hardware/teensy/all + + + diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml new file mode 100644 index 0000000..df77a5a --- /dev/null +++ b/.settings/language.settings.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/.settings/org.eclipse.cdt.core.prefs b/.settings/org.eclipse.cdt.core.prefs new file mode 100644 index 0000000..8bacddb --- /dev/null +++ b/.settings/org.eclipse.cdt.core.prefs @@ -0,0 +1,357 @@ +eclipse.preferences.version=1 +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.ARCHITECTURE/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.ARCHITECTURE/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.ARCHITECTURE/value=all +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.ARCHIVE_FILE/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.ARCHIVE_FILE/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.ARCHIVE_FILE/value=teensy.ar +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BOOTLOADER.PATH/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BOOTLOADER.PATH/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BOOTLOADER.PATH/value=undefined +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.ARCH/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.ARCH/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.ARCH/value=ALL +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.ARCHITECTURE/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.ARCHITECTURE/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.ARCHITECTURE/value=arm-none-eabi +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.COMMAND.AR/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.COMMAND.AR/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.COMMAND.AR/value=arm-none-eabi-ar +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.COMMAND.G++/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.COMMAND.G++/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.COMMAND.G++/value=arm-none-eabi-g++ +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.COMMAND.GCC/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.COMMAND.GCC/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.COMMAND.GCC/value=arm-none-eabi-gcc +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.COMMAND.OBJCOPY/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.COMMAND.OBJCOPY/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.COMMAND.OBJCOPY/value=arm-none-eabi-objcopy +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.COMMAND.OBJDUMP/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.COMMAND.OBJDUMP/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.COMMAND.OBJDUMP/value=arm-none-eabi-objdump +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.COMMAND.SIZE/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.COMMAND.SIZE/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.COMMAND.SIZE/value=arm-none-eabi-size +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.CORE/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.CORE/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.CORE/value=teensy3 +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.CPPOPTION1/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.CPPOPTION1/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.CPPOPTION1/value=-fno-rtti +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.CPU/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.CPU/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.CPU/value=cortex-m4 +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.DEFINE0/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.DEFINE0/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.DEFINE0/value=-DUSB_SERIAL +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.DEFINE1/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.DEFINE1/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.DEFINE1/value=-DLAYOUT_US_ENGLISH +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.DEPENDENCY/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.DEPENDENCY/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.DEPENDENCY/value=true +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.ELIDE_CONSTRUCTORS/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.ELIDE_CONSTRUCTORS/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.ELIDE_CONSTRUCTORS/value=true +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.EXTRA_FLAGS/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.EXTRA_FLAGS/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.EXTRA_FLAGS/value= +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.F_CPU/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.F_CPU/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.F_CPU/value=24000000 +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.GNU0X/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.GNU0X/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.GNU0X/value=true +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.LDSCRIPT/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.LDSCRIPT/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.LDSCRIPT/value=teensy/all/cores/teensy3/mk20dx256.ld +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.LINKOPTION1/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.LINKOPTION1/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.LINKOPTION1/value=-mthumb +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.LINKSCRIPT/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.LINKSCRIPT/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.LINKSCRIPT/value=mk20dx256.ld +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.MCU/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.MCU/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.MCU/value=cortex-m4 +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.NOARCHIVE/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.NOARCHIVE/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.NOARCHIVE/value=true +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.OPTION1/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.OPTION1/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.OPTION1/value=-mthumb +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.OPTION2/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.OPTION2/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.OPTION2/value=-nostdlib +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.OPTION3/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.OPTION3/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.OPTION3/value=-D__MK20DX256__ +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.PATH/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.PATH/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.PATH/value=${ProjDirPath}/${ConfigName} +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.POST_COMPILE_SCRIPT/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.POST_COMPILE_SCRIPT/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.POST_COMPILE_SCRIPT/value=teensy_post_compile +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.PROJECT_NAME/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.PROJECT_NAME/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.PROJECT_NAME/value=${ProjName} +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.TIME_T/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.TIME_T/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.TIME_T/value=true +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.USE_ARCHIVER/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.USE_ARCHIVER/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.USE_ARCHIVER/value=false +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.VARIANT.PATH/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.VARIANT.PATH/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.BUILD.VARIANT.PATH/value=/Applications/Arduino.app/Contents/Resources/Java/hardware/teensy/all/variants/${A.BUILD.VARIANT} +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.CMD.PATH/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.CMD.PATH/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.CMD.PATH/value=${A.TOOLS.AVRDUDE.CMD.PATH} +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.CMD/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.CMD/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.CMD/value=${A.TOOLS.BOSSAC.CMD} +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.AR.CMD/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.AR.CMD/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.AR.CMD/value=avr-ar +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.AR.FLAGS/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.AR.FLAGS/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.AR.FLAGS/value=rcs +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.C.CMD/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.C.CMD/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.C.CMD/value=avr-gcc +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.C.ELF.CMD/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.C.ELF.CMD/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.C.ELF.CMD/value=avr-gcc +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.C.ELF.FLAGS/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.C.ELF.FLAGS/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.C.ELF.FLAGS/value=-Os -Wl,--gc-sections +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.C.FLAGS/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.C.FLAGS/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.C.FLAGS/value=-c -g -Os -w -ffunction-sections -fdata-sections -MMD +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.CPP.CMD/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.CPP.CMD/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.CPP.CMD/value=avr-g++ +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.CPP.FLAGS/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.CPP.FLAGS/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.CPP.FLAGS/value=-c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.ELF2HEX.CMD/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.ELF2HEX.CMD/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.ELF2HEX.CMD/value=avr-objcopy +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.ELF2HEX.FLAGS/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.ELF2HEX.FLAGS/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.ELF2HEX.FLAGS/value=-O ihex -R .eeprom +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.LDFLAGS/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.LDFLAGS/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.LDFLAGS/value= +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.OBJCOPY.CMD/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.OBJCOPY.CMD/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.OBJCOPY.CMD/value=avr-objcopy +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.OBJCOPY.EEP.FLAGS/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.OBJCOPY.EEP.FLAGS/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.OBJCOPY.EEP.FLAGS/value=-O ihex -j .eeprom --set-section-flags\=.eeprom\=alloc,load --no-change-warnings --change-section-lma .eeprom\=0 +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.PATH/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.PATH/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.PATH/value=${A.RUNTIME.IDE.PATH}/hardware/tools/avr/bin/ +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.S.FLAGS/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.S.FLAGS/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.S.FLAGS/value=-c -g -assembler-with-cpp +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.SAM.PATH.LINUX/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.SAM.PATH.LINUX/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.SAM.PATH.LINUX/value=${A.RUNTIME.HARDWARE.PATH}/teensy/tools/linux/arm-none-eabi/bin/ +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.SAM.PATH.WINDOWS/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.SAM.PATH.WINDOWS/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.SAM.PATH.WINDOWS/value=${A.RUNTIME.HARDWARE.PATH}/teensy/tools/windows/arm-none-eabi/bin/ +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.SAM.PATH/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.SAM.PATH/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.SAM.PATH/value=${A.RUNTIME.HARDWARE.PATH}/teensy/tools/mac/arm-none-eabi/bin/ +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.SIZE.CMD/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.SIZE.CMD/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.COMPILER.SIZE.CMD/value=avr-size +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.CONFIG.PATH/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.CONFIG.PATH/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.CONFIG.PATH/value=${A.TOOLS.AVRDUDE.CONFIG.PATH} +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.NAME/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.NAME/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.NAME/value=Teensy 3.1 +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.PATH/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.PATH/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.PATH/value=${A.TOOLS.BOSSAC.PATH} +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.AR.PATTERN.1/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.AR.PATTERN.1/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.AR.PATTERN.1/value="${A.COMPILER.SAM.PATH}arm-none-eabi-ar" -r "${A.BUILD.PATH}/${A.ARCHIVE_FILE}" ${A.OBJECT_FILE} +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.AR.PATTERN/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.AR.PATTERN/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.AR.PATTERN/value="${A.COMPILER.SAM.PATH}arm-none-eabi-ar" -r "${A.BUILD.PATH}/${A.ARCHIVE_FILE}" ${A.OBJECT_FILE} +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.C.COMBINE.PATTERN.1/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.C.COMBINE.PATTERN.1/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.C.COMBINE.PATTERN.1/value="${A.COMPILER.SAM.PATH}arm-none-eabi-gcc" -Os -Wl,--gc-sections -mcpu\=${A.BUILD.MCU} -mthumb "-T${A.RUNTIME.HARDWARE.PATH}/${A.BUILD.LDSCRIPT}" -o "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf" +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.C.COMBINE.PATTERN.2/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.C.COMBINE.PATTERN.2/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.C.COMBINE.PATTERN.2/value=\ -L"${A.BUILD.PATH}" -lm +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.C.COMBINE.PATTERN/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.C.COMBINE.PATTERN/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.C.COMBINE.PATTERN/value="${A.COMPILER.SAM.PATH}arm-none-eabi-gcc" -Os -Wl,--gc-sections -mcpu\=${A.BUILD.MCU} -mthumb "-T${A.RUNTIME.HARDWARE.PATH}/${A.BUILD.LDSCRIPT}" -o "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf" ${A.OBJECT_FILES} -L"${A.BUILD.PATH}" -lm +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.C.O.PATTERN.1/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.C.O.PATTERN.1/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.C.O.PATTERN.1/value="${A.COMPILER.SAM.PATH}arm-none-eabi-gcc" -c -g -Os -w -ffunction-sections -fdata-sections -nostdlib -mcpu\=${A.BUILD.MCU} -DF_CPU\=${A.BUILD.F_CPU} -DTIME_T\=1365449461 ${A.BUILD.DEFINE0} ${A.BUILD.DEFINE1} -MMD -D${A.SOFTWARE}\=${A.RUNTIME.IDE.VERSION} ${A.BUILD.EXTRA_FLAGS} -mthumb -D__MK20DX256__ ${A.INCLUDES} +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.C.O.PATTERN.2/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.C.O.PATTERN.2/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.C.O.PATTERN.2/value=\ -o +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.C.O.PATTERN.3/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.C.O.PATTERN.3/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.C.O.PATTERN.3/value= +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.C.O.PATTERN/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.C.O.PATTERN/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.C.O.PATTERN/value="${A.COMPILER.SAM.PATH}arm-none-eabi-gcc" -c -g -Os -w -ffunction-sections -fdata-sections -nostdlib -mcpu\=${A.BUILD.MCU} -DF_CPU\=${A.BUILD.F_CPU} -DTIME_T\=1365449461 ${A.BUILD.DEFINE0} ${A.BUILD.DEFINE1} -MMD -D${A.SOFTWARE}\=${A.RUNTIME.IDE.VERSION} ${A.BUILD.EXTRA_FLAGS} -mthumb -D__MK20DX256__ ${A.INCLUDES} "${A.SOURCE_FILE}" -o "${A.OBJECT_FILE}" +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.CPP.O.PATTERN.1/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.CPP.O.PATTERN.1/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.CPP.O.PATTERN.1/value="${A.COMPILER.SAM.PATH}arm-none-eabi-g++" -c -g -Os -w -ffunction-sections -fdata-sections -nostdlib -fno-rtti -fno-exceptions -mcpu\=${A.BUILD.MCU} -DF_CPU\=${A.BUILD.F_CPU} ${A.BUILD.DEFINE0} ${A.BUILD.DEFINE1} -MMD -D${A.SOFTWARE}\=${A.RUNTIME.IDE.VERSION} ${A.BUILD.EXTRA_FLAGS} -mthumb -D__MK20DX256__ -felide-constructors -std\=gnu++0x ${A.INCLUDES} +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.CPP.O.PATTERN.2/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.CPP.O.PATTERN.2/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.CPP.O.PATTERN.2/value=\ -o +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.CPP.O.PATTERN.3/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.CPP.O.PATTERN.3/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.CPP.O.PATTERN.3/value= +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.CPP.O.PATTERN/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.CPP.O.PATTERN/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.CPP.O.PATTERN/value="${A.COMPILER.SAM.PATH}arm-none-eabi-g++" -c -g -Os -w -ffunction-sections -fdata-sections -nostdlib -fno-rtti -fno-exceptions -mcpu\=${A.BUILD.MCU} -DF_CPU\=${A.BUILD.F_CPU} ${A.BUILD.DEFINE0} ${A.BUILD.DEFINE1} -MMD -D${A.SOFTWARE}\=${A.RUNTIME.IDE.VERSION} ${A.BUILD.EXTRA_FLAGS} -mthumb -D__MK20DX256__ -felide-constructors -std\=gnu++0x ${A.INCLUDES} "${A.SOURCE_FILE}" -o "${A.OBJECT_FILE}" +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.OBJCOPY.EEP.PATTERN.1/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.OBJCOPY.EEP.PATTERN.1/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.OBJCOPY.EEP.PATTERN.1/value="${A.COMPILER.SAM.PATH}arm-none-eabi-objcopy" -O ihex -j .eeprom --set-section-flags\=.eeprom\=alloc,load --no-change-warnings --change-section-lma .eeprom\=0 "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf" "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.eep" +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.OBJCOPY.EEP.PATTERN/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.OBJCOPY.EEP.PATTERN/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.OBJCOPY.EEP.PATTERN/value="${A.COMPILER.SAM.PATH}arm-none-eabi-objcopy" -O ihex -j .eeprom --set-section-flags\=.eeprom\=alloc,load --no-change-warnings --change-section-lma .eeprom\=0 "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf" "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.eep" +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.OBJCOPY.HEX.PATTERN.1/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.OBJCOPY.HEX.PATTERN.1/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.OBJCOPY.HEX.PATTERN.1/value="${A.COMPILER.SAM.PATH}arm-none-eabi-objcopy" -O ihex -R .eeprom "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf" "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.hex" +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.OBJCOPY.HEX.PATTERN/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.OBJCOPY.HEX.PATTERN/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.OBJCOPY.HEX.PATTERN/value="${A.COMPILER.SAM.PATH}arm-none-eabi-objcopy" -O ihex -R .eeprom "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf" "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.hex" +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.SIZE.PATTERN.1/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.SIZE.PATTERN.1/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.SIZE.PATTERN.1/value="${A.COMPILER.SAM.PATH}arm-none-eabi-size" -A "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf" +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.SIZE.PATTERN/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.SIZE.PATTERN/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.SIZE.PATTERN/value="${A.COMPILER.SAM.PATH}arm-none-eabi-size" -A "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf" +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.SIZE.REGEX/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.SIZE.REGEX/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RECIPE.SIZE.REGEX/value=Total\\s+([0-9]+).* +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RUNTIME.HARDWARE.PATH/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RUNTIME.HARDWARE.PATH/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RUNTIME.HARDWARE.PATH/value=/Applications/Arduino.app/Contents/Resources/Java/hardware +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RUNTIME.IDE.PATH/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RUNTIME.IDE.PATH/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RUNTIME.IDE.PATH/value=/Applications/Arduino.app/Contents/Resources/Java +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RUNTIME.IDE.VERSION/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RUNTIME.IDE.VERSION/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.RUNTIME.IDE.VERSION/value=152 +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.SERIAL.RESTART_CMD/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.SERIAL.RESTART_CMD/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.SERIAL.RESTART_CMD/value=true +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.SERIAL.SAFE_BAUD_RATES_ONLY/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.SERIAL.SAFE_BAUD_RATES_ONLY/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.SERIAL.SAFE_BAUD_RATES_ONLY/value=true +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.SOFTWARE/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.SOFTWARE/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.SOFTWARE/value=ARDUINO +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.CMD.PATH/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.CMD.PATH/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.CMD.PATH/value=${A.TOOLS.TEENSY_REBOOT.CONFIG.PATH}/ +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.CONFIG.PATH.LINUX/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.CONFIG.PATH.LINUX/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.CONFIG.PATH.LINUX/value=${A.RUNTIME.HARDWARE.PATH}/teensy/tools/linux +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.CONFIG.PATH.WINDOWS/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.CONFIG.PATH.WINDOWS/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.CONFIG.PATH.WINDOWS/value=${A.RUNTIME.HARDWARE.PATH}/teensy/tools/windows +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.CONFIG.PATH/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.CONFIG.PATH/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.CONFIG.PATH/value=${A.RUNTIME.HARDWARE.PATH}/teensy/tools/mac +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.NAME/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.NAME/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.NAME/value=Teensy upload +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.STEP1.NAME/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.STEP1.NAME/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.STEP1.NAME/value=Teensy post compile +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.STEP1.PATTERN/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.STEP1.PATTERN/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.STEP1.PATTERN/value=${A.TOOLS.TEENSY_REBOOT.CMD.PATH}teensy_post_compile -path\=${A.BUILD.PATH} -file\=${A.BUILD.PROJECT_NAME} -tools\=${A.TOOLS.TEENSY_REBOOT.CONFIG.PATH} -board\=${A.NAME} +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.STEP2.NAME/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.STEP2.NAME/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.STEP2.NAME/value=Teensy reboot +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.STEP2.PATTERN/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.STEP2.PATTERN/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.STEP2.PATTERN/value=${A.TOOLS.TEENSY_REBOOT.CMD.PATH}teensy_reboot -v +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.UPLOAD.PARAMS.QUIET/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.UPLOAD.PARAMS.QUIET/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.UPLOAD.PARAMS.QUIET/value= +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.UPLOAD.PARAMS.VERBOSE/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.UPLOAD.PARAMS.VERBOSE/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.TOOLS.TEENSY_REBOOT.UPLOAD.PARAMS.VERBOSE/value= +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.UPLOAD.DISABLE_FLUSHING/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.UPLOAD.DISABLE_FLUSHING/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.UPLOAD.DISABLE_FLUSHING/value=true +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.UPLOAD.MAXIMUM_RAM_SIZE/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.UPLOAD.MAXIMUM_RAM_SIZE/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.UPLOAD.MAXIMUM_RAM_SIZE/value=65536 +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.UPLOAD.MAXIMUM_SIZE/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.UPLOAD.MAXIMUM_SIZE/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.UPLOAD.MAXIMUM_SIZE/value=262144 +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.UPLOAD.PROTOCOL/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.UPLOAD.PROTOCOL/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.UPLOAD.PROTOCOL/value=halfkay +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.UPLOAD.SPEED/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.UPLOAD.SPEED/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.UPLOAD.SPEED/value=12000000 +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.UPLOAD.TOOL/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.UPLOAD.TOOL/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/A.UPLOAD.TOOL/value=teensy_reboot +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.BOARDS_FILE/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.BOARDS_FILE/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.BOARDS_FILE/value=/Applications/Arduino.app/Contents/Resources/Java/hardware/teensy/all/boards.txt +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.BOARD_NAME/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.BOARD_NAME/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.BOARD_NAME/value=Teensy 3.1 +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.COM_PORT/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.COM_PORT/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.COM_PORT/value=/dev +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.CPU\ Speed/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.CPU\ Speed/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.CPU\ Speed/value=24 MHz +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.EXTRA.C.COMPILE/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.EXTRA.C.COMPILE/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.EXTRA.C.COMPILE/value= +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.EXTRA.COMPILE/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.EXTRA.COMPILE/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.EXTRA.COMPILE/value= +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.EXTRA.CPP.COMPILE/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.EXTRA.CPP.COMPILE/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.EXTRA.CPP.COMPILE/value= +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.Keyboard\ Layout/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.Keyboard\ Layout/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.Keyboard\ Layout/value=US English +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.PLATFORM_FILE/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.PLATFORM_FILE/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.PLATFORM_FILE/value=/Applications/Arduino.app/Contents/Resources/Java/hardware/teensy/all/platform.txt +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.Processor/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.Processor/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.Processor/value= +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.SIZE.SWITCH/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.SIZE.SWITCH/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.SIZE.SWITCH/value=${A.RECIPE.SIZE.PATTERN} +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.SIZE_COMMAND/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.SIZE_COMMAND/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.SIZE_COMMAND/value="${A.COMPILER.PATH}${A.COMPILER.SIZE.CMD}" --format\=avr --mcu\=${A.BUILD.MCU} "${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.elf" +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.TEMPLATE_FOLDER/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.TEMPLATE_FOLDER/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.TEMPLATE_FOLDER/value= +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.TEMPLATE_USE_DEFAULT/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.TEMPLATE_USE_DEFAULT/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.TEMPLATE_USE_DEFAULT/value=true +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.USB\ Type/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.USB\ Type/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/JANTJE.USB\ Type/value=Serial +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/PATH/delimiter=\: +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/PATH/operation=replace +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/PATH/value=${A.COMPILER.PATH}${PathDelimiter}${A.BUILD.GENERIC.PATH}${PathDelimiter}${PATH} +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/append=true +environment/project/it.baeyens.arduino.core.toolChain.release.400069008/appendContributed=true diff --git a/NetMeterBusMaster2.cpp b/NetMeterBusMaster2.cpp new file mode 100644 index 0000000..e688957 --- /dev/null +++ b/NetMeterBusMaster2.cpp @@ -0,0 +1,64 @@ +// Do not remove the include below +// #include + +#include "NetMeterBusMaster2.h" + +#include "cmd.h" +#include "test.h" +#include "uptime.h" +#include "meterBusServer.h" +#include "meterBusMaster.h" +#include "overCurrentProt.h" +#include + + +const uint8_t POWER_LED = 4; +const uint8_t ETHERNET_RESET = 14; + + +static uint8_t mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xEF }; + +static CmdServer cmdServer(2000); +static TestCmd testCmd; +static Uptime uptime; + +static MeterBusMaster meterBusMaster; +static MeterBusServer meterBusServer(2001, &meterBusMaster); +static OverCurrentProt overCurrentProt; + + +void setup() { + Serial.begin(115200); + delay(100); + Serial.println("Starting up ..."); + + pinMode(POWER_LED, OUTPUT); + digitalWrite(POWER_LED, LOW); + + pinMode(ETHERNET_RESET, OUTPUT); + digitalWrite(ETHERNET_RESET, LOW); + delay(100); + digitalWrite(ETHERNET_RESET, HIGH); + delay(100); + Ethernet.begin(mac); + Serial.println("Ethernet started"); + + cmdServer.begin(); + testCmd.registerYourself(&cmdServer); + uptime.begin(&cmdServer); + + overCurrentProt.begin(&cmdServer); + meterBusMaster.begin(&cmdServer); + meterBusServer.begin(); + + digitalWrite(POWER_LED, HIGH); +} + +void loop() { + cmdServer.exec(); + uptime.exec(); + + overCurrentProt.exec(); + meterBusMaster.exec(); + meterBusServer.exec(); +} diff --git a/NetMeterBusMaster2.h b/NetMeterBusMaster2.h new file mode 100644 index 0000000..c348bf8 --- /dev/null +++ b/NetMeterBusMaster2.h @@ -0,0 +1,29 @@ +// Only modify this file to include +// - function definitions (prototypes) +// - include files +// - extern variable definitions +// In the appropriate section + +#ifndef NetMeterBusPowerMaster_H_ +#define NetMeterBusPowerMaster_H_ +#include "Arduino.h" +//add your includes for the project NetMeterBusPowerMaster here + + +//end of add your includes here +#ifdef __cplusplus +extern "C" { +#endif +void loop(); +void setup(); +#ifdef __cplusplus +} // extern "C" +#endif + +//add your function definitions for the project NetMeterBusPowerMaster here + + + + +//Do not add code below this line +#endif /* NetMeterBusPowerMaster_H_ */ diff --git a/cmd.cpp b/cmd.cpp new file mode 100644 index 0000000..2b0c88c --- /dev/null +++ b/cmd.cpp @@ -0,0 +1,102 @@ +#include "cmd.h" +#include "fatal.h" + + +void Cmd::registerYourself(CmdServer *cmdServer) { + if (cmdServer) { + cmdServer->registerCmd(this); + } +} + + +CmdServer::CmdServer(uint16_t port) : + m_server(port), m_client(255), cmd(""), params(""), cmdListIdx(0) +{ +} + +void CmdServer::begin() { + m_server.begin(); +} + +void CmdServer::exec() { + static uint8_t state = 0; + bool done = false; + + m_client = m_server.available(); + + if (m_client) { + int chi; + while ((chi = m_client.read()) != -1) { + char ch = (char) chi; + switch (state) { + case 0: + if ((ch != ' ') && (ch != '\n')) { + cmd += ch; + } else if (ch == '\n') { + done = true; + } else { + state = 1; + } + break; + case 1: + if (ch != '\n') { + params += ch; + } else { + done = true; + state = 0; + } + break; + } + + if (done) { + parseCommand(); + cmd = ""; + params = ""; + } + } + } +} + +void CmdServer::registerCmd(Cmd *cmdObj) { + if (cmdListIdx < NUM_OF_COMMANDS) { + cmdList[cmdListIdx] = cmdObj; + cmdListIdx++; + } else { + fatal(FATAL_NOT_ENOUGH_CMD_SLOTS); + } +} + +void CmdServer::parseCommand() { + //m_client.println("cmd: " + cmd); + //m_client.println("params: " + params); + + if (cmd.equalsIgnoreCase("quit")) { + m_client.println("good bye"); + m_client.flush(); + m_client.stop(); + } else if (cmd.equalsIgnoreCase("help")) { + for (uint8_t i = 0; i < cmdListIdx; i++) { + Cmd *c = cmdList[i]; + m_client.println(c->getCmdName() + " " + c->getHelp()); + } + m_client.println("HELP help"); + m_client.println("QUIT quit"); + } else { + // m_client.print("cmdListIdx: "); m_client.println(cmdListIdx); + bool found = false; + for (uint8_t i = 0; i < cmdListIdx; i++) { + // m_client.println("Check: " + cmdList[i]->getCmdName()); + if (cmdList[i]->getCmdName().equalsIgnoreCase(cmd)) { + found = true; + // m_client.println("cmd found"); + cmdList[i]->setClient(&m_client); + cmdList[i]->setServer(&m_server); + String res = cmdList[i]->exec(params); + m_client.println(res); + break; + } + } + if (! found) + m_client.println("command not found"); + } +} diff --git a/cmd.h b/cmd.h new file mode 100644 index 0000000..5e67f6f --- /dev/null +++ b/cmd.h @@ -0,0 +1,47 @@ +#ifndef CMD_H_ +#define CMD_H_ + +#include +#include +#include +#include +#include + +static const uint8_t NUM_OF_COMMANDS = 10; + +class CmdServer; + +class Cmd { +public: + virtual ~Cmd() {}; + void setClient(EthernetClient *p_client) { m_client = p_client; }; + void setServer(EthernetServer *p_server) { m_server = p_server; }; + virtual String exec(String params) =0; + virtual String getCmdName() =0; + virtual String getHelp() =0; + virtual void registerYourself(CmdServer *cmdServer); +protected: + EthernetClient *m_client; + EthernetServer *m_server; +}; + + + +class CmdServer { +public: + CmdServer(uint16_t port); + void begin(); + void exec(); + void registerCmd(Cmd *cmdObj); +private: + void parseCommand(); + EthernetServer m_server; + EthernetClient m_client; + String cmd; + String params; + uint8_t cmdListIdx; + Cmd *cmdList[NUM_OF_COMMANDS]; +}; + + +#endif /* CMD_H_ */ diff --git a/fatal.cpp b/fatal.cpp new file mode 100644 index 0000000..6011f44 --- /dev/null +++ b/fatal.cpp @@ -0,0 +1,10 @@ +#include +#include"fatal.h" + + +void fatal(uint8_t code) { + // do something with the code and somehow show that there is a problem + while (1); +} + + diff --git a/fatal.h b/fatal.h new file mode 100644 index 0000000..a6c6581 --- /dev/null +++ b/fatal.h @@ -0,0 +1,15 @@ +#ifndef FATAL_H_ +#define FATAL_H_ + +#include + +const uint8_t FATAL_UNKNOWN = 1; +const uint8_t FATAL_NOT_ENOUGH_CMD_SLOTS = 2; + +const uint8_t FATAL_BUFFER_OVERFLOW = 10; + + +void fatal(uint8_t code); + + +#endif /* FATAL_H_ */ diff --git a/mBusDialog.h b/mBusDialog.h new file mode 100644 index 0000000..17e620d --- /dev/null +++ b/mBusDialog.h @@ -0,0 +1,20 @@ + +#ifndef MBUS_DIALOG_H_ +#define MBUS_DIALOG_H_ + +#include + +class ResponseCallback { +public: + virtual void sendResponse(uint8_t *responseBuffer, uint16_t responseBufferLength) =0; + virtual void sendError(uint8_t code) = 0; +}; + +class RequestSender { +public: + virtual uint8_t *getSendBuffer() =0; + virtual void sendBufferReady(uint16_t bufLen, ResponseCallback *responseCallback) =0; +}; + + +#endif /* MBUS_DIALOG_H_ */ diff --git a/meterBusMaster.cpp b/meterBusMaster.cpp new file mode 100644 index 0000000..34f4b79 --- /dev/null +++ b/meterBusMaster.cpp @@ -0,0 +1,279 @@ +#include +#include +#include +#include +#include +#include "meterBusMaster.h" +// #include "config.h" +#include "fatal.h" +#include + + + +uint8_t charToNibble(char i) { + uint8_t r = 99; + if ((i >= '0') && (i <= '9')) { + r = i - '0'; + } else if ((i >= 'a') && (i <= 'f')) { + r = i - 'a' + 10; + } else if ((i >= 'A') && (i <= 'F')) { + r = i - 'A' + 10; + } + return r; +} + +uint16_t stringToUInt8(String i, uint8_t index) { + uint16_t r = 999; + char b0 = i[index]; + uint8_t c0 = charToNibble(b0); + char b1 = i[index + 1]; + uint8_t c1 = charToNibble(b1); + if ((c0 <= 15) && (c1 <= 15)) { + r = (c0 << 4) | c1; + } + return r; +} + + +// ===================================================================================================== + + + +String CalibrationSupport::exec(String params) { + String res = "failed"; + + MeterBusMaster *mbm = (MeterBusMaster*)m_meterBusMaster; + if (params.equalsIgnoreCase("sample") && enable) { + mbm->sample(); + res = "done"; + } else if (params.equalsIgnoreCase("hold") && enable) { + mbm->hold(); + res = "done"; + } else if (params.equalsIgnoreCase("enable") && ! enable) { + enable = true; + mbm->m_calibration = true; + res = "enabled"; + } else if (params.equalsIgnoreCase("disable") && enable) { + enable = false; + mbm->m_calibration = false; + res = "disabled"; + } + return res; +} + +String MeasureCurrent::exec(String params) { + int currentInVal = analogRead(CURRENT_IN); + + int current = ((double)currentInVal * U_UNIT) / R_SHUNT; + + return String() + current + String("mA"); +} + + + +String SendOctets::exec(String params) { + bool err = false;; + uint16_t sendBufLen = 0; + + uint8_t *sendBuffer = m_meterBusMaster->getSendBuffer(); + + if (sendBuffer == 0) { + err = true; + } else { + uint16_t n; + for (uint16_t j = 0; j < params.length(); j+=3) { + n = stringToUInt8(params, j); + if (n == 999) { + err = true; + break; + } + + if (sendBufLen >= SEND_BUFFER_SIZE) + fatal(FATAL_BUFFER_OVERFLOW + 2); + + *(sendBuffer+sendBufLen) = n; + sendBufLen++; + } + } + + if (err) { + return "error"; + } else { + m_meterBusMaster->sendBufferReady(sendBufLen, this); + return "success"; + } +} + +void SendOctets::sendResponse(uint8_t *responseBuffer, uint16_t responseBufferLength) { + Print *out = m_server; + out->print("SO RESP: "); + uint16_t i = 0; + while (true) { + if (responseBuffer[i] <= 0x0f) { + out->print("0"); + } + out->print(responseBuffer[i], HEX); + out->print(" "); + i++; + if (i == responseBufferLength) { + break; + } + } + out->println(""); +} + +void SendOctets::sendError(uint8_t code) { + switch (code) { + case 1: + m_server->println("SO RESP: no resp."); + break; + } +} + + + + +// ===================================================================================================== + + +MeterBusMaster::MeterBusMaster() : m_sendOctets(this), m_measureCurrent(this), + m_calibrationSupport(this), + m_cmdReadyToSend(false), m_cmdReadyFromRecv(false), m_expectResponse(false), + m_sendBufLen(0), m_recvBufLen(0), m_retransmitCount(0), m_responseCallback(0), + m_sampling(true), m_calibration(false) { + pinMode(RX_EN_PIN, OUTPUT); + digitalWrite(RX_EN_PIN, RX_DISABLE); + Serial3.begin(2400); + UART2_C1 |= UART_C1_PE | UART_C1_M; + + +} + +void MeterBusMaster::begin(CmdServer *cmdServer) { + m_sendOctets.registerYourself(cmdServer); + m_measureCurrent.registerYourself(cmdServer); + m_calibrationSupport.registerYourself(cmdServer); +} + + +uint8_t *MeterBusMaster::getSendBuffer() { + return m_expectResponse ? 0 : m_sendBuffer; +} + +void MeterBusMaster::sendBufferReady(uint16_t sendBufLen, ResponseCallback *responseCallback) { + m_cmdReadyToSend = true; + m_retransmitCount = 0; + m_sendBufLen = sendBufLen; + m_responseCallback = responseCallback; +} + +void MeterBusMaster::prepareResponse(bool err, uint8_t in) { + static int16_t expectedChars = -1; + static uint8_t state = 0; + + if (err) { + if (m_responseCallback != 0) { + m_responseCallback->sendError(1); + } + expectedChars = 0; + state = 0; + m_expectResponse = false; + m_responseCallback = 0; + } else { + switch (state) { + case 0: + m_recvBufLen = 0; + if (in == 0xe5) { + state = 2; + expectedChars = 0; + } else if (in == 0x10) { + state = 2; + expectedChars = 4; + } else if (in == 0x68) { + state = 1; + expectedChars = -1; + } + break; + case 1: + expectedChars = (int16_t)in; + expectedChars += 4; + state = 2; + break; + case 2: + expectedChars--; + break; + } + + if (m_recvBufLen >= RECEIVE_BUFFER_SIZE) + fatal(FATAL_BUFFER_OVERFLOW + 1); + + m_recvBuffer[m_recvBufLen] = in; + m_recvBufLen++; + + if (expectedChars == 0) { + if (m_responseCallback != 0) { + m_responseCallback->sendResponse(m_recvBuffer, m_recvBufLen); + } + m_expectResponse = false; + state = 0; + m_responseCallback = 0; + } + } +} + +void MeterBusMaster::sample() { + if (! m_sampling) { + m_sampling = true; + digitalWrite(RX_EN_PIN, RX_DISABLE); + } +} + +void MeterBusMaster::hold() { + if (m_sampling) { + m_sampling = false; + digitalWrite(RX_EN_PIN, RX_ENABLE); + } +} + +void MeterBusMaster::exec() { + if (! m_calibration) { + static unsigned long cmdSendTime = 0; + + if (m_cmdReadyToSend) { + sample(); + Serial << "MeterBusMaster: sending " << m_sendBufLen << " octets." << endl; + Serial3.write(m_sendBuffer, m_sendBufLen); + Serial3.flush(); + hold(); + m_cmdReadyToSend = false; + m_expectResponse = true; + cmdSendTime = millis(); + } + + if (! m_expectResponse) { + sample(); + } + + // timeout + if (m_expectResponse && ((millis() - cmdSendTime) > RESPONSE_TIMEOUT)) { + m_retransmitCount++; + if (m_retransmitCount > 2) { + m_expectResponse = false; + prepareResponse(true, 0); + } else { + m_cmdReadyToSend = true; + } + } + + int serialInChar = Serial3.read(); + if (serialInChar != -1) { + Serial << "Got: " << _HEX(serialInChar) << endl; + } + if ((serialInChar != -1) && m_expectResponse) { + prepareResponse(false, (uint8_t)serialInChar); + } + } +} + + +// ===================================================================================================== diff --git a/meterBusMaster.h b/meterBusMaster.h new file mode 100644 index 0000000..ca0e788 --- /dev/null +++ b/meterBusMaster.h @@ -0,0 +1,90 @@ +#ifndef METERBUSMASTER_H_ +#define METERBUSMASTER_H_ + +#include +#include +#include "cmd.h" +#include "mBusDialog.h" + + +const unsigned long RESPONSE_TIMEOUT = 2000; // millisecond + +const uint8_t RX_EN_PIN = 2; +const uint8_t RX_ENABLE = LOW; +const uint8_t RX_DISABLE = HIGH; + +const uint8_t CURRENT_IN = A1; +const double U_UNIT = 4.9; // mV +const double R_SHUNT = 10.0; + + +class SendOctets : public Cmd, public ResponseCallback { +public: + SendOctets(RequestSender *meterBusMaster) : m_meterBusMaster(meterBusMaster) {} + virtual String getCmdName() { return "SO"; } + virtual String getHelp() { return "Send octets"; } + virtual String exec(String params); + virtual void sendResponse(uint8_t *responseBuffer, uint16_t responseBufferLength); + virtual void sendError(uint8_t code); +private: + RequestSender *m_meterBusMaster; +}; + +class MeasureCurrent : public Cmd { +public: + MeasureCurrent(RequestSender *meterBusMaster) : m_meterBusMaster(meterBusMaster) {} + virtual String getCmdName() { return "MC"; } + virtual String getHelp() { return "Measure current"; } + virtual String exec(String params); +private: + RequestSender *m_meterBusMaster; +}; + +class CalibrationSupport : public Cmd { +public: + CalibrationSupport(RequestSender *meterBusMaster) : m_meterBusMaster(meterBusMaster), enable(false) {} + virtual String getCmdName() { return "CS"; } + virtual String getHelp() { return "Calibration Support"; } + virtual String exec(String params); +private: + RequestSender *m_meterBusMaster; + bool enable; +}; + + + +const uint8_t SEND_BUFFER_SIZE = 30; +const uint8_t RECEIVE_BUFFER_SIZE = 180; + +class MeterBusMaster : public RequestSender { +public: + MeterBusMaster(); + void begin(CmdServer *cmdServer); + void exec(); + uint8_t *getSendBuffer(); + void sendBufferReady(uint16_t bufLen, ResponseCallback *responseCallback); + friend class CalibrationSupport; +private: + SendOctets m_sendOctets; + MeasureCurrent m_measureCurrent; + CalibrationSupport m_calibrationSupport; + bool m_cmdReadyToSend; + bool m_cmdReadyFromRecv; + bool m_expectResponse; + uint16_t m_sendBufLen; + uint16_t m_recvBufLen; + uint8_t m_retransmitCount; + ResponseCallback *m_responseCallback; + uint8_t m_sendBuffer[SEND_BUFFER_SIZE]; + uint8_t m_recvBuffer[RECEIVE_BUFFER_SIZE]; + bool m_sampling; + bool m_calibration; + void prepareResponse(bool err, uint8_t in); + void sample(); + void hold(); + +}; + + + +#endif /* METERBUSMASTER_H_ */ diff --git a/meterBusServer.cpp b/meterBusServer.cpp new file mode 100644 index 0000000..365a36b --- /dev/null +++ b/meterBusServer.cpp @@ -0,0 +1,41 @@ +#include "mBusDialog.h" +#include "meterBusServer.h" +#include + + +MeterBusServer::MeterBusServer(uint16_t port, RequestSender *meterBusMaster) : + m_server(port), m_client(255), m_meterBusMaster(meterBusMaster) { +} + +void MeterBusServer::sendResponse(uint8_t *responseBuffer, uint16_t responseBufferLength) { + m_server.write(responseBuffer, responseBufferLength); +} + +void MeterBusServer::sendError(uint8_t code) { + +} + +void MeterBusServer::begin() { + m_server.begin(); +} + +void MeterBusServer::exec() { + m_client = m_server.available(); + if (m_client) { + uint16_t sendBufLen = 0; + uint8_t *sendBuffer = m_meterBusMaster->getSendBuffer(); + if (sendBuffer != 0) { + int chi; + while ((chi = m_client.read()) != -1) { + char ch = (char) chi; + *(sendBuffer + sendBufLen) = ch; + sendBufLen++; + } + m_meterBusMaster->sendBufferReady(sendBufLen, this); + } + } +} + + + + diff --git a/meterBusServer.h b/meterBusServer.h new file mode 100644 index 0000000..ebdf01b --- /dev/null +++ b/meterBusServer.h @@ -0,0 +1,31 @@ +/* + * meterBusServer.h + * + * Created on: 16.09.2013 + * Author: wn + */ + +#ifndef METERBUSSERVER_H_ +#define METERBUSSERVER_H_ + + +#include +#include "mBusDialog.h" + + +class MeterBusServer : public ResponseCallback { +public: + MeterBusServer(uint16_t port, RequestSender *meterBusMaster); + void begin(); + void exec(); + virtual void sendResponse(uint8_t *responseBuffer, uint16_t responseBufferLength); + virtual void sendError(uint8_t code); +private: + EthernetServer m_server; + EthernetClient m_client; + RequestSender *m_meterBusMaster; +}; + + + +#endif /* METERBUSSERVER_H_ */ diff --git a/overCurrentProt.cpp b/overCurrentProt.cpp new file mode 100644 index 0000000..277f9c1 --- /dev/null +++ b/overCurrentProt.cpp @@ -0,0 +1,68 @@ +#include +#include +#include "overCurrentProt.h" + + + +volatile bool overCurrentMarker; + +void overCurrentProtServiceRoutine() { + // switch off current + digitalWrite(CURRENT_SHUTDOWN, CURRENT_OFF); + + // set marker + overCurrentMarker = true; + + Serial.println("X"); +} + + + + +OverCurrentProtCmd::OverCurrentProtCmd(OverCurrentProt *overCurrentProt) : m_overCurrentProt(overCurrentProt) { +} + +String OverCurrentProtCmd::exec(String params) { + return String("") + m_overCurrentProt->getEventCnt(); +} + +OverCurrentResetCmd::OverCurrentResetCmd(OverCurrentProt *overCurrentProt) : m_overCurrentProt(overCurrentProt) { +} + +String OverCurrentResetCmd::exec(String params) { + m_overCurrentProt->resetEventCnt(); + return "done"; +} + + + +OverCurrentProt::OverCurrentProt() : m_overCurrentProtCmd(this), m_overCurrentResetCmd(this), + m_eventCnt(0), m_timestamp(0) { + +} + + +void OverCurrentProt::begin(CmdServer *cmdServer) { + m_overCurrentProtCmd.registerYourself(cmdServer); + m_overCurrentResetCmd.registerYourself(cmdServer); + pinMode(CURRENT_SHUTDOWN, OUTPUT); + digitalWrite(CURRENT_SHUTDOWN, CURRENT_ON); + overCurrentMarker = false; + pinMode(CURRENT_INTERRUPT, INPUT); + attachInterrupt(CURRENT_INTERRUPT, overCurrentProtServiceRoutine, FALLING); + Serial.println("OC ready"); +} + + +void OverCurrentProt::exec() { + if ((m_timestamp == 0) && overCurrentMarker) { + m_eventCnt++; + m_timestamp = millis(); + } + + if ((m_timestamp != 0) && ((m_timestamp + TURN_ON_DELAY) < millis())) { + overCurrentMarker = false; + m_timestamp = 0; + digitalWrite(CURRENT_SHUTDOWN, CURRENT_ON); + } +} diff --git a/overCurrentProt.h b/overCurrentProt.h new file mode 100644 index 0000000..f4ffd1b --- /dev/null +++ b/overCurrentProt.h @@ -0,0 +1,56 @@ +#ifndef OVERCURRENTPROT_H_ +#define OVERCURRENTPROT_H_ + + +#include "cmd.h" + + +#define CURRENT_SHUTDOWN 5 +#define CURRENT_ON 0 +#define CURRENT_OFF 1 +#define CURRENT_INTERRUPT 3 + +const unsigned long TURN_ON_DELAY = 2000; // ms + + +class OverCurrentProt; + +class OverCurrentProtCmd : public Cmd { +public: + OverCurrentProtCmd(OverCurrentProt *overCurrentProt); + virtual String getCmdName() { return "OCPC"; } + virtual String getHelp() { return "OCP count"; } + virtual String exec(String params); +private: + OverCurrentProt *m_overCurrentProt; +}; + +class OverCurrentResetCmd : public Cmd { +public: + OverCurrentResetCmd(OverCurrentProt *overCurrentProt); + virtual String getCmdName() { return "OCRST"; } + virtual String getHelp() { return "OCP reset"; } + virtual String exec(String params); +private: + OverCurrentProt *m_overCurrentProt; +}; + + + +class OverCurrentProt { +public: + OverCurrentProt(); + void begin(CmdServer *cmdServer); + void exec(); + uint32_t getEventCnt() { return m_eventCnt; }; + void resetEventCnt() { m_eventCnt = 0; }; +private: + OverCurrentProtCmd m_overCurrentProtCmd; + OverCurrentResetCmd m_overCurrentResetCmd; + uint32_t m_eventCnt; + unsigned long m_timestamp; +}; + + + +#endif /* OVERCURRENTPROT_H_ */ diff --git a/spec.d b/spec.d new file mode 100644 index 0000000..14b6d20 --- /dev/null +++ b/spec.d @@ -0,0 +1,2 @@ +spec.o: \ + /Users/wn/Documents/workspace/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.C diff --git a/test.cpp b/test.cpp new file mode 100644 index 0000000..7667d38 --- /dev/null +++ b/test.cpp @@ -0,0 +1,7 @@ +#include +#include "test.h" + +String TestCmd::exec(String params) { + return "Result of testCmd"; +} + diff --git a/test.h b/test.h new file mode 100644 index 0000000..5dc257c --- /dev/null +++ b/test.h @@ -0,0 +1,14 @@ +#ifndef TEST_H_ +#define TEST_H_ + +#include "cmd.h" + +class TestCmd : public Cmd { +public: + virtual String getCmdName() { return "TEST"; } + virtual String getHelp() { return "Just a test command"; } + virtual String exec(String params); +}; + + +#endif /* TEST_H_ */ diff --git a/uptime.cpp b/uptime.cpp new file mode 100644 index 0000000..81316e8 --- /dev/null +++ b/uptime.cpp @@ -0,0 +1,48 @@ +#include +#include "uptime.h" +#include + + +UptimeCmd::UptimeCmd(Uptime *uptime) : m_uptime(uptime) { + +} + +String UptimeCmd::exec(String params) { + return m_uptime->getDays() + String(" ") + + m_uptime->getHours() + String(":") + m_uptime->getMinutes() + String(":") + m_uptime->getSeconds(); +} + +Uptime::Uptime() : m_uptimeCmd(this), m_seconds(0), m_minutes(0), m_hours(0), m_days(0) { + +} + + +void Uptime::begin(CmdServer *cmdServer) { + m_uptimeCmd.registerYourself(cmdServer); +} + + +void Uptime::exec() { + static unsigned long lastMillis = 0; + + unsigned long currentMillis = millis(); + if (currentMillis >= (lastMillis + 1000)) { + m_seconds += ((currentMillis - lastMillis) / 1000); + if (m_seconds >= 60) { + m_seconds -= 60; + m_minutes++; + if (m_minutes >= 60) { + m_minutes -= 60; + m_hours++; + if (m_hours >= 24) { + m_hours -= 24; + m_days++; + } + } + } + + lastMillis = currentMillis; + + Serial << m_days << ", " << m_hours << ":" << m_minutes << ":" << m_seconds << endl; + } +} diff --git a/uptime.h b/uptime.h new file mode 100644 index 0000000..4608761 --- /dev/null +++ b/uptime.h @@ -0,0 +1,39 @@ +#ifndef UPTIME_H_ +#define UPTIME_H_ + +#include "cmd.h" + + +class Uptime; + + +class UptimeCmd : public Cmd { +public: + UptimeCmd(Uptime *uptime); + virtual String getCmdName() { return "UP"; } + virtual String getHelp() { return "Uptime"; } + virtual String exec(String params); +private: + Uptime *m_uptime; +}; + + +class Uptime { +public: + Uptime(); + void begin(CmdServer *cmdServer); + void exec(); + uint8_t getSeconds() { return m_seconds; }; + uint8_t getMinutes() { return m_minutes; }; + uint8_t getHours() { return m_hours; }; + uint8_t getDays() { return m_days; }; +private: + UptimeCmd m_uptimeCmd; + uint8_t m_seconds; + uint8_t m_minutes; + uint8_t m_hours; + uint16_t m_days; +}; + + +#endif /* TEST_H_ */