From deb5fe51871666073a4e4dbb6de391612df38e4b Mon Sep 17 00:00:00 2001 From: Marco Bauer Date: Wed, 23 Jan 2013 15:29:24 +0100 Subject: [PATCH 1/3] timing changed and amber for manual added --- Makefile | 3 ++- apps/drivers/blinkm/blinkm.cpp | 42 +++++++++++++++++++++++++++------- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index f91e75d0b6..84086347f5 100644 --- a/Makefile +++ b/Makefile @@ -116,7 +116,8 @@ ifeq ($(SYSTYPE),Linux) SERIAL_PORTS ?= "/dev/ttyACM5,/dev/ttyACM4,/dev/ttyACM3,/dev/ttyACM2,/dev/ttyACM1,/dev/ttyACM0" endif ifeq ($(SERIAL_PORTS),) -SERIAL_PORTS = "\\\\.\\COM32,\\\\.\\COM31,\\\\.\\COM30,\\\\.\\COM29,\\\\.\\COM28,\\\\.\\COM27,\\\\.\\COM26,\\\\.\\COM25,\\\\.\\COM24,\\\\.\\COM23,\\\\.\\COM22,\\\\.\\COM21,\\\\.\\COM20,\\\\.\\COM19,\\\\.\\COM18,\\\\.\\COM17,\\\\.\\COM16,\\\\.\\COM15,\\\\.\\COM14,\\\\.\\COM13,\\\\.\\COM12,\\\\.\\COM11,\\\\.\\COM10,\\\\.\\COM9,\\\\.\\COM8,\\\\.\\COM7,\\\\.\\COM6,\\\\.\\COM5,\\\\.\\COM4,\\\\.\\COM3,\\\\.\\COM2,\\\\.\\COM1,\\\\.\\COM0" +#SERIAL_PORTS = "\\\\.\\COM32,\\\\.\\COM31,\\\\.\\COM30,\\\\.\\COM29,\\\\.\\COM28,\\\\.\\COM27,\\\\.\\COM26,\\\\.\\COM25,\\\\.\\COM24,\\\\.\\COM23,\\\\.\\COM22,\\\\.\\COM21,\\\\.\\COM20,\\\\.\\COM19,\\\\.\\COM18,\\\\.\\COM17,\\\\.\\COM16,\\\\.\\COM15,\\\\.\\COM14,\\\\.\\COM13,\\\\.\\COM12,\\\\.\\COM11,\\\\.\\COM10,\\\\.\\COM9,\\\\.\\COM8,\\\\.\\COM7,\\\\.\\COM6,\\\\.\\COM5,\\\\.\\COM4,\\\\.\\COM3,\\\\.\\COM2,\\\\.\\COM1,\\\\.\\COM0" +SERIAL_PORTS = "\\\\.\\COM3,\\\\.\\COM2,\\\\.\\COM1,\\\\.\\COM0" endif upload: $(FIRMWARE_BUNDLE) $(UPLOADER) diff --git a/apps/drivers/blinkm/blinkm.cpp b/apps/drivers/blinkm/blinkm.cpp index aeee80905a..2ff59d5f3f 100644 --- a/apps/drivers/blinkm/blinkm.cpp +++ b/apps/drivers/blinkm/blinkm.cpp @@ -118,8 +118,8 @@ #include static const float MAX_CELL_VOLTAGE = 4.3f; -static const int LED_ONTIME = 100; -static const int LED_OFFTIME = 100; +static const int LED_ONTIME = 120; +static const int LED_OFFTIME = 120; static const int LED_BLINK = 1; static const int LED_NOBLINK = 0; @@ -167,7 +167,8 @@ private: LED_PURPLE, LED_GREEN, LED_BLUE, - LED_WHITE + LED_WHITE, + LED_AMBER }; work_s _work; @@ -178,6 +179,8 @@ private: int led_color_4; int led_color_5; int led_color_6; + int led_color_7; + int led_color_8; int led_blink; bool systemstate_run; @@ -250,6 +253,8 @@ BlinkM::BlinkM(int bus) : led_color_4(LED_OFF), led_color_5(LED_OFF), led_color_6(LED_OFF), + led_color_7(LED_OFF), + led_color_8(LED_OFF), led_blink(LED_NOBLINK), systemstate_run(false) { @@ -374,7 +379,7 @@ BlinkM::led() static int num_of_cells = 0; static int detected_cells_runcount = 0; - static int t_led_color[6] = { 0, 0, 0, 0, 0, 0}; + static int t_led_color[8] = { 0, 0, 0, 0, 0, 0, 0, 0}; static int t_led_blink = 0; static int led_thread_runcount=0; static int led_interval = 1000; @@ -416,6 +421,8 @@ BlinkM::led() t_led_color[4] = LED_PURPLE; } t_led_color[5] = LED_OFF; + t_led_color[6] = LED_OFF; + t_led_color[7] = LED_OFF; t_led_blink = LED_BLINK; } else { t_led_color[0] = led_color_1; @@ -424,6 +431,8 @@ BlinkM::led() t_led_color[3] = led_color_4; t_led_color[4] = led_color_5; t_led_color[5] = led_color_6; + t_led_color[6] = led_color_7; + t_led_color[7] = led_color_8; t_led_blink = led_blink; } led_thread_ready = false; @@ -434,16 +443,19 @@ BlinkM::led() setLEDColor(LED_OFF); led_interval = LED_OFFTIME; } else { - setLEDColor(t_led_color[(led_thread_runcount / 2) % 6]); + setLEDColor(t_led_color[(led_thread_runcount / 2) % 8]); //led_interval = (led_thread_runcount & 1) : LED_ONTIME; led_interval = LED_ONTIME; } - if (led_thread_runcount == 11) { + if (led_thread_runcount == 15) { /* obtained data for the first file descriptor */ struct vehicle_status_s vehicle_status_raw; struct vehicle_gps_position_s vehicle_gps_position_raw; + memset(&vehicle_status_raw, 0, sizeof(vehicle_status_raw)); + memset(&vehicle_gps_position_raw, 0, sizeof(vehicle_gps_position_raw)); + bool new_data_vehicle_status; bool new_data_vehicle_gps_position; @@ -473,7 +485,8 @@ BlinkM::led() /* get number of used satellites in navigation */ num_of_used_sats = 0; - for(int satloop=0; satloop<20; satloop++) { + //for(int satloop=0; satloop<20; satloop++) { + for(int satloop=0; satloop Date: Wed, 23 Jan 2013 15:29:46 +0100 Subject: [PATCH 2/3] timing changed and amber for manual added --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 84086347f5..f91e75d0b6 100644 --- a/Makefile +++ b/Makefile @@ -116,8 +116,7 @@ ifeq ($(SYSTYPE),Linux) SERIAL_PORTS ?= "/dev/ttyACM5,/dev/ttyACM4,/dev/ttyACM3,/dev/ttyACM2,/dev/ttyACM1,/dev/ttyACM0" endif ifeq ($(SERIAL_PORTS),) -#SERIAL_PORTS = "\\\\.\\COM32,\\\\.\\COM31,\\\\.\\COM30,\\\\.\\COM29,\\\\.\\COM28,\\\\.\\COM27,\\\\.\\COM26,\\\\.\\COM25,\\\\.\\COM24,\\\\.\\COM23,\\\\.\\COM22,\\\\.\\COM21,\\\\.\\COM20,\\\\.\\COM19,\\\\.\\COM18,\\\\.\\COM17,\\\\.\\COM16,\\\\.\\COM15,\\\\.\\COM14,\\\\.\\COM13,\\\\.\\COM12,\\\\.\\COM11,\\\\.\\COM10,\\\\.\\COM9,\\\\.\\COM8,\\\\.\\COM7,\\\\.\\COM6,\\\\.\\COM5,\\\\.\\COM4,\\\\.\\COM3,\\\\.\\COM2,\\\\.\\COM1,\\\\.\\COM0" -SERIAL_PORTS = "\\\\.\\COM3,\\\\.\\COM2,\\\\.\\COM1,\\\\.\\COM0" +SERIAL_PORTS = "\\\\.\\COM32,\\\\.\\COM31,\\\\.\\COM30,\\\\.\\COM29,\\\\.\\COM28,\\\\.\\COM27,\\\\.\\COM26,\\\\.\\COM25,\\\\.\\COM24,\\\\.\\COM23,\\\\.\\COM22,\\\\.\\COM21,\\\\.\\COM20,\\\\.\\COM19,\\\\.\\COM18,\\\\.\\COM17,\\\\.\\COM16,\\\\.\\COM15,\\\\.\\COM14,\\\\.\\COM13,\\\\.\\COM12,\\\\.\\COM11,\\\\.\\COM10,\\\\.\\COM9,\\\\.\\COM8,\\\\.\\COM7,\\\\.\\COM6,\\\\.\\COM5,\\\\.\\COM4,\\\\.\\COM3,\\\\.\\COM2,\\\\.\\COM1,\\\\.\\COM0" endif upload: $(FIRMWARE_BUNDLE) $(UPLOADER) From efd4250e84980453276f167e6d0ed5f594a37c76 Mon Sep 17 00:00:00 2001 From: Marco Bauer Date: Wed, 23 Jan 2013 15:38:38 +0100 Subject: [PATCH 3/3] timing changed and amber for manual added --- apps/drivers/blinkm/blinkm.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/drivers/blinkm/blinkm.cpp b/apps/drivers/blinkm/blinkm.cpp index 2ff59d5f3f..bc5c74de1f 100644 --- a/apps/drivers/blinkm/blinkm.cpp +++ b/apps/drivers/blinkm/blinkm.cpp @@ -57,7 +57,7 @@ * System armed: * One message is made of 4 Blinks and a pause in the same length as the 4 blinks. * - * X-X-X-X-_-_-_-_- + * X-X-X-X-_-_-_-_-_-_- * ------------------------- * G G G M * P P P O @@ -67,26 +67,26 @@ * (X = on, _=off) * * The first 3 blinks indicates the status of the GPS-Signal (red): - * 0-4 satellites = X-X-X-X-_-_-_-_- - * 5 satellites = X-X-_-X-_-_-_-_- - * 6 satellites = X-_-_-X-_-_-_-_- - * >=7 satellites = _-_-_-X-_-_-_-_- + * 0-4 satellites = X-X-X-X-_-_-_-_-_-_- + * 5 satellites = X-X-_-X-_-_-_-_-_-_- + * 6 satellites = X-_-_-X-_-_-_-_-_-_- + * >=7 satellites = _-_-_-X-_-_-_-_-_-_- * If no GPS is found the first 3 blinks are white * * The fourth Blink indicates the Flightmode: - * MANUAL : off + * MANUAL : amber * STABILIZED : yellow * HOLD : blue * AUTO : green * * Battery Warning (low Battery Level): - * Continuously blinking in yellow X-X-X-X-X-X-X-X + * Continuously blinking in yellow X-X-X-X-X-X-X-X-X-X * * Battery Alert (critical Battery Level) - * Continuously blinking in red X-X-X-X-X-X-X-X + * Continuously blinking in red X-X-X-X-X-X-X-X-X-X * * General Error (no uOrb Data) - * Continuously blinking in white X-X-X-X-X-X-X-X + * Continuously blinking in white X-X-X-X-X-X-X-X-X-X * */