-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #432 from alistair23/alistair/lora-example
lora: Support RISC-V build, update to latest libtock-c and move to examples
- Loading branch information
Showing
19 changed files
with
159 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
LIBNAME := RadioLib | ||
|
||
TOCK_USERLAND_BASE_DIR ?= .. | ||
|
||
$(LIBNAME)_DIR := $(TOCK_USERLAND_BASE_DIR)/$(LIBNAME) | ||
|
||
# We ideally want this: | ||
# $(LIBNAME)_SRCS := \ | ||
# $($(LIBNAME)_DIR)/$(LIBNAME)/src/Module.cpp \ | ||
# $(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/*.cpp) \ | ||
# $(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/*/*.cpp) \ | ||
# $(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/*/*/*.cpp) | ||
# | ||
# But due to this in the GCC arm binary in the CI: | ||
# | ||
# ``` | ||
# (insn 179 178 46 8 (set (reg:SI 3 r3 [168]) | ||
# (mem/u/c:SI (plus:SI (reg:SI 12 ip [169]) | ||
# (unspec:SI [ | ||
# (symbol_ref/u:SI ("*.LC1") [flags 0x2]) | ||
# ] UNSPEC_PIC_SYM)) [0 S4 A32])) "../../../RadioLib/src/modules/LR11x0/LR11x0.cpp":638:16 929 {*thumb1_movsi_insn} | ||
# (expr_list:REG_EQUAL (symbol_ref/u:SI ("*.LC1") [flags 0x2]) | ||
# (nil))) | ||
# during RTL pass: postreload | ||
# ../../../RadioLib/src/modules/LR11x0/LR11x0.cpp:650:1: internal compiler error: in extract_constrain_insn, at recog.c:2195 | ||
# ``` | ||
# | ||
# we need to drop LR11x0 | ||
$(LIBNAME)_SRCS := \ | ||
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/*.cpp) \ | ||
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/utils/*.cpp) \ | ||
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/modules/C*/.cpp) \ | ||
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/modules/LL*/*.cpp) \ | ||
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/modules/RF*/*.cpp) \ | ||
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/modules/S*/*.cpp) \ | ||
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/modules/n*/*.cpp) \ | ||
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/protocols/*/*.cpp) \ | ||
|
||
include $(TOCK_USERLAND_BASE_DIR)/TockLibrary.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Include the core RadioLib headers | ||
override CPPFLAGS += -I$(TOCK_USERLAND_BASE_DIR)/RadioLib/RadioLib/src | ||
|
||
# Include the Tock specific headers | ||
override CPPFLAGS += -I$(TOCK_USERLAND_BASE_DIR)/RadioLib/RadioLib/examples/NonArduino/Tock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.PHONY: clean | ||
|
||
TOCK_USERLAND_BASE_DIR ?= ../ | ||
|
||
|
||
all: $(TOCK_USERLAND_BASE_DIR)/RadioLib/RadioLib/README.md | ||
|
||
clean:: | ||
rm -rf build | ||
|
||
# confirm RadioLib git submodule is checked out. | ||
$(TOCK_USERLAND_BASE_DIR)/RadioLib/RadioLib/README.md: | ||
git submodule update --init -- $(TOCK_USERLAND_BASE_DIR)/RadioLib/RadioLib | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Makefile for user application | ||
|
||
# Specify this directory relative to the current application. | ||
TOCK_USERLAND_BASE_DIR = ../../.. | ||
|
||
# Which files to compile. | ||
CXX_SRCS := $(wildcard *.cc) | ||
|
||
# Use the libtock-c Make system | ||
EXTERN_LIBS += $(TOCK_USERLAND_BASE_DIR)/RadioLib | ||
|
||
include $(TOCK_USERLAND_BASE_DIR)/AppMakefile.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Sensor Receive | ||
============== | ||
|
||
This example builds an application to receiver sensor data. | ||
|
||
## Example Output | ||
|
||
The output should look something like this. | ||
|
||
Note that if the receive example is started before the transmit you will get | ||
-6 errors (RX_TIMEOUT) like below, as there is nothing to receive. | ||
|
||
``` | ||
Apollo3 chip revision: B | ||
Initialization complete. Entering main loop | ||
[SX1261] Initialising Radio ... | ||
success! | ||
[SX1261] Receiving... | ||
failed, code -6 | ||
failed, code -6 | ||
failed, code -6 | ||
failed, code -6 | ||
failed, code -6 | ||
failed, code -6 | ||
failed, code -6 | ||
failed, code -6 | ||
failed, code -6 | ||
failed, code -6 | ||
failed, code -6 | ||
failed, code -6 | ||
success!: Temp: 24047, Hum: 5966 | ||
success!: Temp: 24047, Hum: 5966 | ||
success!: Temp: 24047, Hum: 5966 | ||
success!: Temp: 24047, Hum: 5966 | ||
success!: Temp: 24047, Hum: 5966 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Makefile for user application | ||
|
||
# Specify this directory relative to the current application. | ||
TOCK_USERLAND_BASE_DIR = ../../.. | ||
|
||
# Which files to compile. | ||
CXX_SRCS := $(wildcard *.cc) | ||
|
||
# Use the libtock-c Make system | ||
EXTERN_LIBS += $(TOCK_USERLAND_BASE_DIR)/RadioLib | ||
|
||
include $(TOCK_USERLAND_BASE_DIR)/AppMakefile.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Sensor Transmitter | ||
================== | ||
|
||
This example builds an application to transmit sensor data. | ||
|
||
## Example Output | ||
|
||
The output should look something like this | ||
|
||
``` | ||
Apollo3 chip revision: B | ||
Initialization complete. Entering main loop | ||
[SX1261] Initialising Radio ... | ||
success! | ||
[SX1261] Transmitting 'Temp: 24047, Hum: 5966' | ||
success! | ||
[SX1261] Transmitting 'Temp: 24047, Hum: 5966' | ||
success! | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule RadioLib
deleted from
0ef554
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.