mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
xiao c3: migrated to esm, added missing roles, cleanup
This commit is contained in:
parent
da52d08168
commit
4dc3dda2d8
4 changed files with 61 additions and 23 deletions
|
|
@ -3,11 +3,6 @@
|
||||||
#include <helpers/ESP32Board.h>
|
#include <helpers/ESP32Board.h>
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
// LoRa radio module pins for custom Seeduino XiaoC3 build
|
|
||||||
// #define P_LORA_SCLK D8
|
|
||||||
// #define P_LORA_MISO D9
|
|
||||||
// #define P_LORA_MOSI D10
|
|
||||||
|
|
||||||
#include <driver/rtc_io.h>
|
#include <driver/rtc_io.h>
|
||||||
#include <driver/uart.h>
|
#include <driver/uart.h>
|
||||||
|
|
||||||
|
|
@ -3,6 +3,8 @@ extends = esp32_base
|
||||||
board = seeed_xiao_esp32c3
|
board = seeed_xiao_esp32c3
|
||||||
build_flags =
|
build_flags =
|
||||||
${esp32_base.build_flags}
|
${esp32_base.build_flags}
|
||||||
|
${sensor_base.build_flags}
|
||||||
|
-UENV_INCLUDE_GPS
|
||||||
-I variants/xiao_c3
|
-I variants/xiao_c3
|
||||||
-D ESP32_CPU_FREQ=80
|
-D ESP32_CPU_FREQ=80
|
||||||
-D PIN_VBAT_READ=D0
|
-D PIN_VBAT_READ=D0
|
||||||
|
|
@ -12,23 +14,27 @@ build_flags =
|
||||||
-D P_LORA_BUSY=D3
|
-D P_LORA_BUSY=D3
|
||||||
-D PIN_BOARD_SDA=D6
|
-D PIN_BOARD_SDA=D6
|
||||||
-D PIN_BOARD_SCL=D7
|
-D PIN_BOARD_SCL=D7
|
||||||
|
-D RADIO_CLASS=CustomSX1262
|
||||||
|
-D WRAPPER_CLASS=CustomSX1262Wrapper
|
||||||
|
-D SX126X_RX_BOOSTED_GAIN=1
|
||||||
|
-D LORA_TX_POWER=22
|
||||||
-D SX126X_RXEN=D5
|
-D SX126X_RXEN=D5
|
||||||
-D SX126X_DIO2_AS_RF_SWITCH=true
|
-D SX126X_DIO2_AS_RF_SWITCH=true
|
||||||
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
|
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
|
||||||
-D SX126X_CURRENT_LIMIT=140
|
-D SX126X_CURRENT_LIMIT=140
|
||||||
build_src_filter = ${esp32_base.build_src_filter}
|
build_src_filter = ${esp32_base.build_src_filter}
|
||||||
+<../variants/xiao_c3>
|
+<../variants/xiao_c3>
|
||||||
|
+<helpers/sensors>
|
||||||
|
lib_deps =
|
||||||
|
${esp32_base.lib_deps}
|
||||||
|
${sensor_base.lib_deps}
|
||||||
|
|
||||||
[env:Xiao_C3_sx1262_repeater]
|
[env:Xiao_C3_repeater]
|
||||||
extends = Xiao_esp32_C3
|
extends = Xiao_esp32_C3
|
||||||
build_src_filter = ${Xiao_esp32_C3.build_src_filter}
|
build_src_filter = ${Xiao_esp32_C3.build_src_filter}
|
||||||
+<../examples/simple_repeater/*.cpp>
|
+<../examples/simple_repeater/*.cpp>
|
||||||
build_flags =
|
build_flags =
|
||||||
${Xiao_esp32_C3.build_flags}
|
${Xiao_esp32_C3.build_flags}
|
||||||
-D RADIO_CLASS=CustomSX1262
|
|
||||||
-D WRAPPER_CLASS=CustomSX1262Wrapper
|
|
||||||
-D SX126X_RX_BOOSTED_GAIN=1
|
|
||||||
-D LORA_TX_POWER=22
|
|
||||||
-D ADVERT_NAME='"Xiao C3 Repeater"'
|
-D ADVERT_NAME='"Xiao C3 Repeater"'
|
||||||
-D ADVERT_LAT=0.0
|
-D ADVERT_LAT=0.0
|
||||||
-D ADVERT_LON=0.0
|
-D ADVERT_LON=0.0
|
||||||
|
|
@ -41,6 +47,24 @@ lib_deps =
|
||||||
${esp32_ota.lib_deps}
|
${esp32_ota.lib_deps}
|
||||||
bakercp/CRC32 @ ^2.0.0
|
bakercp/CRC32 @ ^2.0.0
|
||||||
|
|
||||||
|
[env:Xiao_C3_room_server]
|
||||||
|
extends = Xiao_esp32_C3
|
||||||
|
build_src_filter = ${Xiao_esp32_C3.build_src_filter}
|
||||||
|
+<../examples/simple_room_server/*.cpp>
|
||||||
|
build_flags =
|
||||||
|
${Xiao_esp32_C3.build_flags}
|
||||||
|
-D ADVERT_NAME='"Xiao C3 Room"'
|
||||||
|
-D ADVERT_LAT=0.0
|
||||||
|
-D ADVERT_LON=0.0
|
||||||
|
-D ADMIN_PASSWORD='"password"'
|
||||||
|
-D ROOM_PASSWORD='"hello"'
|
||||||
|
; -D MESH_PACKET_LOGGING=1
|
||||||
|
; -D MESH_DEBUG=1
|
||||||
|
lib_deps =
|
||||||
|
${Xiao_esp32_C3.lib_deps}
|
||||||
|
${esp32_ota.lib_deps}
|
||||||
|
bakercp/CRC32 @ ^2.0.0
|
||||||
|
|
||||||
[env:Xiao_C3_companion_radio_ble]
|
[env:Xiao_C3_companion_radio_ble]
|
||||||
extends = Xiao_esp32_C3
|
extends = Xiao_esp32_C3
|
||||||
build_src_filter = ${Xiao_esp32_C3.build_src_filter}
|
build_src_filter = ${Xiao_esp32_C3.build_src_filter}
|
||||||
|
|
@ -48,10 +72,6 @@ build_src_filter = ${Xiao_esp32_C3.build_src_filter}
|
||||||
+<helpers/esp32/*.cpp>
|
+<helpers/esp32/*.cpp>
|
||||||
build_flags =
|
build_flags =
|
||||||
${Xiao_esp32_C3.build_flags}
|
${Xiao_esp32_C3.build_flags}
|
||||||
-D RADIO_CLASS=CustomSX1262
|
|
||||||
-D WRAPPER_CLASS=CustomSX1262Wrapper
|
|
||||||
-D SX126X_RX_BOOSTED_GAIN=1
|
|
||||||
-D LORA_TX_POWER=22
|
|
||||||
-D MAX_CONTACTS=300
|
-D MAX_CONTACTS=300
|
||||||
-D MAX_GROUP_CHANNELS=8
|
-D MAX_GROUP_CHANNELS=8
|
||||||
-D BLE_PIN_CODE=123456
|
-D BLE_PIN_CODE=123456
|
||||||
|
|
@ -71,10 +91,6 @@ build_src_filter = ${Xiao_esp32_C3.build_src_filter}
|
||||||
+<helpers/esp32/*.cpp>
|
+<helpers/esp32/*.cpp>
|
||||||
build_flags =
|
build_flags =
|
||||||
${Xiao_esp32_C3.build_flags}
|
${Xiao_esp32_C3.build_flags}
|
||||||
-D RADIO_CLASS=CustomSX1262
|
|
||||||
-D WRAPPER_CLASS=CustomSX1262Wrapper
|
|
||||||
-D SX126X_RX_BOOSTED_GAIN=1
|
|
||||||
-D LORA_TX_POWER=22
|
|
||||||
-D MAX_CONTACTS=300
|
-D MAX_CONTACTS=300
|
||||||
-D MAX_GROUP_CHANNELS=8
|
-D MAX_GROUP_CHANNELS=8
|
||||||
-D OFFLINE_QUEUE_SIZE=256
|
-D OFFLINE_QUEUE_SIZE=256
|
||||||
|
|
@ -85,3 +101,24 @@ lib_deps =
|
||||||
${Xiao_esp32_C3.lib_deps}
|
${Xiao_esp32_C3.lib_deps}
|
||||||
${esp32_ota.lib_deps}
|
${esp32_ota.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
|
|
||||||
|
[env:Xiao_C3_companion_radio_wifi]
|
||||||
|
extends = Xiao_esp32_C3
|
||||||
|
build_src_filter = ${Xiao_esp32_C3.build_src_filter}
|
||||||
|
+<../examples/companion_radio/*.cpp>
|
||||||
|
+<helpers/esp32/*.cpp>
|
||||||
|
build_flags =
|
||||||
|
${Xiao_esp32_C3.build_flags}
|
||||||
|
-D MAX_CONTACTS=300
|
||||||
|
-D MAX_GROUP_CHANNELS=8
|
||||||
|
-D OFFLINE_QUEUE_SIZE=256
|
||||||
|
-D WIFI_DEBUG_LOGGING=1
|
||||||
|
-D WIFI_SSID='"myssid"'
|
||||||
|
-D WIFI_PWD='"mypwd"'
|
||||||
|
; -D BLE_DEBUG_LOGGING=1
|
||||||
|
; -D MESH_PACKET_LOGGING=1
|
||||||
|
; -D MESH_DEBUG=1
|
||||||
|
lib_deps =
|
||||||
|
${Xiao_esp32_C3.lib_deps}
|
||||||
|
${esp32_ota.lib_deps}
|
||||||
|
densaugeo/base64 @ ~1.4.0
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,14 @@ WRAPPER_CLASS radio_driver(radio, board);
|
||||||
|
|
||||||
ESP32RTCClock fallback_clock;
|
ESP32RTCClock fallback_clock;
|
||||||
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||||
SensorManager sensors;
|
|
||||||
|
#if ENV_INCLUDE_GPS
|
||||||
|
#include <helpers/sensors/MicroNMEALocationProvider.h>
|
||||||
|
MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1);
|
||||||
|
EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea);
|
||||||
|
#else
|
||||||
|
EnvironmentSensorManager sensors;
|
||||||
|
#endif
|
||||||
|
|
||||||
bool radio_init() {
|
bool radio_init() {
|
||||||
fallback_clock.begin();
|
fallback_clock.begin();
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,15 @@
|
||||||
#define RADIOLIB_STATIC_ONLY 1
|
#define RADIOLIB_STATIC_ONLY 1
|
||||||
#include <RadioLib.h>
|
#include <RadioLib.h>
|
||||||
#include <helpers/radiolib/RadioLibWrappers.h>
|
#include <helpers/radiolib/RadioLibWrappers.h>
|
||||||
#include <helpers/XiaoC3Board.h>
|
#include <XiaoC3Board.h>
|
||||||
#include <helpers/radiolib/CustomSX1262Wrapper.h>
|
#include <helpers/radiolib/CustomSX1262Wrapper.h>
|
||||||
#include <helpers/radiolib/CustomSX1268Wrapper.h>
|
|
||||||
#include <helpers/AutoDiscoverRTCClock.h>
|
#include <helpers/AutoDiscoverRTCClock.h>
|
||||||
#include <helpers/SensorManager.h>
|
#include <helpers/sensors/EnvironmentSensorManager.h>
|
||||||
|
|
||||||
extern XiaoC3Board board;
|
extern XiaoC3Board board;
|
||||||
extern WRAPPER_CLASS radio_driver;
|
extern WRAPPER_CLASS radio_driver;
|
||||||
extern AutoDiscoverRTCClock rtc_clock;
|
extern AutoDiscoverRTCClock rtc_clock;
|
||||||
extern SensorManager sensors;
|
extern EnvironmentSensorManager sensors;
|
||||||
|
|
||||||
bool radio_init();
|
bool radio_init();
|
||||||
uint32_t radio_get_rng_seed();
|
uint32_t radio_get_rng_seed();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue