Skip to content

Commit 6a2a95f

Browse files
committed
Remove extras from low_power.ino and make retrieving led in led_ctrl public for use in low power
1 parent 9f8cc65 commit 6a2a95f

File tree

2 files changed

+7
-23
lines changed

2 files changed

+7
-23
lines changed
Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,7 @@
1-
#include <Arduino.h>
21
#include <led_ctrl.h>
32
#include <log.h>
43
#include <low_power.h>
54
#include <lte.h>
6-
#include <sequans_controller.h>
7-
8-
#ifdef __AVR_AVR128DB48__ // MINI
9-
10-
#define SerialDebug Serial3
11-
#define TIMING_PIN PIN_PE2
12-
#else
13-
#ifdef __AVR_AVR128DB64__ // Non-Mini
14-
15-
#define SerialDebug Serial5
16-
#define TIMING_PIN PIN_PE7
17-
18-
#else
19-
#error "INCOMPATIBLE_DEVICE_SELECTED"
20-
#endif
21-
#endif
225

236
void setup() {
247

@@ -41,15 +24,13 @@ void setup() {
4124
}
4225

4326
Log.info("Connected to operator!\r\n");
44-
45-
pinConfigure(TIMING_PIN, PIN_DIR_OUTPUT);
4627
}
4728

4829
void loop() {
4930

50-
digitalWrite(TIMING_PIN, digitalRead(TIMING_PIN) ? 0 : 1);
51-
5231
WakeUpReason wakeup_reason = LowPower.sleep();
5332
Log.infof("Got out of sleep with wake up reason %d, doing work...\r\n",
5433
wakeup_reason);
34+
35+
// Do work ...
5536
}

src/led_ctrl.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ class LedCtrlClass {
1616
*/
1717
LedCtrlClass(){};
1818

19-
uint8_t getLedPin(Led led);
20-
2119
public:
2220
/**
2321
* @brief Singleton instance.
@@ -35,6 +33,11 @@ class LedCtrlClass {
3533
*/
3634
void begin(const bool manual_control = false);
3735

36+
/**
37+
* @return The pin associated with the given LED.
38+
*/
39+
uint8_t getLedPin(Led led);
40+
3841
/**
3942
* @brief Toggle @p led.
4043
*

0 commit comments

Comments
 (0)