From da5f1d028f1d904adaeb2b74571a793fdb9c8a00 Mon Sep 17 00:00:00 2001 From: agr Date: Tue, 7 Apr 2020 11:37:19 +0200 Subject: [PATCH] working --- .project | 2 +- .settings/language.settings.xml | 2 +- .settings/org.eclipse.cdt.core.prefs | 66 +++++++--------------------- Web_Net_Setup.ino | 36 +++++++-------- struct.h | 18 ++++++++ 5 files changed, 53 insertions(+), 71 deletions(-) diff --git a/.project b/.project index 52cbece..cf72a26 100644 --- a/.project +++ b/.project @@ -39,7 +39,7 @@ core/variant 2 - ECLIPSE_HOME/arduinoPlugin/packages/arduino/hardware/avr/1.8.2/variants/mega + ECLIPSE_HOME/arduinoPlugin/packages/arduino/hardware/avr/1.8.2/variants/eightanaloginputs libraries/EEPROM diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index 9969d91..9f6c658 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -4,7 +4,7 @@ - + diff --git a/.settings/org.eclipse.cdt.core.prefs b/.settings/org.eclipse.cdt.core.prefs index 5269f99..f2136ad 100644 --- a/.settings/org.eclipse.cdt.core.prefs +++ b/.settings/org.eclipse.cdt.core.prefs @@ -13,10 +13,10 @@ environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.EXT environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.EXTENDED_FUSES/value=0xFD environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.FILE/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.FILE/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.FILE/value=stk500v2/stk500boot_v2_mega2560.hex +environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.FILE/value=atmega/ATmegaBOOT_168_atmega328.hex environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.HIGH_FUSES/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.HIGH_FUSES/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.HIGH_FUSES/value=0xD8 +environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.HIGH_FUSES/value=0xDA environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.LOCK_BITS/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.LOCK_BITS/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.BOOTLOADER.LOCK_BITS/value=0x0F @@ -34,7 +34,7 @@ environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.ARCH/ope environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.ARCH/value=AVR environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.BOARD/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.BOARD/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.BOARD/value=AVR_MEGA2560 +environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.BOARD/value=AVR_NANO environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.CORE.PATH/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.CORE.PATH/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.CORE.PATH/value=C\:\\Sloeber\\arduinoPlugin\\packages\\arduino\\hardware\\avr\\1.8.2\\cores\\arduino @@ -49,7 +49,7 @@ environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.F_CPU/op environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.F_CPU/value=16000000L environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.MCU/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.MCU/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.MCU/value=atmega2560 +environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.MCU/value=atmega328p environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.PATH/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.PATH/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.PATH/value=${ProjDirPath}/${ConfigName} @@ -67,10 +67,10 @@ environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.USB_MANU environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.USB_MANUFACTURER/value=\\"Unknown\\" environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.VARIANT.PATH/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.VARIANT.PATH/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.VARIANT.PATH/value=C\:\\Sloeber\\arduinoPlugin\\packages\\arduino\\hardware\\avr\\1.8.2\\variants\\mega +environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.VARIANT.PATH/value=C\:\\Sloeber\\arduinoPlugin\\packages\\arduino\\hardware\\avr\\1.8.2\\variants\\eightanaloginputs environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.VARIANT/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.VARIANT/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.VARIANT/value=mega +environment/project/io.sloeber.core.toolChain.release.613547860/A.BUILD.VARIANT/value=eightanaloginputs environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.AR.CMD/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.AR.CMD/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.AR.CMD/value=avr-gcc-ar @@ -91,7 +91,7 @@ environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.ELF environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.ELF.EXTRA_FLAGS/value= environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.ELF.FLAGS/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.ELF.FLAGS/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.ELF.FLAGS/value=${A.COMPILER.WARNING_FLAGS} -Os -Wl,--gc-sections,--relax +environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.ELF.FLAGS/value=${A.COMPILER.WARNING_FLAGS} -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.EXTRA_FLAGS/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.EXTRA_FLAGS/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.COMPILER.C.EXTRA_FLAGS/value= @@ -160,28 +160,10 @@ environment/project/io.sloeber.core.toolChain.release.613547860/A.ESP8266.NETWOR environment/project/io.sloeber.core.toolChain.release.613547860/A.ESP8266.NETWORK.UPLOAD.TOOL/value=esp8266OTA environment/project/io.sloeber.core.toolChain.release.613547860/A.NAME/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.NAME/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.NAME/value=Arduino Mega or Mega 2560 +environment/project/io.sloeber.core.toolChain.release.613547860/A.NAME/value=Arduino Nano environment/project/io.sloeber.core.toolChain.release.613547860/A.PACKAGES/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.PACKAGES/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.PACKAGES/value=${eclipse_home}/arduinoPlugin/packages -environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.0/delimiter=; -environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.0/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.0/value=0x0010 -environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.1/delimiter=; -environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.1/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.1/value=0x0042 -environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.2/delimiter=; -environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.2/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.2/value=0x0010 -environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.3/delimiter=; -environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.3/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.3/value=0x0042 -environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.4/delimiter=; -environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.4/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.4/value=0x0210 -environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.5/delimiter=; -environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.5/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.PID.5/value=0x0242 environment/project/io.sloeber.core.toolChain.release.613547860/A.PREPROC.INCLUDES.FLAGS/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.PREPROC.INCLUDES.FLAGS/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.PREPROC.INCLUDES.FLAGS/value=-w -x c++ -M -MG -MP @@ -424,16 +406,16 @@ environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.ALTID/o environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.ALTID/value=no_altID environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.MAXIMUM_DATA_SIZE/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.MAXIMUM_DATA_SIZE/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.MAXIMUM_DATA_SIZE/value=8192 +environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.MAXIMUM_DATA_SIZE/value=2048 environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.MAXIMUM_SIZE/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.MAXIMUM_SIZE/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.MAXIMUM_SIZE/value=253952 +environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.MAXIMUM_SIZE/value=30720 environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.PROTOCOL/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.PROTOCOL/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.PROTOCOL/value=wiring +environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.PROTOCOL/value=arduino environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.SPEED/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.SPEED/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.SPEED/value=115200 +environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.SPEED/value=57600 environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.TOOL/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.TOOL/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.TOOL/value=avrdude @@ -443,24 +425,6 @@ environment/project/io.sloeber.core.toolChain.release.613547860/A.UPLOAD.USBID/v environment/project/io.sloeber.core.toolChain.release.613547860/A.VERSION/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/A.VERSION/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/A.VERSION/value=1.8.2 -environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.0/delimiter=; -environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.0/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.0/value=0x2341 -environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.1/delimiter=; -environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.1/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.1/value=0x2341 -environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.2/delimiter=; -environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.2/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.2/value=0x2A03 -environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.3/delimiter=; -environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.3/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.3/value=0x2A03 -environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.4/delimiter=; -environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.4/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.4/value=0x2341 -environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.5/delimiter=; -environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.5/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/A.VID.5/value=0x2341 environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.ARCHITECTURE_ID/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.ARCHITECTURE_ID/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.ARCHITECTURE_ID/value=avr @@ -469,10 +433,10 @@ environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARDS_FI environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARDS_FILE/value=C\:\\Sloeber\\arduinoPlugin\\packages\\arduino\\hardware\\avr\\1.8.2\\boards.txt environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARD_ID/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARD_ID/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARD_ID/value=mega +environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARD_ID/value=nano environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARD_NAME/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARD_NAME/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARD_NAME/value=Arduino Mega or Mega 2560 +environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.BOARD_NAME/value=Arduino Nano environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.COM_PORT/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.COM_PORT/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.COM_PORT/value=COM4 @@ -505,7 +469,7 @@ environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.MAKE_LOCA environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.MAKE_LOCATION/value=C\:\\Sloeber\\arduinoPlugin\\tools\\make\\ environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.MENU/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.MENU/operation=replace -environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.MENU/value=cpu\=atmega2560 +environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.MENU/value=cpu\=atmega328old environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.OBJCOPY/delimiter=; environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.OBJCOPY/operation=replace environment/project/io.sloeber.core.toolChain.release.613547860/JANTJE.OBJCOPY/value=${A.RECIPE.OBJCOPY.EEP.PATTERN}\n\t${A.RECIPE.OBJCOPY.HEX.PATTERN} diff --git a/Web_Net_Setup.ino b/Web_Net_Setup.ino index 218e58a..e53cac1 100644 --- a/Web_Net_Setup.ino +++ b/Web_Net_Setup.ino @@ -63,7 +63,7 @@ For more informations about EEPROMAnything.h look at http://playground.arduino.c */ -#define WEBDUINO_FAVICON_DATA "" // no favicon +//#define WEBDUINO_FAVICON_DATA "" // no favicon #define DEBUG //uncomment for serial debug output #define USE_SYSTEM_LIBRARY //comment out if you want to save some space (about 1 Byte). You wouldn't see uptime and free RAM if it's commented out. #define SERIAL_BAUD 9600 @@ -90,23 +90,23 @@ For more informations about EEPROMAnything.h look at http://playground.arduino.c */ #include "struct.h" - int EEPROM_readAnything(int ee, config_t& value) -{ - byte* p = (byte*)(void*)&value; - unsigned int i; - for (i = 0; i < sizeof(value); i++) - *p++ = EEPROM.read(ee++); - return i; -} - - int EEPROM_writeAnything(int ee, const config_t& value) -{ - const byte* p = (const byte*)(const void*)&value; - unsigned int i; - for (i = 0; i < sizeof(value); i++) - EEPROM.write(ee++, *p++); - return i; -} +// int EEPROM_readAnything(int ee, config_t& value) +//{ +// byte* p = (byte*)(void*)&value; +// unsigned int i; +// for (i = 0; i < sizeof(value); i++) +// *p++ = EEPROM.read(ee++); +// return i; +//} +// +// int EEPROM_writeAnything(int ee, const config_t& value) +//{ +// const byte* p = (const byte*)(const void*)&value; +// unsigned int i; +// for (i = 0; i < sizeof(value); i++) +// EEPROM.write(ee++, *p++); +// return i; +//} /** * set_EEPROM_Default() function diff --git a/struct.h b/struct.h index 64f12c5..b55849e 100644 --- a/struct.h +++ b/struct.h @@ -22,5 +22,23 @@ struct config_t unsigned int webserverPort; } eeprom_config; +int EEPROM_readAnything(int ee, config_t& value) +{ + byte* p = (byte*)(void*)&value; + unsigned int i; + for (i = 0; i < sizeof(value); i++) + *p++ = EEPROM.read(ee++); + return i; +} + + int EEPROM_writeAnything(int ee, const config_t& value) +{ + const byte* p = (const byte*)(const void*)&value; + unsigned int i; + for (i = 0; i < sizeof(value); i++) + EEPROM.write(ee++, *p++); + return i; +} + #endif /* STRUCT_H_ */