REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches
front_panel_signaling.cpp
Go to the documentation of this file.
1#include <Arduino.h>
2
3#include "lucidac/front_panel_signaling.h"
4#include "lucidac/lucidac.h"
5
6FLASHMEM void leds::set(uint8_t val) {
7 auto &carrier_ = platform::LUCIDAC::get();
8 if (carrier_.front_panel) {
9 carrier_.front_panel->set_leds(val);
10 carrier_.front_panel->write_to_hardware();
11 }
12}
13
14FLASHMEM void leds::indicate_error() {
15 size_t num_blinks = 6;
16 for (size_t i = 0; i < num_blinks; i++) {
17 leds::set(0x55);
18 delay(100);
19 leds::set(0xaa);
20 delay(100);
21 }
22 leds::set(0);
23}
24
25FLASHMEM void leds::ease_out() {
26 int val = 0xFF;
27 for (uint8_t i = 0; i < 8; i++) {
28 val /= 2;
29 leds::set(val);
30 delay(100);
31 }
32}
auto & carrier_