Code cleanup (#787)

* Cleanup Core

* SAMD adjustments
This commit is contained in:
Olivier
2017-03-15 19:05:17 +01:00
committed by Henrik Ekblad
parent 481bd367f3
commit 61a415c422
44 changed files with 163 additions and 149 deletions
+32 -16
View File
@@ -31,28 +31,35 @@
* Serial and debug options * Serial and debug options
***********************************/ ***********************************/
// Enable MY_DEBUG in sketch to show debug prints. This option will add a lot to the size of the /**
// final sketch but is helpful to see what is actually is happening during development * @def MY_DEBUG
* @brief Enable MY_DEBUG in sketch to show debug prints. This option will add a lot to the size of the
* final sketch but is helpful to see what is actually is happening during development
*/
//#define MY_DEBUG //#define MY_DEBUG
// Enable MY_SPECIAL_DEBUG in sketch to activate I_DEBUG messages if MY_DEBUG is disabled. /**
// I_DEBUG requests are: * @def MY_SPECIAL_DEBUG
// R: routing info (only repeaters): received msg XXYY (as stream), where XX is the node and YY the routing node * @brief Enable MY_SPECIAL_DEBUG in sketch to activate I_DEBUG messages if MY_DEBUG is disabled.
// V: CPU voltage * I_DEBUG requests are:
// F: CPU frequency * R: routing info (only repeaters): received msg XXYY (as stream), where XX is the node and YY the routing node
// M: free memory * V: CPU voltage
// E: clear MySensors EEPROM area and reboot (i.e. "factory" reset) * F: CPU frequency
* M: free memory
* E: clear MySensors EEPROM area and reboot (i.e. "factory" reset)
*/
//#define MY_SPECIAL_DEBUG //#define MY_SPECIAL_DEBUG
// Enable MY_DEBUG_VERBOSE_SIGNING flag for verbose debug prints related to signing. /**
// Requires DEBUG to be enabled. * @def MY_DISABLED_SERIAL
// This will add even more to the size of the final sketch! * @brief Enable MY_DISABLED_SERIAL in sketch if you want to use TX(1), RX(0) as normal I/O pins
//#define MY_DEBUG_VERBOSE_SIGNING */
// Enable this in sketch if you want to use TX(1), RX(0) as normal I/O pin
//#define MY_DISABLED_SERIAL //#define MY_DISABLED_SERIAL
// Enable MY_CORE_ONLY flag if you want to use core functions without loading the framework /**
* @def MY_CORE_ONLY
* @brief Enable MY_CORE_ONLY flag if you want to use core functions without loading the framework
*/
//#define MY_CORE_ONLY //#define MY_CORE_ONLY
// Turn off debug if serial pins is used for other stuff // Turn off debug if serial pins is used for other stuff
@@ -358,6 +365,12 @@
/********************************** /**********************************
* Message Signing Settings * Message Signing Settings
***********************************/ ***********************************/
/**
* @def Enable MY_DEBUG_VERBOSE_SIGNING
* @brief Flag for verbose debug prints related to signing. Requires DEBUG to be enabled. This will add even more to the size of the final sketch!
*/
//#define MY_DEBUG_VERBOSE_SIGNING
/** /**
* @def MY_SIGNING_ATSHA204 * @def MY_SIGNING_ATSHA204
* @brief Enables HW backed signing functionality in library. * @brief Enables HW backed signing functionality in library.
@@ -945,6 +958,9 @@
// Doxygen specific constructs, not included when built normally // Doxygen specific constructs, not included when built normally
// This is used to enable disabled macros/definitions to be included in the documentation as well. // This is used to enable disabled macros/definitions to be included in the documentation as well.
#if DOXYGEN #if DOXYGEN
#define MY_DEBUG
#define MY_SPECIAL_DEBUG
#define MY_DISABLED_SERIAL
#define MY_SIGNING_ATSHA204 #define MY_SIGNING_ATSHA204
#define MY_SIGNING_SOFT #define MY_SIGNING_SOFT
#define MY_SIGNING_REQUEST_SIGNATURES #define MY_SIGNING_REQUEST_SIGNATURES
+7 -1
View File
@@ -78,7 +78,13 @@
#define MY_CAP_RXBUF "-" #define MY_CAP_RXBUF "-"
#endif #endif
#if defined(MY_RF24_ENABLE_ENCRYPTION) || defined(MY_RFM69_ENABLE_ENCRYPTION)
#define MY_CAP_ENCR "X"
#else
#define MY_CAP_ENCR "-"
#endif
#define MY_CAPABILITIES MY_CAP_RESET MY_CAP_RADIO MY_CAP_OTA_FW MY_CAP_TYPE MY_CAP_ARCH MY_CAP_SIGN MY_CAP_RXBUF
#define MY_CAPABILITIES MY_CAP_RESET MY_CAP_RADIO MY_CAP_OTA_FW MY_CAP_TYPE MY_CAP_ARCH MY_CAP_SIGN MY_CAP_RXBUF MY_CAP_ENCR
#endif /* MyCapabilities_h */ #endif /* MyCapabilities_h */
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2016 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+3 -4
View File
@@ -138,7 +138,7 @@ bool gatewayTransportInit(void)
#endif /* MY_GATEWAY_ESP8266 */ #endif /* MY_GATEWAY_ESP8266 */
#if defined(MY_GATEWAY_CLIENT_MODE) #if defined(MY_GATEWAY_CLIENT_MODE)
#if defined(MY_CONTROLLER_URL_ADDRESS) #if defined(MY_CONTROLLER_URL_ADDRESS)
if (client.connect(MY_CONTROLLER_URL_ADDRESS, MY_PORT)) { if (client.connect(MY_CONTROLLER_URL_ADDRESS, MY_PORT)) {
#else #else
if (client.connect(_ethernetControllerIP, MY_PORT)) { if (client.connect(_ethernetControllerIP, MY_PORT)) {
@@ -148,8 +148,7 @@ bool gatewayTransportInit(void)
gatewayTransportSend(buildGw(_msgTmp, I_GATEWAY_READY).set(MSG_GW_STARTUP_COMPLETE)); gatewayTransportSend(buildGw(_msgTmp, I_GATEWAY_READY).set(MSG_GW_STARTUP_COMPLETE));
_w5100_spi_en(true); _w5100_spi_en(true);
presentNode(); presentNode();
} } else {
else {
client.stop(); client.stop();
debug(PSTR("Eth: Failed to connect\n")); debug(PSTR("Eth: Failed to connect\n"));
} }
@@ -159,7 +158,7 @@ bool gatewayTransportInit(void)
#if defined(MY_GATEWAY_LINUX) && defined(MY_IP_ADDRESS) #if defined(MY_GATEWAY_LINUX) && defined(MY_IP_ADDRESS)
_ethernetServer.begin(_ethernetGatewayIP); _ethernetServer.begin(_ethernetGatewayIP);
#else #else
// we have to use pointers due to the constructor of EthernetServer // we have to use pointers due to the constructor of EthernetServer
_ethernetServer.begin(); _ethernetServer.begin();
#endif #endif
#endif /* USE_UDP */ #endif /* USE_UDP */
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2016 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2016 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+14 -14
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
@@ -17,10 +17,17 @@
* version 2 as published by the Free Software Foundation. * version 2 as published by the Free Software Foundation.
*/ */
#ifdef ARDUINO_ARCH_AVR
#include "MyHwAVR.h" #include "MyHwAVR.h"
bool hwInit(void)
{
#if !defined(MY_DISABLED_SERIAL)
MY_SERIALDEVICE.begin(MY_BAUD_RATE);
#endif
return true;
}
#define INVALID_INTERRUPT_NUM (0xFFu) #define INVALID_INTERRUPT_NUM (0xFFu)
volatile uint8_t _wokeUpByInterrupt = volatile uint8_t _wokeUpByInterrupt =
@@ -197,14 +204,13 @@ int8_t hwSleep(uint8_t interrupt1, uint8_t mode1, uint8_t interrupt2, uint8_t mo
return ret; return ret;
} }
bool hwUniqueID(unique_id_t* uniqueID) bool hwUniqueID(unique_id_t* uniqueID)
{ {
// not implemented yet // not implemented yet
(void)uniqueID; (void)uniqueID;
return false; return false;
} }
#if defined(MY_DEBUG) || defined(MY_SPECIAL_DEBUG)
uint16_t hwCPUVoltage() uint16_t hwCPUVoltage()
{ {
// Measure Vcc against 1.1V Vref // Measure Vcc against 1.1V Vref
@@ -261,18 +267,17 @@ uint16_t hwFreeMem()
int v; int v;
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
} }
#endif
#ifdef MY_DEBUG
void hwDebugPrint(const char *fmt, ... ) void hwDebugPrint(const char *fmt, ... )
{ {
char fmtBuffer[MY_SERIAL_OUTPUT_SIZE]; char fmtBuffer[MY_SERIAL_OUTPUT_SIZE];
#ifdef MY_GATEWAY_FEATURE #ifdef MY_GATEWAY_FEATURE
// prepend debug message to be handled correctly by controller (C_INTERNAL, I_LOG_MESSAGE) // prepend debug message to be handled correctly by controller (C_INTERNAL, I_LOG_MESSAGE)
snprintf_P(fmtBuffer, sizeof(fmtBuffer), PSTR("0;255;%d;0;%d;"), C_INTERNAL, I_LOG_MESSAGE); snprintf_P(fmtBuffer, sizeof(fmtBuffer), PSTR("0;255;%d;0;%d;%lu "), C_INTERNAL, I_LOG_MESSAGE,
hwMillis());
MY_SERIALDEVICE.print(fmtBuffer); MY_SERIALDEVICE.print(fmtBuffer);
#else #else
// prepend timestamp (AVR nodes) // prepend timestamp
MY_SERIALDEVICE.print(hwMillis()); MY_SERIALDEVICE.print(hwMillis());
MY_SERIALDEVICE.print(" "); MY_SERIALDEVICE.print(" ");
#endif #endif
@@ -289,9 +294,4 @@ void hwDebugPrint(const char *fmt, ... )
va_end (args); va_end (args);
MY_SERIALDEVICE.print(fmtBuffer); MY_SERIALDEVICE.print(fmtBuffer);
MY_SERIALDEVICE.flush(); MY_SERIALDEVICE.flush();
//MY_SERIALDEVICE.write(freeRam());
} }
#endif
#endif // #ifdef ARDUINO_ARCH_AVR
+2 -27
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
@@ -38,35 +38,12 @@
#define MY_SERIALDEVICE Serial #define MY_SERIALDEVICE Serial
#endif #endif
#if defined __AVR_ATmega328P__
#ifndef sleep_bod_disable
#define sleep_bod_disable() \
do { \
unsigned char tempreg; \
__asm__ __volatile__("in %[tempreg], %[mcucr]" "\n\t" \
"ori %[tempreg], %[bods_bodse]" "\n\t" \
"out %[mcucr], %[tempreg]" "\n\t" \
"andi %[tempreg], %[not_bodse]" "\n\t" \
"out %[mcucr], %[tempreg]" \
: [tempreg] "=&d" (tempreg) \
: [mcucr] "I" _SFR_IO_ADDR(MCUCR), \
[bods_bodse] "i" (_BV(BODS) | _BV(BODSE)), \
[not_bodse] "i" (~_BV(BODSE))); \
} while (0)
#endif
#endif
// Define these as macros to save valuable space // Define these as macros to save valuable space
#define hwDigitalWrite(__pin, __value) digitalWriteFast(__pin, __value) #define hwDigitalWrite(__pin, __value) digitalWriteFast(__pin, __value)
#define hwDigitalRead(__pin) digitalReadFast(__pin) #define hwDigitalRead(__pin) digitalReadFast(__pin)
#define hwPinMode(__pin, __value) pinModeFast(__pin, __value) #define hwPinMode(__pin, __value) pinModeFast(__pin, __value)
#if defined(MY_DISABLED_SERIAL) bool hwInit(void);
#define hwInit()
#else
#define hwInit() MY_SERIALDEVICE.begin(MY_BAUD_RATE)
#endif
#define hwWatchdogReset() wdt_reset() #define hwWatchdogReset() wdt_reset()
#define hwReboot() wdt_enable(WDTO_15MS); while (1) #define hwReboot() wdt_enable(WDTO_15MS); while (1)
@@ -77,8 +54,6 @@
#define hwReadConfigBlock(__buf, __pos, __length) eeprom_read_block((void*)(__buf), (void*)(__pos), (__length)) #define hwReadConfigBlock(__buf, __pos, __length) eeprom_read_block((void*)(__buf), (void*)(__pos), (__length))
#define hwWriteConfigBlock(__buf, __pos, __length) eeprom_update_block((void*)(__buf), (void*)(__pos), (__length)) #define hwWriteConfigBlock(__buf, __pos, __length) eeprom_update_block((void*)(__buf), (void*)(__pos), (__length))
enum period_t { enum period_t {
SLEEP_15MS, SLEEP_15MS,
SLEEP_30MS, SLEEP_30MS,
+10 -11
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
@@ -20,13 +20,14 @@
#include "MyHwESP8266.h" #include "MyHwESP8266.h"
#include <EEPROM.h> #include <EEPROM.h>
void hwInit(void) bool hwInit(void)
{ {
#if !defined(MY_DISABLED_SERIAL) #if !defined(MY_DISABLED_SERIAL)
MY_SERIALDEVICE.begin(MY_BAUD_RATE, SERIAL_8N1, MY_ESP8266_SERIAL_MODE, 1); MY_SERIALDEVICE.begin(MY_BAUD_RATE, SERIAL_8N1, MY_ESP8266_SERIAL_MODE, 1);
MY_SERIALDEVICE.setDebugOutput(true); MY_SERIALDEVICE.setDebugOutput(true);
#endif #endif
EEPROM.begin(EEPROM_size); EEPROM.begin(EEPROM_size);
return true;
} }
void hwReadConfigBlock(void* buf, void* addr, size_t length) void hwReadConfigBlock(void* buf, void* addr, size_t length)
@@ -109,8 +110,6 @@ ADC_MODE(ADC_VCC);
ADC_MODE(ADC_TOUT); ADC_MODE(ADC_TOUT);
#endif #endif
#if defined(MY_DEBUG) || defined(MY_SPECIAL_DEBUG)
uint16_t hwCPUVoltage() uint16_t hwCPUVoltage()
{ {
#if defined(MY_SPECIAL_DEBUG) #if defined(MY_SPECIAL_DEBUG)
@@ -118,7 +117,7 @@ uint16_t hwCPUVoltage()
return ESP.getVcc(); return ESP.getVcc();
#else #else
// not possible // not possible
return 0; return FUNCTION_NOT_SUPPORTED;
#endif #endif
} }
@@ -132,16 +131,19 @@ uint16_t hwFreeMem()
{ {
return ESP.getFreeHeap(); return ESP.getFreeHeap();
} }
#endif
#ifdef MY_DEBUG
void hwDebugPrint(const char *fmt, ... ) void hwDebugPrint(const char *fmt, ... )
{ {
char fmtBuffer[MY_SERIAL_OUTPUT_SIZE]; char fmtBuffer[MY_SERIAL_OUTPUT_SIZE];
#ifdef MY_GATEWAY_FEATURE #ifdef MY_GATEWAY_FEATURE
// prepend debug message to be handled correctly by controller (C_INTERNAL, I_LOG_MESSAGE) // prepend debug message to be handled correctly by controller (C_INTERNAL, I_LOG_MESSAGE)
snprintf_P(fmtBuffer, sizeof(fmtBuffer), PSTR("0;255;%d;0;%d;"), C_INTERNAL, I_LOG_MESSAGE); snprintf_P(fmtBuffer, sizeof(fmtBuffer), PSTR("0;255;%d;0;%d;%lu "), C_INTERNAL, I_LOG_MESSAGE,
hwMillis());
MY_SERIALDEVICE.print(fmtBuffer); MY_SERIALDEVICE.print(fmtBuffer);
#else
// prepend timestamp
MY_SERIALDEVICE.print(hwMillis());
MY_SERIALDEVICE.print(" ");
#endif #endif
va_list args; va_list args;
va_start (args, fmt ); va_start (args, fmt );
@@ -156,7 +158,4 @@ void hwDebugPrint(const char *fmt, ... )
va_end (args); va_end (args);
MY_SERIALDEVICE.print(fmtBuffer); MY_SERIALDEVICE.print(fmtBuffer);
MY_SERIALDEVICE.flush(); MY_SERIALDEVICE.flush();
//MY_SERIALDEVICE.write(freeRam());
} }
#endif
+2 -2
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
@@ -43,7 +43,7 @@
#define hwMillis() millis() #define hwMillis() millis()
#define hwRandomNumberInit() randomSeed(RANDOM_REG32) #define hwRandomNumberInit() randomSeed(RANDOM_REG32)
void hwInit(void); bool hwInit(void);
void hwReadConfigBlock(void* buf, void* adr, size_t length); void hwReadConfigBlock(void* buf, void* adr, size_t length);
void hwWriteConfigBlock(void* buf, void* adr, size_t length); void hwWriteConfigBlock(void* buf, void* adr, size_t length);
void hwWriteConfig(const int addr, uint8_t value); void hwWriteConfig(const int addr, uint8_t value);
+6 -10
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2016 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors * Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
@@ -26,7 +26,7 @@
static SoftEeprom eeprom = SoftEeprom(MY_LINUX_CONFIG_FILE, 1024); // ATMega328 has 1024 bytes static SoftEeprom eeprom = SoftEeprom(MY_LINUX_CONFIG_FILE, 1024); // ATMega328 has 1024 bytes
void hwInit() bool hwInit(void)
{ {
MY_SERIALDEVICE.begin(MY_BAUD_RATE); MY_SERIALDEVICE.begin(MY_BAUD_RATE);
#ifdef MY_GATEWAY_SERIAL #ifdef MY_GATEWAY_SERIAL
@@ -37,6 +37,7 @@ void hwInit()
} }
#endif #endif
#endif #endif
return true;
} }
void hwReadConfigBlock(void* buf, void* addr, size_t length) void hwReadConfigBlock(void* buf, void* addr, size_t length)
@@ -107,25 +108,23 @@ int8_t hwSleep(uint8_t interrupt1, uint8_t mode1, uint8_t interrupt2, uint8_t mo
return MY_SLEEP_NOT_POSSIBLE; return MY_SLEEP_NOT_POSSIBLE;
} }
#if defined(MY_DEBUG) || defined(MY_SPECIAL_DEBUG)
uint16_t hwCPUVoltage() uint16_t hwCPUVoltage()
{ {
// TODO: Not supported! // TODO: Not supported!
return 0; return FUNCTION_NOT_SUPPORTED;
} }
uint16_t hwCPUFrequency() uint16_t hwCPUFrequency()
{ {
// TODO: Not supported! // TODO: Not supported!
return 0; return FUNCTION_NOT_SUPPORTED;
} }
uint16_t hwFreeMem() uint16_t hwFreeMem()
{ {
// TODO: Not supported! // TODO: Not supported!
return 0; return FUNCTION_NOT_SUPPORTED;
} }
#endif
void hwDigitalWrite(uint8_t pin, uint8_t value) void hwDigitalWrite(uint8_t pin, uint8_t value)
{ {
@@ -142,13 +141,10 @@ void hwPinMode(uint8_t pin, uint8_t mode)
pinMode(pin, mode); pinMode(pin, mode);
} }
#ifdef MY_DEBUG
void hwDebugPrint(const char *fmt, ...) void hwDebugPrint(const char *fmt, ...)
{ {
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
vlogDebug(fmt, args); vlogDebug(fmt, args);
va_end(args); va_end(args);
} }
#endif
+2 -2
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2016 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors * Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
@@ -48,7 +48,7 @@ inline void hwDigitalWrite(uint8_t, uint8_t);
inline int hwDigitalRead(uint8_t); inline int hwDigitalRead(uint8_t);
inline void hwPinMode(uint8_t, uint8_t); inline void hwPinMode(uint8_t, uint8_t);
void hwInit(); bool hwInit(void);
inline void hwReadConfigBlock(void* buf, void* addr, size_t length); inline void hwReadConfigBlock(void* buf, void* addr, size_t length);
inline void hwWriteConfigBlock(void* buf, void* addr, size_t length); inline void hwWriteConfigBlock(void* buf, void* addr, size_t length);
inline uint8_t hwReadConfig(int addr); inline uint8_t hwReadConfig(int addr);
+20 -14
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
@@ -67,22 +67,29 @@ void hwWriteConfig(int adr, uint8_t value)
(void)eep.update(adr, value); (void)eep.update(adr, value);
} }
void hwInit() bool hwInit(void)
{ {
MY_SERIALDEVICE.begin(MY_BAUD_RATE); MY_SERIALDEVICE.begin(MY_BAUD_RATE);
#if defined(MY_GATEWAY_SERIAL) #if defined(MY_GATEWAY_SERIAL)
while (!MY_SERIALDEVICE) {} while (!MY_SERIALDEVICE) {}
#endif #endif
// ext. EEPROM on sensebender GW
eep.begin(MY_EXT_EEPROM_TWI_CLOCK); const uint8_t eepInit = eep.begin(MY_EXT_EEPROM_TWI_CLOCK);
#if defined(SENSEBENDER_GW_SAMD_V1)
// check connection to external EEPROM - only sensebender GW
return eepInit==0;
#else
(void)eepInit;
return true;
#endif
} }
void hwWatchdogReset() void hwWatchdogReset(void)
{ {
// TODO: Not supported! // TODO: Not supported!
} }
void hwReboot() void hwReboot(void)
{ {
NVIC_SystemReset(); NVIC_SystemReset();
while (true); while (true);
@@ -123,7 +130,6 @@ bool hwUniqueID(unique_id_t *uniqueID)
return true; return true;
} }
#if defined(MY_DEBUG) || defined(MY_SPECIAL_DEBUG)
uint16_t hwCPUVoltage() uint16_t hwCPUVoltage()
{ {
@@ -170,19 +176,22 @@ uint16_t hwCPUFrequency()
uint16_t hwFreeMem() uint16_t hwFreeMem()
{ {
// TODO: Not supported! // TODO: Not supported!
return 0; return FUNCTION_NOT_SUPPORTED;
} }
#endif
#ifdef MY_DEBUG
void hwDebugPrint(const char *fmt, ... ) void hwDebugPrint(const char *fmt, ... )
{ {
if (MY_SERIALDEVICE) { if (MY_SERIALDEVICE) {
char fmtBuffer[MY_SERIAL_OUTPUT_SIZE]; char fmtBuffer[MY_SERIAL_OUTPUT_SIZE];
#ifdef MY_GATEWAY_FEATURE #ifdef MY_GATEWAY_FEATURE
// prepend debug message to be handled correctly by controller (C_INTERNAL, I_LOG_MESSAGE) // prepend debug message to be handled correctly by controller (C_INTERNAL, I_LOG_MESSAGE)
snprintf(fmtBuffer, sizeof(fmtBuffer), PSTR("0;255;%d;0;%d;"), C_INTERNAL, I_LOG_MESSAGE); snprintf(fmtBuffer, sizeof(fmtBuffer), PSTR("0;255;%d;0;%d;%lu "), C_INTERNAL, I_LOG_MESSAGE,
hwMillis());
MY_SERIALDEVICE.print(fmtBuffer); MY_SERIALDEVICE.print(fmtBuffer);
#else
// prepend timestamp
MY_SERIALDEVICE.print(hwMillis());
MY_SERIALDEVICE.print(" ");
#endif #endif
va_list args; va_list args;
va_start (args, fmt ); va_start (args, fmt );
@@ -197,8 +206,5 @@ void hwDebugPrint(const char *fmt, ... )
va_end (args); va_end (args);
MY_SERIALDEVICE.print(fmtBuffer); MY_SERIALDEVICE.print(fmtBuffer);
// MY_SERIALDEVICE.flush(); // MY_SERIALDEVICE.flush();
//MY_SERIALDEVICE.write(freeRam());
} }
} }
#endif
+6 -6
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
@@ -28,10 +28,10 @@
#include <avr/dtostrf.h> #include <avr/dtostrf.h>
// defines for sensebender gw variant.h // defines for sensebender gw variant.h
#define MY_EXT_EEPROM_I2C_ADDRESS (0x50) #define MY_EXT_EEPROM_I2C_ADDRESS (0x50u)
#define MY_EXT_EEPROM_SIZE (kbits_512) #define MY_EXT_EEPROM_SIZE (kbits_512)
#define MY_EXT_EEPROM_PAGE_SIZE (32u) #define MY_EXT_EEPROM_PAGE_SIZE (32u)
#define MY_EXT_EEPROM_TWI_CLOCK (twiClock400kHz) #define MY_EXT_EEPROM_TWI_CLOCK (twiClock100kHz) // can be set to 400kHz with precaution if other i2c devices on bus
extEEPROM eep(MY_EXT_EEPROM_SIZE, 1, MY_EXT_EEPROM_PAGE_SIZE, extEEPROM eep(MY_EXT_EEPROM_SIZE, 1, MY_EXT_EEPROM_PAGE_SIZE,
MY_EXT_EEPROM_I2C_ADDRESS); //device size, number of devices, page size MY_EXT_EEPROM_I2C_ADDRESS); //device size, number of devices, page size
@@ -48,9 +48,9 @@ extEEPROM eep(MY_EXT_EEPROM_SIZE, 1, MY_EXT_EEPROM_PAGE_SIZE,
#define hwMillis() millis() #define hwMillis() millis()
#define hwRandomNumberInit() randomSeed(analogRead(MY_SIGNING_SOFT_RANDOMSEED_PIN)) #define hwRandomNumberInit() randomSeed(analogRead(MY_SIGNING_SOFT_RANDOMSEED_PIN))
void hwInit(); bool hwInit(void);
void hwWatchdogReset(); void hwWatchdogReset(void);
void hwReboot(); void hwReboot(void);
void hwReadConfigBlock(void* buf, void* adr, size_t length); void hwReadConfigBlock(void* buf, void* adr, size_t length);
void hwWriteConfigBlock(void* buf, void* adr, size_t length); void hwWriteConfigBlock(void* buf, void* adr, size_t length);
void hwWriteConfig(int adr, uint8_t value); void hwWriteConfig(int adr, uint8_t value);
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2016 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+2 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2016 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
@@ -47,6 +47,7 @@ typedef enum {
INDICATION_FW_UPDATE_RX_ERR, //!< Received wrong piece of firmware data. INDICATION_FW_UPDATE_RX_ERR, //!< Received wrong piece of firmware data.
INDICATION_ERR_START = 100, INDICATION_ERR_START = 100,
INDICATION_ERR_HW_INIT, //!< HW initialization error
INDICATION_ERR_TX, //!< Failed to transmit message. INDICATION_ERR_TX, //!< Failed to transmit message.
INDICATION_ERR_TRANSPORT_FAILURE, //!< Transport failure. INDICATION_ERR_TRANSPORT_FAILURE, //!< Transport failure.
INDICATION_ERR_INIT_TRANSPORT, //!< MySensors transport hardware (radio) init failure. INDICATION_ERR_INIT_TRANSPORT, //!< MySensors transport hardware (radio) init failure.
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2016 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2016 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+9 -2
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2016 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
@@ -88,7 +88,11 @@ void _begin(void)
preHwInit(); preHwInit();
} }
hwInit(); if (!hwInit()) {
CORE_DEBUG(PSTR("!MCO:BGN:HW ERR\n"));
setIndication(INDICATION_ERR_HW_INIT);
_infiniteLoop();
}
CORE_DEBUG(PSTR("MCO:BGN:INIT " MY_NODE_TYPE ",CP=" MY_CAPABILITIES ",VER=" CORE_DEBUG(PSTR("MCO:BGN:INIT " MY_NODE_TYPE ",CP=" MY_CAPABILITIES ",VER="
MYSENSORS_LIBRARY_VERSION "\n")); MYSENSORS_LIBRARY_VERSION "\n"));
@@ -687,3 +691,6 @@ void _checkNodeLock(void)
} }
#endif #endif
} }
#if DOXYGEN
#endif
+2
View File
@@ -39,6 +39,7 @@
* *
* |E| SYS | SUB | Message | Comment * |E| SYS | SUB | Message | Comment
* |-|-------|-------|-----------------------------------------------|---------------------------------------------------------------------------- * |-|-------|-------|-----------------------------------------------|----------------------------------------------------------------------------
* |!| MCO | BGN | HW ERR | Error HW initialization (e.g. ext. EEPROM)
* | | MCO | BGN | INIT %%s,CP=%%s,LIB=%%s | Core initialization, capabilities (CP), library version (VER) * | | MCO | BGN | INIT %%s,CP=%%s,LIB=%%s | Core initialization, capabilities (CP), library version (VER)
* | | MCO | BGN | BFR | Callback before() * | | MCO | BGN | BFR | Callback before()
* | | MCO | BGN | STP | Callback setup() * | | MCO | BGN | STP | Callback setup()
@@ -83,6 +84,7 @@
#define INTERRUPT_NOT_DEFINED ((uint8_t)255) //!< _sleep() param: no interrupt defined #define INTERRUPT_NOT_DEFINED ((uint8_t)255) //!< _sleep() param: no interrupt defined
#define MODE_NOT_DEFINED ((uint8_t)255) //!< _sleep() param: no mode defined #define MODE_NOT_DEFINED ((uint8_t)255) //!< _sleep() param: no mode defined
#define VALUE_NOT_DEFINED ((uint8_t)255) //!< Value not defined #define VALUE_NOT_DEFINED ((uint8_t)255) //!< Value not defined
#define FUNCTION_NOT_SUPPORTED ((uint16_t)0) //!< Function not supported
#ifdef MY_DEBUG #ifdef MY_DEBUG
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2016 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2016 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2016 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+1 -1
View File
@@ -6,7 +6,7 @@
* network topology allowing messages to be routed to nodes. * network topology allowing messages to be routed to nodes.
* *
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB * Copyright (C) 2013-2017 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
* *
* Documentation: http://www.mysensors.org * Documentation: http://www.mysensors.org
+7
View File
@@ -85,6 +85,13 @@ const uint8_t EEPROM_ADDR_ERR = 9;
class extEEPROM class extEEPROM
{ {
public: public:
/**
* @brief Constructor
* @param deviceCapacity
* @param nDevice
* @param pageSize
* @param eepromAddr
*/
extEEPROM(eeprom_size_t deviceCapacity, byte nDevice, unsigned int pageSize, extEEPROM(eeprom_size_t deviceCapacity, byte nDevice, unsigned int pageSize,
byte eepromAddr = 0x50); byte eepromAddr = 0x50);
byte begin(twiClockFreq_t twiFreq = twiClock100kHz); //!< begin() byte begin(twiClockFreq_t twiFreq = twiClock100kHz); //!< begin()