MCPcopy Create free account
hub / github.com/ArduPilot/ArduRemoteID / update

Method update

RemoteIDModule/led.cpp:22–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22void Led::update(void)
23{
24 init();
25
26 const uint32_t now_ms = millis();
27
28#ifdef PIN_STATUS_LED
29 switch (state) {
30 case LedState::ARM_OK: {
31 digitalWrite(PIN_STATUS_LED, STATUS_LED_OK);
32 last_led_trig_ms = now_ms;
33 break;
34 }
35
36 default:
37 if (now_ms - last_led_trig_ms > 100) {
38 digitalWrite(PIN_STATUS_LED, !digitalRead(PIN_STATUS_LED));
39 last_led_trig_ms = now_ms;
40 }
41 break;
42 }
43#endif
44
45#ifdef WS2812_LED_PIN
46 ledStrip.clear();
47
48 switch (state) {
49 case LedState::ARM_OK:
50 ledStrip.setPixelColor(0, ledStrip.Color(0, 255, 0));
51 ledStrip.setPixelColor(0, ledStrip.Color(1, 255, 0)); //for db210pro, set the second LED to have the same output (for now)
52 break;
53
54 default:
55 ledStrip.setPixelColor(0, ledStrip.Color(255, 0, 0));
56 ledStrip.setPixelColor(1, ledStrip.Color(255, 0, 0)); //for db210pro, set the second LED to have the same output (for now)
57 break;
58 }
59 if (now_ms - last_led_strip_ms >= 200) {
60 last_led_strip_ms = now_ms;
61 ledStrip.show();
62 }
63#endif
64}
65

Callers 5

crypto_sign_updateFunction · 0.45
crypto_check_updateFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected