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

Commit 9547acb

Browse files
committed
Merge branch 'release/v1.3.1'
2 parents 6554bea + 97d968f commit 9547acb

File tree

8 files changed

+47
-39
lines changed

8 files changed

+47
-39
lines changed

.github/workflows/examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
fail-fast: false
99
matrix:
1010
os: [ubuntu-16.04, windows-latest, macos-latest]
11-
python-version: [2.7, 3.7]
11+
python-version: [3.7]
1212
example:
1313
- "examples/arduino-adc"
1414
- "examples/arduino-blink"

boards/cubecell_module.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"build": {
3+
"arduino": {
4+
"lorawan": {
5+
"rgb": "DEACTIVE"
6+
}
7+
},
38
"core": "asr650x",
49
"cpu": "cortex-m0plus",
510
"extra_flags": "-DCubeCell_Module",

boards/cubecell_module_plus.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"build": {
3+
"arduino": {
4+
"lorawan": {
5+
"rgb": "DEACTIVE"
6+
}
7+
},
38
"core": "asr650x",
49
"cpu": "cortex-m0plus",
510
"extra_flags": "-DCubeCell_ModulePlus",

boards/cubecell_node.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"build": {
3+
"arduino": {
4+
"lorawan": {
5+
"rgb": "DEACTIVE"
6+
}
7+
},
38
"core": "asr650x",
49
"cpu": "cortex-m0plus",
510
"extra_flags": "-DCubeCell_HalfAA",

builder/frameworks/arduino.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,16 @@
3838
env.Append(
3939
CPPDEFINES=[
4040
("ARDUINO", 10813),
41-
"__ASR6501__",
41+
"ARDUINO_ARCH_ASR650X",
42+
"__%s__" % board.get("build.mcu").upper(),
43+
"__asr650x__",
4244
("CONFIG_MANUFACTURER", '\\"ASR\\"'),
4345
("CONFIG_DEVICE_MODEL", '\\"6501\\"'),
4446
("CONFIG_VERSION", '\\"v4.0\\"'),
4547
("CY_CORE_ID", 0),
46-
"CONFIG_LORA_USE_TCXO"
48+
"CONFIG_LORA_USE_TCXO",
49+
("F_CPU", "$BOARD_F_CPU"),
50+
"SOFT_SE",
4751
],
4852

4953
CCFLAGS=[
@@ -55,6 +59,7 @@
5559
"-mthumb-interwork",
5660
"-mapcs-frame",
5761
"-ffunction-sections",
62+
"-fdata-sections",
5863
"-ffat-lto-objects",
5964
"-fno-common",
6065
"-fno-builtin-printf",
@@ -77,7 +82,6 @@
7782
"-Wl,--wrap=fflush",
7883
"-Wl,--wrap=sprintf",
7984
"-Wl,--wrap=snprintf",
80-
"-Wl,-Map,pio.map",
8185
"-mthumb",
8286
"-mthumb-interwork",
8387
"-specs=nano.specs",
@@ -89,12 +93,11 @@
8993
os.path.join(FRAMEWORK_DIR, "cores", core, "board"),
9094
os.path.join(FRAMEWORK_DIR, "cores", core, "board", "src"),
9195
os.path.join(FRAMEWORK_DIR, "cores", core, "board", "inc"),
92-
os.path.join(FRAMEWORK_DIR, "cores", core, "device", "asr6501_lrwan"),
9396
os.path.join(FRAMEWORK_DIR, "cores", core, "device", "sx126x"),
94-
os.path.join(FRAMEWORK_DIR, "cores", core, "loramac", "mac"),
95-
os.path.join(FRAMEWORK_DIR, "cores", core, "loramac", "mac", "region"),
96-
os.path.join(FRAMEWORK_DIR, "cores", core, "loramac", "system"),
97-
os.path.join(FRAMEWORK_DIR, "cores", core, "loramac", "system", "crypto"),
97+
os.path.join(FRAMEWORK_DIR, "cores", core, "lora"),
98+
os.path.join(FRAMEWORK_DIR, "cores", core, "lora", "radio"),
99+
os.path.join(FRAMEWORK_DIR, "cores", core, "lora", "system"),
100+
os.path.join(FRAMEWORK_DIR, "cores", core, "lora", "system", "crypto"),
98101
os.path.join(FRAMEWORK_DIR, "cores", core, "port"),
99102
os.path.join(FRAMEWORK_DIR, "cores", core, "port", "include"),
100103
os.path.join(FRAMEWORK_DIR, "cores", core, "projects"),
@@ -136,7 +139,7 @@
136139
#
137140

138141
lorawan_config = board.get("build.arduino.lorawan", {})
139-
region = lorawan_config.get("region", "AS923")
142+
region = lorawan_config.get("region", "US915")
140143
debug_level = lorawan_config.get("debug_level", "NONE")
141144

142145
env.Append(
@@ -152,6 +155,7 @@
152155
("LORAWAN_NET_RESERVE", "true" if lorawan_config.get(
153156
"net_reserve", "OFF") == "ON" else "false"),
154157
("AT_SUPPORT", 1 if lorawan_config.get("at_support", "ON") == "ON" else 0),
158+
("LORAWAN_DEVEUI_AUTO", 0 if lorawan_config.get("deveui", "CUSTOM") == "CUSTOM" else 1),
155159
("LoraWan_RGB", 1 if lorawan_config.get(
156160
"rgb", "ACTIVE") == "ACTIVE" else 0),
157161
("LoRaWAN_DEBUG_LEVEL", 2 if debug_level == "FREQ_AND_DIO" else (
@@ -181,11 +185,11 @@
181185

182186
libs.append(env.BuildLibrary(
183187
os.path.join("$BUILD_DIR", "FrameworkArduino"),
184-
os.path.join(FRAMEWORK_DIR, "cores"),
188+
os.path.join(FRAMEWORK_DIR, "cores", core),
185189
src_filter=[
186190
"+<*>",
187-
"-<%s/projects/PSoC4/CyBootAsmIar.s>" % core,
188-
"-<%s/projects/PSoC4/CyBootAsmRv.s>" % core
191+
"-<projects/PSoC4/CyBootAsmIar.s>",
192+
"-<projects/PSoC4/CyBootAsmRv.s>"
189193
]
190194
))
191195

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:

platform.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"type": "git",
2323
"url": "https://github.com/HelTecAutomation/platform-asrmicro650x.git"
2424
},
25-
"version": "1.2.1",
25+
"version": "1.3.1",
2626
"frameworks": {
2727
"arduino": {
2828
"package": "framework-arduinoasrmicro650x",
@@ -38,7 +38,7 @@
3838
"framework-arduinoasrmicro650x": {
3939
"type": "framework",
4040
"owner": "heltecautomation",
41-
"version": "~1.2.0",
41+
"version": "~1.3.0",
4242
"optional": true
4343
},
4444
"tool-cubecellelftool": {

0 commit comments

Comments
 (0)