From 6d47c33ad8b7475d08b25900435037de0a588c96 Mon Sep 17 00:00:00 2001 From: Marcelo Aquino Date: Sat, 24 Sep 2016 21:55:01 -0300 Subject: [PATCH] Add support for RX/TX/ERR leds to RPi --- MySensors.h | 5 +++++ examples_linux/mysGateway.cpp | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/MySensors.h b/MySensors.h index ad59f3f..39adeee 100644 --- a/MySensors.h +++ b/MySensors.h @@ -82,6 +82,11 @@ #define pgm_read_dword(x) (*x) #define pgm_read_byte_near(x) (*x) #include "core/MyHwLinuxGeneric.cpp" + // Ugly hack + #ifdef LINUX_ARCH_RASPBERRYPI + #undef hwDigitalWrite + #define hwDigitalWrite(__pin, __value) (digitalWrite(__pin, __value)) + #endif #endif // LEDS diff --git a/examples_linux/mysGateway.cpp b/examples_linux/mysGateway.cpp index 1d7c745..3c65327 100644 --- a/examples_linux/mysGateway.cpp +++ b/examples_linux/mysGateway.cpp @@ -50,6 +50,17 @@ //#define MY_MQTT_USER "username" //#define MY_MQTT_PASSWORD "password" +// Flash leds on rx/tx/err +//#define MY_LEDS_BLINKING_FEATURE +// Inverse the blinking feature +//#define MY_WITH_LEDS_BLINKING_INVERSE +// Set blinking period +//#define MY_DEFAULT_LED_BLINK_PERIOD 300 + +// Led pins used if blinking feature is enabled above +#define MY_DEFAULT_ERR_LED_PIN 12 // Error led pin +#define MY_DEFAULT_RX_LED_PIN 16 // Receive led pin +#define MY_DEFAULT_TX_LED_PIN 18 // the PCB, on board #include