Browse Source

AP_Notify: Change on / off of LED to ternary operator.

mission-4.1.18
murata 8 years ago committed by Tom Pittenger
parent
commit
13ad06e652
  1. 9
      libraries/AP_Notify/AP_BoardLED.cpp

9
libraries/AP_Notify/AP_BoardLED.cpp

@ -53,13 +53,8 @@ void AP_BoardLED::update(void) @@ -53,13 +53,8 @@ void AP_BoardLED::update(void)
// initialising
if (AP_Notify::flags.initialising) {
// blink LEDs A and C at 8Hz (full cycle) during initialisation
if (counter2 & 1) {
hal.gpio->write(HAL_GPIO_A_LED_PIN, HAL_GPIO_LED_ON);
hal.gpio->write(HAL_GPIO_C_LED_PIN, HAL_GPIO_LED_OFF);
} else {
hal.gpio->write(HAL_GPIO_A_LED_PIN, HAL_GPIO_LED_OFF);
hal.gpio->write(HAL_GPIO_C_LED_PIN, HAL_GPIO_LED_ON);
}
hal.gpio->write(HAL_GPIO_A_LED_PIN, (counter2 & 1) ? HAL_GPIO_LED_ON : HAL_GPIO_LED_OFF);
hal.gpio->write(HAL_GPIO_C_LED_PIN, (counter2 & 1) ? HAL_GPIO_LED_OFF : HAL_GPIO_LED_ON);
return;
}

Loading…
Cancel
Save