Skip to content

Commit ffbab3b

Browse files
author
m19936
committed
Changed the LED Ctrl begin interface
1 parent a26c523 commit ffbab3b

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

src/led_ctrl.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525

2626
static bool manual_control_enabled = false;
2727

28-
void LedCtrlClass::begin(const bool manual_control) {
29-
manual_control_enabled = manual_control;
30-
28+
void LedCtrlClass::begin() {
3129
pinMode(LED_CELL_PIN, OUTPUT);
3230
pinMode(LED_CON_PIN, OUTPUT);
3331
pinMode(LED_DATA_PIN, OUTPUT);
@@ -41,6 +39,11 @@ void LedCtrlClass::begin(const bool manual_control) {
4139
this->off(Led::USER);
4240
}
4341

42+
void LedCtrlClass::beginManual() {
43+
manual_control_enabled = true;
44+
this->begin();
45+
}
46+
4447
uint8_t LedCtrlClass::getLedPin(Led led) {
4548
uint8_t targetPin = 0;
4649
switch (led) {

src/led_ctrl.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,15 @@ class LedCtrlClass {
3131
* @param manual_control Set to true if the system should *not* modify the
3232
* leds automatically (for example when the LTE modem is connected).
3333
*/
34-
void begin(const bool manual_control = false);
34+
void begin();
35+
36+
/**
37+
* @brief Start the LED control module in manual mode. In manual mode, the
38+
* system should *not* modify the LEDs automatically (for example when the
39+
* LTE modem is connected).
40+
*
41+
*/
42+
void beginManual();
3543

3644
/**
3745
* @return The pin associated with the given LED.

0 commit comments

Comments
 (0)