From 2f50e865c2cdc9191451703c80f6ba1212563f52 Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Thu, 13 Apr 2017 13:32:23 +0200 Subject: [PATCH] AP_Notify: example fix travis warning missing function declaration implicit cast some style fix --- .../AP_Notify_test/AP_Notify_test.cpp | 3 +++ .../ToshibaLED_test/ToshibaLED_test.cpp | 23 +++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/libraries/AP_Notify/examples/AP_Notify_test/AP_Notify_test.cpp b/libraries/AP_Notify/examples/AP_Notify_test/AP_Notify_test.cpp index 6aad2c72c9..6412bd0326 100644 --- a/libraries/AP_Notify/examples/AP_Notify_test/AP_Notify_test.cpp +++ b/libraries/AP_Notify/examples/AP_Notify_test/AP_Notify_test.cpp @@ -7,6 +7,9 @@ #include // Notify library #include // Board LED library +void setup(); +void loop(); + const AP_HAL::HAL& hal = AP_HAL::get_HAL(); // create board led object diff --git a/libraries/AP_Notify/examples/ToshibaLED_test/ToshibaLED_test.cpp b/libraries/AP_Notify/examples/ToshibaLED_test/ToshibaLED_test.cpp index 31fec8bd48..2de522d7e2 100644 --- a/libraries/AP_Notify/examples/ToshibaLED_test/ToshibaLED_test.cpp +++ b/libraries/AP_Notify/examples/ToshibaLED_test/ToshibaLED_test.cpp @@ -2,6 +2,11 @@ #include #include +void setup(); +void loop(); +void full_spectrum(); +void blink(); + const AP_HAL::HAL& hal = AP_HAL::get_HAL(); static ToshibaLED_I2C toshiba_led; @@ -49,10 +54,10 @@ void loop(void) void full_spectrum() { // go through the full range of colours but only up to the dim light level - for (uint8_t red=0; red<=0x05; red++) { - for (uint8_t green=0; green<=0x05; green++) { - for (uint8_t blue=0; blue<=0x05; blue++) { - toshiba_led.set_rgb(red,green,blue); + for (uint8_t red = 0; red <= 0x05; red++) { + for (uint8_t green = 0; green <= 0x05; green++) { + for (uint8_t blue = 0; blue <= 0x05; blue++) { + toshiba_led.set_rgb(red, green, blue); hal.scheduler->delay(5); } } @@ -65,16 +70,16 @@ void full_spectrum() void blink() { // set colour to red - toshiba_led.set_rgb(LED_DIM,0,0); + toshiba_led.set_rgb(LED_DIM, 0, 0); // full spectrum test for (uint8_t c=0; c<=2; c++ ) { - if (c==0) { - toshiba_led.set_rgb(LED_DIM,0,0); // red + if (c == 0) { + toshiba_led.set_rgb(LED_DIM, 0, 0); // red }else if (c==1) { - toshiba_led.set_rgb(0,LED_DIM,0); // green + toshiba_led.set_rgb(0, LED_DIM, 0); // green }else{ - toshiba_led.set_rgb(0,0,LED_DIM); // blue + toshiba_led.set_rgb(0, 0, LED_DIM); // blue } } }