MCPcopy Create free account
hub / github.com/dalathegreat/Battery-Emulator / led_init

Function led_init

Software/src/devboard/utils/led_handler.cpp:26–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26bool led_init(void) {
27 gpio_num_t led_pin = esp32hal->LED_PIN();
28
29 if (led_pin == GPIO_NUM_NC) {
30 return true;
31 }
32
33 if (!esp32hal->alloc_pins("LED", led_pin)) {
34 DEBUG_PRINTF("LED setup failed\n");
35 return false;
36 }
37
38 led = new LED(datalayer.battery.status.led_mode, led_pin, esp32hal->LED_MAX_BRIGHTNESS());
39
40 return true;
41}
42
43void led_exe(void) {
44 if (led == nullptr) {

Callers 1

setupFunction · 0.85

Calls 3

alloc_pinsMethod · 0.80
LED_PINMethod · 0.45
LED_MAX_BRIGHTNESSMethod · 0.45

Tested by

no test coverage detected