From 616b7d8b09e83aacf8821814765576204d85eaa7 Mon Sep 17 00:00:00 2001 From: "Bruce B. Lacey" Date: Sat, 11 Jul 2015 09:09:14 -0700 Subject: [PATCH 1/2] Changed the extended_fuses from 0xFE to 0x06 (set unused bits 3-7 to 0 instead of F) to improve compatibility with a broader range of programmers (e.g. ATMEL Dragon and USBTiny ISP v3). --- hardware/MySensors/avr/boards.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware/MySensors/avr/boards.txt b/hardware/MySensors/avr/boards.txt index 2a3c638..7fc0ec8 100644 --- a/hardware/MySensors/avr/boards.txt +++ b/hardware/MySensors/avr/boards.txt @@ -16,7 +16,7 @@ MysensorsMicro.bootloader.unlock_bits=0x3F MysensorsMicro.bootloader.lock_bits=0x0F MysensorsMicro.bootloader.low_fuses=0xE2 MysensorsMicro.bootloader.high_fuses=0xD2 -MysensorsMicro.bootloader.extended_fuses=0xFE +MysensorsMicro.bootloader.extended_fuses=0x06 MysensorsMicro.bootloader.file=DualOptiboot/optiboot_atmega328_pro_8MHz.hex MysensorsMicro.build.board=AVR_MICRO8 From 4abaa6ded34d22e3f3dd98d33d3d12450a537706 Mon Sep 17 00:00:00 2001 From: "Bruce B. Lacey" Date: Sat, 11 Jul 2015 09:31:30 -0700 Subject: [PATCH 2/2] Changed WITH_LEDS_BLINKING option to use the default LED pins as described on http://www.mysensors.org/build/advanced_gateway for consistency and backwards compatibility. Also corrected the LED on/off state to HIGH/LOW from LOW/HIGH respectively. --- libraries/MySensors/MyConfig.h | 6 +++--- libraries/MySensors/MySensor.cpp | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libraries/MySensors/MyConfig.h b/libraries/MySensors/MyConfig.h index c2148ab..11c8af1 100644 --- a/libraries/MySensors/MyConfig.h +++ b/libraries/MySensors/MyConfig.h @@ -58,11 +58,11 @@ // default LEDs blinking period in milliseconds #define DEFAULT_LED_BLINK_PERIOD 300 // The RX LED default pin -#define DEFAULT_RX_LED_PIN 8 +#define DEFAULT_RX_LED_PIN 6 // The TX LED default pin -#define DEFAULT_TX_LED_PIN 9 +#define DEFAULT_TX_LED_PIN 5 // The Error LED default pin -#define DEFAULT_ERR_LED_PIN 7 +#define DEFAULT_ERR_LED_PIN 4 /********************************** diff --git a/libraries/MySensors/MySensor.cpp b/libraries/MySensors/MySensor.cpp index 2e2d70e..c32e44b 100644 --- a/libraries/MySensors/MySensor.cpp +++ b/libraries/MySensors/MySensor.cpp @@ -110,33 +110,33 @@ void MySensor::handleLedsBlinking() { // do the actual blinking if(countRx && countRx != 255) { // switch led on - digitalWrite(pinRx, LOW); + digitalWrite(pinRx, HIGH); } else if(!countRx) { // switching off - digitalWrite(pinRx, HIGH); + digitalWrite(pinRx, LOW); } if(countRx != 255) --countRx; if(countTx && countTx != 255) { // switch led on - digitalWrite(pinTx, LOW); + digitalWrite(pinTx, HIGH); } else if(!countTx) { // switching off - digitalWrite(pinTx, HIGH); + digitalWrite(pinTx, LOW); } if(countTx != 255) --countTx; if(countErr && countErr != 255) { // switch led on - digitalWrite(pinEr, LOW); + digitalWrite(pinEr, HIGH); } else if(!countErr) { // switching off - digitalWrite(pinEr, HIGH); + digitalWrite(pinEr, LOW); } if(countErr != 255) --countErr; @@ -182,9 +182,9 @@ void MySensor::begin(void (*_msgCallback)(const MyMessage &), uint8_t _nodeId, b pinMode(pinEr, OUTPUT); // Set initial state of leds - digitalWrite(pinRx, HIGH); - digitalWrite(pinTx, HIGH); - digitalWrite(pinEr, HIGH); + digitalWrite(pinRx, LOW); + digitalWrite(pinTx, LOW); + digitalWrite(pinEr, LOW); // initialize counters countRx = 0;