From ac8f0dc78822b97ab03d7c7f6c154a0270b57e6b Mon Sep 17 00:00:00 2001 From: Jason Becht Date: Tue, 12 Feb 2013 19:27:32 -0600 Subject: [PATCH 1/2] update to sensornet to work with IDE > 1.0.1 --- examples/sensornet/S_message.cpp | 2 +- examples/sensornet/nodeconfig.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/sensornet/S_message.cpp b/examples/sensornet/S_message.cpp index 81a450f..f75bfb9 100644 --- a/examples/sensornet/S_message.cpp +++ b/examples/sensornet/S_message.cpp @@ -13,7 +13,7 @@ #include "RF24Network_config.h" // Project headers // This component's header -#include +#include "S_message.h" char S_message::buffer[32]; diff --git a/examples/sensornet/nodeconfig.cpp b/examples/sensornet/nodeconfig.cpp index 0cb66c2..dd9fd94 100644 --- a/examples/sensornet/nodeconfig.cpp +++ b/examples/sensornet/nodeconfig.cpp @@ -34,10 +34,10 @@ const eeprom_info_t& nodeconfig_read(void) else { printf_P(PSTR("*** No valid address found. Send node address via serial of the form 011\n\r")); - while(1) - { +// while(1) +// { nodeconfig_listen(); - } +// } } return eeprom_info; @@ -71,7 +71,7 @@ void nodeconfig_listen(void) eeprom_info.relay = true; printf_P(PSTR("ROLE: %S\n\r"),eeprom_info.relay ? PSTR("Relay") : PSTR("Leaf") ); if ( eeprom_info.flag == valid_eeprom_flag ) - eeprom_update_block(&eeprom_info,address_at_eeprom_location,sizeof(eeprom_info)); + eeprom_write_block(&eeprom_info,address_at_eeprom_location,sizeof(eeprom_info)); else printf_P(PSTR("Please assign an address to commit this role to EEPROM\r\n")); } @@ -80,7 +80,7 @@ void nodeconfig_listen(void) eeprom_info.relay = false; printf_P(PSTR("ROLE: %S\n\r"),eeprom_info.relay ? PSTR("Relay") : PSTR("Leaf") ); if ( eeprom_info.flag == valid_eeprom_flag ) - eeprom_update_block(&eeprom_info,address_at_eeprom_location,sizeof(eeprom_info)); + eeprom_write_block(&eeprom_info,address_at_eeprom_location,sizeof(eeprom_info)); else printf_P(PSTR("Please assign an address to commit this role to EEPROM\r\n")); } @@ -98,7 +98,7 @@ void nodeconfig_listen(void) // It is our address eeprom_info.flag = valid_eeprom_flag; eeprom_info.address = address; - eeprom_update_block(&eeprom_info,address_at_eeprom_location,sizeof(eeprom_info)); + eeprom_write_block(&eeprom_info,address_at_eeprom_location,sizeof(eeprom_info)); // And we are done right now (no easy way to soft reset) printf_P(PSTR("\n\rManually set to address 0%o\n\rPress RESET to continue!"),address); From c86e737211163709a5fa7d72c94dc3ddc579599f Mon Sep 17 00:00:00 2001 From: Jason Becht Date: Tue, 12 Feb 2013 19:35:38 -0600 Subject: [PATCH 2/2] update to sensornet to work with IDE > 1.0.1 including 1.5.2 --- examples/sensornet/nodeconfig.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/sensornet/nodeconfig.cpp b/examples/sensornet/nodeconfig.cpp index dd9fd94..d631d07 100644 --- a/examples/sensornet/nodeconfig.cpp +++ b/examples/sensornet/nodeconfig.cpp @@ -34,10 +34,10 @@ const eeprom_info_t& nodeconfig_read(void) else { printf_P(PSTR("*** No valid address found. Send node address via serial of the form 011\n\r")); -// while(1) -// { + while(1) + { nodeconfig_listen(); -// } + } } return eeprom_info;