mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_Periph: adjust for updated LED API
This commit is contained in:
parent
e582432a2f
commit
d83f380521
@ -153,7 +153,7 @@ static void update_rainbow()
|
|||||||
uint32_t now = AP_HAL::millis();
|
uint32_t now = AP_HAL::millis();
|
||||||
if (now-start_ms > 1500) {
|
if (now-start_ms > 1500) {
|
||||||
rainbow_done = true;
|
rainbow_done = true;
|
||||||
hal.rcout->set_neopixel_rgb_data(HAL_PERIPH_NEOPIXEL_CHAN, 0xFF, 0, 0, 0);
|
hal.rcout->set_neopixel_rgb_data(HAL_PERIPH_NEOPIXEL_CHAN, -1, 0, 0, 0);
|
||||||
hal.rcout->neopixel_send();
|
hal.rcout->neopixel_send();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -182,7 +182,7 @@ static void update_rainbow()
|
|||||||
float brightness = 0.3;
|
float brightness = 0.3;
|
||||||
for (uint8_t n=0; n<8; n++) {
|
for (uint8_t n=0; n<8; n++) {
|
||||||
uint8_t i = (step + n) % nsteps;
|
uint8_t i = (step + n) % nsteps;
|
||||||
hal.rcout->set_neopixel_rgb_data(HAL_PERIPH_NEOPIXEL_CHAN, 1U<<n,
|
hal.rcout->set_neopixel_rgb_data(HAL_PERIPH_NEOPIXEL_CHAN, n,
|
||||||
rgb_rainbow[i].red*brightness,
|
rgb_rainbow[i].red*brightness,
|
||||||
rgb_rainbow[i].green*brightness,
|
rgb_rainbow[i].green*brightness,
|
||||||
rgb_rainbow[i].blue*brightness);
|
rgb_rainbow[i].blue*brightness);
|
||||||
|
@ -506,8 +506,7 @@ static void handle_RTCMStream(CanardInstance* ins, CanardRxTransfer* transfer)
|
|||||||
static void set_rgb_led(uint8_t red, uint8_t green, uint8_t blue)
|
static void set_rgb_led(uint8_t red, uint8_t green, uint8_t blue)
|
||||||
{
|
{
|
||||||
#ifdef HAL_PERIPH_NEOPIXEL_COUNT
|
#ifdef HAL_PERIPH_NEOPIXEL_COUNT
|
||||||
hal.rcout->set_neopixel_rgb_data(HAL_PERIPH_NEOPIXEL_CHAN, (1U<<HAL_PERIPH_NEOPIXEL_COUNT)-1,
|
hal.rcout->set_neopixel_rgb_data(HAL_PERIPH_NEOPIXEL_CHAN, -1, red, green, blue);
|
||||||
red, green, blue);
|
|
||||||
hal.rcout->neopixel_send();
|
hal.rcout->neopixel_send();
|
||||||
#endif // HAL_PERIPH_NEOPIXEL_COUNT
|
#endif // HAL_PERIPH_NEOPIXEL_COUNT
|
||||||
#ifdef HAL_PERIPH_ENABLE_NCP5623_LED
|
#ifdef HAL_PERIPH_ENABLE_NCP5623_LED
|
||||||
|
Loading…
Reference in New Issue
Block a user