Skip to content

Commit 3dd6dc0

Browse files
committed
xiao_s3: use environment sensor manager and add sensor role
1 parent 8dbb0f5 commit 3dd6dc0

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

variants/xiao_s3_wio/platformio.ini

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ board = seeed_xiao_esp32s3
44
board_check = true
55
board_build.mcu = esp32s3
66
build_flags = ${esp32_base.build_flags}
7+
${sensor_base.build_flags}
78
-I variants/xiao_s3_wio
9+
-UENV_INCLUDE_GPS
810
-D SEEED_XIAO_S3
911
-D P_LORA_DIO_1=39
1012
-D P_LORA_NSS=41
@@ -15,6 +17,8 @@ build_flags = ${esp32_base.build_flags}
1517
-D P_LORA_MOSI=9
1618
-D PIN_USER_BTN=21
1719
-D PIN_STATUS_LED=48
20+
-D PIN_BOARD_SDA=D4
21+
-D PIN_BOARD_SCL=D5
1822
-D SX126X_RXEN=38
1923
-D SX126X_TXEN=RADIOLIB_NC
2024
-D SX126X_DIO2_AS_RF_SWITCH=true
@@ -26,6 +30,10 @@ build_flags = ${esp32_base.build_flags}
2630
-D SX126X_RX_BOOSTED_GAIN=1
2731
build_src_filter = ${esp32_base.build_src_filter}
2832
+<../variants/xiao_s3_wio>
33+
+<helpers/sensors>
34+
lib_deps =
35+
${esp32_base.lib_deps}
36+
${sensor_base.lib_deps}
2937

3038
[env:Xiao_S3_WIO_repeater]
3139
extends = Xiao_S3_WIO
@@ -185,3 +193,19 @@ lib_deps =
185193
${Xiao_S3_WIO.lib_deps}
186194
densaugeo/base64 @ ~1.4.0
187195
adafruit/Adafruit SSD1306 @ ^2.5.13
196+
197+
[env:Xiao_S3_WIO_sensor]
198+
extends = Xiao_S3_WIO
199+
build_src_filter = ${Xiao_S3_WIO.build_src_filter}
200+
+<../examples/simple_sensor>
201+
build_flags =
202+
${Xiao_S3_WIO.build_flags}
203+
-D ADVERT_NAME='"XiaoS3 sensor"'
204+
-D ADVERT_LAT=0.0
205+
-D ADVERT_LON=0.0
206+
-D ADMIN_PASSWORD='"password"'
207+
; -D MESH_PACKET_LOGGING=1
208+
; -D MESH_DEBUG=1
209+
lib_deps =
210+
${Xiao_S3_WIO.lib_deps}
211+
${esp32_ota.lib_deps}

variants/xiao_s3_wio/target.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ WRAPPER_CLASS radio_driver(radio, board);
1414

1515
ESP32RTCClock fallback_clock;
1616
AutoDiscoverRTCClock rtc_clock(fallback_clock);
17-
SensorManager sensors;
17+
EnvironmentSensorManager sensors;
1818

1919
#ifdef DISPLAY_CLASS
2020
DISPLAY_CLASS display;

variants/xiao_s3_wio/target.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <helpers/ESP32Board.h>
77
#include <helpers/radiolib/CustomSX1262Wrapper.h>
88
#include <helpers/AutoDiscoverRTCClock.h>
9-
#include <helpers/SensorManager.h>
9+
#include <helpers/sensors/EnvironmentSensorManager.h>
1010
#ifdef DISPLAY_CLASS
1111
#include <helpers/ui/SSD1306Display.h>
1212
#include <helpers/ui/MomentaryButton.h>
@@ -16,7 +16,7 @@
1616
extern XiaoS3WIOBoard board;
1717
extern WRAPPER_CLASS radio_driver;
1818
extern AutoDiscoverRTCClock rtc_clock;
19-
extern SensorManager sensors;
19+
extern EnvironmentSensorManager sensors;
2020

2121
#ifdef DISPLAY_CLASS
2222
extern DISPLAY_CLASS display;

0 commit comments

Comments
 (0)