Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 3baa0d0

Browse files
committed
Sync LoRa example
1 parent 213ccad commit 3baa0d0

File tree

2 files changed

+13
-24
lines changed

2 files changed

+13
-24
lines changed

examples/arduino-lowpower/platformio.ini

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,28 @@
77
; Please visit documentation for the other options and examples
88
; http://docs.platformio.org/page/projectconf.html
99

10-
[env:cubecell_board]
10+
[env]
1111
platform = asrmicro650x
1212
framework = arduino
13+
lib_ldf_mode = deep
14+
15+
[env:cubecell_board]
1316
board = cubecell_board
1417

1518
[env:cubecell_board_plus]
16-
platform = asrmicro650x
17-
framework = arduino
1819
board = cubecell_board_plus
1920

2021
[env:cubecell_capsule]
21-
platform = asrmicro650x
22-
framework = arduino
2322
board = cubecell_capsule
2423

2524
[env:cubecell_gps]
26-
platform = asrmicro650x
27-
framework = arduino
2825
board = cubecell_gps
2926

3027
[env:cubecell_module]
31-
platform = asrmicro650x
32-
framework = arduino
3328
board = cubecell_module
3429

3530
[env:cubecell_module_plus]
36-
platform = asrmicro650x
37-
framework = arduino
3831
board = cubecell_module_plus
3932

4033
[env:cubecell_node]
41-
platform = asrmicro650x
42-
framework = arduino
4334
board = cubecell_node

examples/arduino-lowpower/src/LowPower_WakeUpByTimer.ino

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
11
#include "Arduino.h"
2+
#include "LoRa_APP.h"
23

3-
4-
#define timetosleep 5000
5-
#define timetowake 5000
4+
#define timetillsleep 5000
5+
#define timetillwakeup 5000
66
static TimerEvent_t sleep;
77
static TimerEvent_t wakeUp;
88
uint8_t lowpower=1;
99

1010
void onSleep()
1111
{
12-
Serial.printf("into lowpower mode, %d ms later wake up.\r\n",timetowake);
12+
Serial.printf("Going into lowpower mode, %d ms later wake up.\r\n",timetillwakeup);
1313
lowpower=1;
14-
//timetosleep ms later wake up;
15-
TimerSetValue( &wakeUp, timetowake );
14+
//timetillwakeup ms later wake up;
15+
TimerSetValue( &wakeUp, timetillwakeup );
1616
TimerStart( &wakeUp );
1717
}
1818
void onWakeUp()
1919
{
20-
Serial.printf("wake up, %d ms later into lowpower mode.\r\n",timetosleep);
20+
Serial.printf("Woke up, %d ms later into lowpower mode.\r\n",timetillsleep);
2121
lowpower=0;
22-
//timetosleep ms later into lowpower mode;
23-
TimerSetValue( &sleep, timetosleep );
22+
//timetillsleep ms later into lowpower mode;
23+
TimerSetValue( &sleep, timetillsleep );
2424
TimerStart( &sleep );
2525
}
2626

2727
void setup() {
2828
// put your setup code here, to run once:
2929
Serial.begin(115200);
30-
boardInitMcu();
3130
Radio.Sleep( );
3231
TimerInit( &sleep, onSleep );
3332
TimerInit( &wakeUp, onWakeUp );
@@ -36,7 +35,6 @@ void setup() {
3635

3736
void loop() {
3837
if(lowpower){
39-
//note that lowPowerHandler() run six times the mcu into lowpower mode;
4038
lowPowerHandler();
4139
}
4240
// put your main code here, to run repeatedly:

0 commit comments

Comments
 (0)