From 0a9351988faf56efbf90d0e3ab5c158718add591 Mon Sep 17 00:00:00 2001 From: Marcelo Aquino Date: Fri, 30 Sep 2016 17:04:40 -0300 Subject: [PATCH] Update configure script Add options to set status leds. Support controller ip address separated by dots. Fix controller url address option set. --- configure | 29 ++++++++++++++++++++++------- examples_linux/mysGateway.cpp | 6 +++--- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/configure b/configure index b2b2dc8..570edde 100755 --- a/configure +++ b/configure @@ -14,8 +14,8 @@ Help: Building options: --soc=[BCM2835|BCM2836|AM33XX|A10|A13|A20|H3] SoC type to be used. [configure autodetected] - --cpu-flags= CPU defining/optimizing flags to be used. [configure autodetected] - --extra-cxxflags= Extra C flags passed to C/C++ compilation. [] + --cpu-flags= CPU defining/optimizing flags to be used. [configure autodetected] + --extra-cxxflags= Extra C flags passed to C/C++ compilation. [] --extra-ldflags= Extra C flags passed to linking. [] --cxx_compiler= C++ compiler [arm-linux-gnueabihf-g++][g++] --no-clean Don't clean previous build artifacts. @@ -25,8 +25,7 @@ Installation options: --gateway-dir= Gateway files installation directory. [PREFIX/bin] MySensors options: - --my-debug=[enable|disable] - Enables or disables MySensors core debugging. [enable] + --my-debug=[enable|disable] Enables or disables MySensors core debugging. [enable] --my-config-file= Config file path. [/etc/mysensors.dat] --my-gateway=[none|ethernet|serial|mqtt] Gateway type, set to none to disable gateway feature. [ethernet] @@ -34,7 +33,6 @@ MySensors options: Controller or MQTT broker url. --my-controller-ip-address= Controller or MQTT broker ip. - Use commas instead of points. Example: 127,0,0,1 --my-port= The port to keep open on gateway mode. If gateway is set to mqtt, it sets the broker port. --my-serial-port= Serial port. [/dev/ttyACM0] @@ -56,6 +54,10 @@ MySensors options: --my-rf24-irq-pin= Pin number connected to nRF24L01 IRQ pin. --my-rx-message-buffer-size= Buffer size for incoming messages when using rf24 interrupts. [20] + --my-leds-err-pin= Error LED pin. + --my-leds-rx-pin= Receive LED pin. + --my-leds-tx-pin= Transmit LED pin. + --my-leds-blinking-inverse Inverse the blinking feature. EOF } @@ -263,10 +265,11 @@ for opt do CXXFLAGS="-DMY_RF24_PA_LEVEL=${optarg} $CXXFLAGS" ;; --my-controller-url-address=*) - CXXFLAGS="-DMY_CONTROLLER_URL_ADDRESS=${optarg} $CXXFLAGS" + CXXFLAGS="-DMY_CONTROLLER_URL_ADDRESS=\\\"${optarg}\\\" $CXXFLAGS" ;; --my-controller-ip-address=*) - CXXFLAGS="-DMY_CONTROLLER_IP_ADDRESS=${optarg} $CXXFLAGS" + controller_ip=`echo ${optarg//./,}` + CXXFLAGS="-DMY_CONTROLLER_IP_ADDRESS=${controller_ip} $CXXFLAGS" ;; --my-port=*) CXXFLAGS="-DMY_PORT=${optarg} $CXXFLAGS" @@ -286,6 +289,18 @@ for opt do --my-rx-message-buffer-size=*) CXXFLAGS="-DMY_RX_MESSAGE_BUFFER_SIZE=${optarg} $CXXFLAGS" ;; + --my-leds-err-pin=*) + CXXFLAGS="-DMY_DEFAULT_ERR_LED_PIN=${optarg} $CXXFLAGS" + ;; + --my-leds-rx-pin=*) + CXXFLAGS="-DMY_DEFAULT_RX_LED_PIN=${optarg} $CXXFLAGS" + ;; + --my-leds-tx-pin=*) + CXXFLAGS="-DMY_DEFAULT_TX_LED_PIN=${optarg} $CXXFLAGS" + ;; + --my-leds-blinking-inverse*) + CXXFLAGS="-DMY_WITH_LEDS_BLINKING_INVERSE $CXXFLAGS" + ;; *) echo "[WARNING] Unknown option detected:$opt, ignored" ;; diff --git a/examples_linux/mysGateway.cpp b/examples_linux/mysGateway.cpp index de508bc..c0c69c2 100644 --- a/examples_linux/mysGateway.cpp +++ b/examples_linux/mysGateway.cpp @@ -51,9 +51,9 @@ //#define MY_MQTT_PASSWORD "password" // Flash leds on rx/tx/err -//#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 +//#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 // Transmit LED pin // Inverse the blinking feature //#define MY_WITH_LEDS_BLINKING_INVERSE