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

Commit

Permalink
Merge branch 'release/v1.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
valeros committed Jul 1, 2021
2 parents 6554bea + 97d968f commit 9547acb
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-16.04, windows-latest, macos-latest]
python-version: [2.7, 3.7]
python-version: [3.7]
example:
- "examples/arduino-adc"
- "examples/arduino-blink"
Expand Down
5 changes: 5 additions & 0 deletions boards/cubecell_module.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"build": {
"arduino": {
"lorawan": {
"rgb": "DEACTIVE"
}
},
"core": "asr650x",
"cpu": "cortex-m0plus",
"extra_flags": "-DCubeCell_Module",
Expand Down
5 changes: 5 additions & 0 deletions boards/cubecell_module_plus.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"build": {
"arduino": {
"lorawan": {
"rgb": "DEACTIVE"
}
},
"core": "asr650x",
"cpu": "cortex-m0plus",
"extra_flags": "-DCubeCell_ModulePlus",
Expand Down
5 changes: 5 additions & 0 deletions boards/cubecell_node.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"build": {
"arduino": {
"lorawan": {
"rgb": "DEACTIVE"
}
},
"core": "asr650x",
"cpu": "cortex-m0plus",
"extra_flags": "-DCubeCell_HalfAA",
Expand Down
28 changes: 16 additions & 12 deletions builder/frameworks/arduino.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,16 @@
env.Append(
CPPDEFINES=[
("ARDUINO", 10813),
"__ASR6501__",
"ARDUINO_ARCH_ASR650X",
"__%s__" % board.get("build.mcu").upper(),
"__asr650x__",
("CONFIG_MANUFACTURER", '\\"ASR\\"'),
("CONFIG_DEVICE_MODEL", '\\"6501\\"'),
("CONFIG_VERSION", '\\"v4.0\\"'),
("CY_CORE_ID", 0),
"CONFIG_LORA_USE_TCXO"
"CONFIG_LORA_USE_TCXO",
("F_CPU", "$BOARD_F_CPU"),
"SOFT_SE",
],

CCFLAGS=[
Expand All @@ -55,6 +59,7 @@
"-mthumb-interwork",
"-mapcs-frame",
"-ffunction-sections",
"-fdata-sections",
"-ffat-lto-objects",
"-fno-common",
"-fno-builtin-printf",
Expand All @@ -77,7 +82,6 @@
"-Wl,--wrap=fflush",
"-Wl,--wrap=sprintf",
"-Wl,--wrap=snprintf",
"-Wl,-Map,pio.map",
"-mthumb",
"-mthumb-interwork",
"-specs=nano.specs",
Expand All @@ -89,12 +93,11 @@
os.path.join(FRAMEWORK_DIR, "cores", core, "board"),
os.path.join(FRAMEWORK_DIR, "cores", core, "board", "src"),
os.path.join(FRAMEWORK_DIR, "cores", core, "board", "inc"),
os.path.join(FRAMEWORK_DIR, "cores", core, "device", "asr6501_lrwan"),
os.path.join(FRAMEWORK_DIR, "cores", core, "device", "sx126x"),
os.path.join(FRAMEWORK_DIR, "cores", core, "loramac", "mac"),
os.path.join(FRAMEWORK_DIR, "cores", core, "loramac", "mac", "region"),
os.path.join(FRAMEWORK_DIR, "cores", core, "loramac", "system"),
os.path.join(FRAMEWORK_DIR, "cores", core, "loramac", "system", "crypto"),
os.path.join(FRAMEWORK_DIR, "cores", core, "lora"),
os.path.join(FRAMEWORK_DIR, "cores", core, "lora", "radio"),
os.path.join(FRAMEWORK_DIR, "cores", core, "lora", "system"),
os.path.join(FRAMEWORK_DIR, "cores", core, "lora", "system", "crypto"),
os.path.join(FRAMEWORK_DIR, "cores", core, "port"),
os.path.join(FRAMEWORK_DIR, "cores", core, "port", "include"),
os.path.join(FRAMEWORK_DIR, "cores", core, "projects"),
Expand Down Expand Up @@ -136,7 +139,7 @@
#

lorawan_config = board.get("build.arduino.lorawan", {})
region = lorawan_config.get("region", "AS923")
region = lorawan_config.get("region", "US915")
debug_level = lorawan_config.get("debug_level", "NONE")

env.Append(
Expand All @@ -152,6 +155,7 @@
("LORAWAN_NET_RESERVE", "true" if lorawan_config.get(
"net_reserve", "OFF") == "ON" else "false"),
("AT_SUPPORT", 1 if lorawan_config.get("at_support", "ON") == "ON" else 0),
("LORAWAN_DEVEUI_AUTO", 0 if lorawan_config.get("deveui", "CUSTOM") == "CUSTOM" else 1),
("LoraWan_RGB", 1 if lorawan_config.get(
"rgb", "ACTIVE") == "ACTIVE" else 0),
("LoRaWAN_DEBUG_LEVEL", 2 if debug_level == "FREQ_AND_DIO" else (
Expand Down Expand Up @@ -181,11 +185,11 @@

libs.append(env.BuildLibrary(
os.path.join("$BUILD_DIR", "FrameworkArduino"),
os.path.join(FRAMEWORK_DIR, "cores"),
os.path.join(FRAMEWORK_DIR, "cores", core),
src_filter=[
"+<*>",
"-<%s/projects/PSoC4/CyBootAsmIar.s>" % core,
"-<%s/projects/PSoC4/CyBootAsmRv.s>" % core
"-<projects/PSoC4/CyBootAsmIar.s>",
"-<projects/PSoC4/CyBootAsmRv.s>"
]
))

Expand Down
17 changes: 4 additions & 13 deletions examples/arduino-lowpower/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,28 @@
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html

[env:cubecell_board]
[env]
platform = asrmicro650x
framework = arduino
lib_ldf_mode = deep

[env:cubecell_board]
board = cubecell_board

[env:cubecell_board_plus]
platform = asrmicro650x
framework = arduino
board = cubecell_board_plus

[env:cubecell_capsule]
platform = asrmicro650x
framework = arduino
board = cubecell_capsule

[env:cubecell_gps]
platform = asrmicro650x
framework = arduino
board = cubecell_gps

[env:cubecell_module]
platform = asrmicro650x
framework = arduino
board = cubecell_module

[env:cubecell_module_plus]
platform = asrmicro650x
framework = arduino
board = cubecell_module_plus

[env:cubecell_node]
platform = asrmicro650x
framework = arduino
board = cubecell_node
20 changes: 9 additions & 11 deletions examples/arduino-lowpower/src/LowPower_WakeUpByTimer.ino
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
#include "Arduino.h"
#include "LoRa_APP.h"


#define timetosleep 5000
#define timetowake 5000
#define timetillsleep 5000
#define timetillwakeup 5000
static TimerEvent_t sleep;
static TimerEvent_t wakeUp;
uint8_t lowpower=1;

void onSleep()
{
Serial.printf("into lowpower mode, %d ms later wake up.\r\n",timetowake);
Serial.printf("Going into lowpower mode, %d ms later wake up.\r\n",timetillwakeup);
lowpower=1;
//timetosleep ms later wake up;
TimerSetValue( &wakeUp, timetowake );
//timetillwakeup ms later wake up;
TimerSetValue( &wakeUp, timetillwakeup );
TimerStart( &wakeUp );
}
void onWakeUp()
{
Serial.printf("wake up, %d ms later into lowpower mode.\r\n",timetosleep);
Serial.printf("Woke up, %d ms later into lowpower mode.\r\n",timetillsleep);
lowpower=0;
//timetosleep ms later into lowpower mode;
TimerSetValue( &sleep, timetosleep );
//timetillsleep ms later into lowpower mode;
TimerSetValue( &sleep, timetillsleep );
TimerStart( &sleep );
}

void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
boardInitMcu();
Radio.Sleep( );
TimerInit( &sleep, onSleep );
TimerInit( &wakeUp, onWakeUp );
Expand All @@ -36,7 +35,6 @@ void setup() {

void loop() {
if(lowpower){
//note that lowPowerHandler() run six times the mcu into lowpower mode;
lowPowerHandler();
}
// put your main code here, to run repeatedly:
Expand Down
4 changes: 2 additions & 2 deletions platform.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"type": "git",
"url": "https://github.com/HelTecAutomation/platform-asrmicro650x.git"
},
"version": "1.2.1",
"version": "1.3.1",
"frameworks": {
"arduino": {
"package": "framework-arduinoasrmicro650x",
Expand All @@ -38,7 +38,7 @@
"framework-arduinoasrmicro650x": {
"type": "framework",
"owner": "heltecautomation",
"version": "~1.2.0",
"version": "~1.3.0",
"optional": true
},
"tool-cubecellelftool": {
Expand Down

0 comments on commit 9547acb

Please sign in to comment.