Skip to content

Commit 450aac0

Browse files
committed
Merge branch 'main' into fancy-wifi-provisioning
2 parents 6c68335 + 94f61c7 commit 450aac0

57 files changed

Lines changed: 918 additions & 722 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/actions.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,4 @@ jobs:
7171
generate_release_notes: true
7272
files: |
7373
./build/BOARD_SLIMEVR-firmware.bin
74+
./build/BOARD_SLIMEVR_V1_2-firmware.bin

ci/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def build() -> int:
9595
status = build_for_device(device)
9696

9797
if not status:
98-
failed_builds.append(device.platformio_board)
98+
failed_builds.append(device.board)
9999

100100
if len(failed_builds) > 0:
101101
print(f" 🡢 {COLOR_RED}Failed!{COLOR_RESET}")

lib/bno080/BNO080.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
1313
This library handles the initialization of the BNO080 and is able to query the sensor
1414
for different readings.
15-
1615
https://github.com/sparkfun/SparkFun_BNO080_Arduino_Library
1716
1817
Development environment specifics:
@@ -688,6 +687,16 @@ void BNO080::getAccel(float &x, float &y, float &z, uint8_t &accuracy)
688687
hasNewAccel_ = false;
689688
}
690689

690+
bool BNO080::getNewAccel(float &x, float &y, float &z, uint8_t &accuracy)
691+
{
692+
if (hasNewAccel_)
693+
{
694+
getAccel(x, y, z, accuracy);
695+
return true;
696+
}
697+
return false;
698+
}
699+
691700
//Return the acceleration component
692701
float BNO080::getAccelX()
693702
{

lib/bno080/BNO080.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ class BNO080
214214
uint8_t getQuatAccuracy();
215215

216216
void getAccel(float &x, float &y, float &z, uint8_t &accuracy);
217+
bool getNewAccel(float &x, float &y, float &z, uint8_t &accuracy);
217218
float getAccelX();
218219
float getAccelY();
219220
float getAccelZ();

platformio-tools.ini

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,40 +17,82 @@ build_unflags =
1717
[env:BOARD_SLIMEVR]
1818
platform = espressif8266 @ 4.2.1
1919
board = esp12e
20+
build_flags =
21+
${env.build_flags}
22+
-D BOARD=BOARD_SLIMEVR
23+
24+
[env:BOARD_SLIMEVR_V1_2]
25+
platform = espressif8266 @ 4.2.1
26+
board = esp12e
27+
build_flags =
28+
${env.build_flags}
29+
-D BOARD=BOARD_SLIMEVR_V1_2
2030

2131
[env:BOARD_SLIMEVR_DEV]
2232
platform = espressif8266 @ 4.2.1
2333
board = esp12e
34+
build_flags =
35+
${env.build_flags}
36+
-D BOARD=BOARD_SLIMEVR_DEV
37+
38+
[env:BOARD_GLOVE_IMU_SLIMEVR_DEV]
39+
platform = espressif32 @ 6.7.0
40+
platform_packages =
41+
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.1
42+
framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip
43+
build_flags =
44+
${env.build_flags}
45+
-DESP32C3
46+
-D BOARD=BOARD_GLOVE_IMU_SLIMEVR_DEV
47+
board = lolin_c3_mini
2448

2549
[env:BOARD_NODEMCU]
2650
platform = espressif8266 @ 4.2.1
2751
board = esp12e
52+
build_flags =
53+
${env.build_flags}
54+
-D BOARD=BOARD_NODEMCU
2855

2956
[env:BOARD_WEMOSD1MINI]
3057
platform = espressif8266 @ 4.2.1
3158
board = esp12e
59+
build_flags =
60+
${env.build_flags}
61+
-D BOARD=BOARD_WEMOSD1MINI
3262

3363
[env:BOARD_TTGO_TBASE]
3464
platform = espressif8266 @ 4.2.1
3565
board = esp12e
66+
build_flags =
67+
${env.build_flags}
68+
-D BOARD=BOARD_TTGO_TBASE
3669

3770
[env:BOARD_WEMOSWROOM02]
3871
platform = espressif8266 @ 4.2.1
3972
board = esp12e
73+
build_flags =
74+
${env.build_flags}
75+
-D BOARD=BOARD_NODEMCU
4076

4177
[env:BOARD_WROOM32]
4278
platform = espressif32 @ 6.7.0
4379
platform_packages =
4480
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.1
4581
framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip
4682
board = esp32dev
83+
build_flags =
84+
${env.build_flags}
85+
-D BOARD=BOARD_WROOM32
4786

4887
[env:BOARD_ESP01]
4988
platform = espressif32 @ 6.7.0
5089
platform_packages =
5190
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.1
5291
framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip
5392
board = esp32dev
93+
build_flags =
94+
${env.build_flags}
95+
-D BOARD=BOARD_ESP01
5496

5597
[env:BOARD_LOLIN_C3_MINI]
5698
platform = espressif32 @ 6.7.0
@@ -60,6 +102,7 @@ platform_packages =
60102
build_flags =
61103
${env.build_flags}
62104
-DESP32C3
105+
-D BOARD=BOARD_LOLIN_C3_MINI
63106
board = lolin_c3_mini
64107

65108
[env:BOARD_BEETLE32C3]
@@ -70,6 +113,7 @@ platform_packages =
70113
build_flags =
71114
${env.build_flags}
72115
-DESP32C3
116+
-D BOARD=BOARD_BEETLE32C3
73117
board = dfrobot_beetle_esp32c3
74118

75119
[env:BOARD_ESP32C3DEVKITM1]
@@ -80,13 +124,15 @@ platform_packages =
80124
build_flags =
81125
${env.build_flags}
82126
-DESP32C3
127+
-D BOARD=BOARD_ESP32C3DEVKITM1
83128
board = esp32-c3-devkitm-1
84129

85130
[env:BOARD_ESP32C6DEVKITC1]
86131
platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.06.11/platform-espressif32.zip
87132
build_flags =
88133
${env.build_flags}
89134
-DESP32C6
135+
-D BOARD=BOARD_ESP32C6DEVKITC1
90136
board = esp32-c6-devkitc-1
91137

92138
[env:BOARD_XIAO_ESP32C3]
@@ -97,4 +143,5 @@ platform_packages =
97143
build_flags =
98144
${env.build_flags}
99145
-DESP32C3
146+
-D BOARD=BOARD_XIAO_ESP32C3
100147
board = seeed_xiao_esp32c3

src/FSHelper.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525

2626
#include <functional>
2727

28-
namespace SlimeVR {
29-
namespace Utils {
28+
namespace SlimeVR::Utils {
3029
SlimeVR::Logging::Logger m_Logger("FSHelper");
3130

3231
bool ensureDirectory(const char* directory) {
@@ -88,5 +87,4 @@ void forEachFile(const char* directory, std::function<void(File file)> callback)
8887
}
8988
#endif
9089
}
91-
} // namespace Utils
92-
} // namespace SlimeVR
90+
} // namespace SlimeVR::Utils

src/FSHelper.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929

3030
#include <functional>
3131

32-
namespace SlimeVR {
33-
namespace Utils {
32+
namespace SlimeVR::Utils {
3433

3534
class File {
3635
public:
@@ -62,7 +61,6 @@ bool ensureDirectory(const char* directory);
6261
File openFile(const char* path, const char* mode);
6362

6463
void forEachFile(const char* directory, std::function<void(File file)> callback);
65-
} // namespace Utils
66-
} // namespace SlimeVR
64+
} // namespace SlimeVR::Utils
6765

6866
#endif

src/GlobalVars.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,18 @@
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
THE SOFTWARE.
2222
*/
23-
24-
#ifndef GLOBALVARS_H
25-
#define GLOBALVARS_H
23+
#pragma once
2624

2725
#include <arduino-timer.h>
2826

29-
#include "LEDManager.h"
3027
#include "batterymonitor.h"
3128
#include "configuration/Configuration.h"
3229
#include "network/connection.h"
3330
#include "network/manager.h"
3431
#include "network/wifihandler.h"
3532
#include "network/wifiprovisioning.h"
3633
#include "sensors/SensorManager.h"
34+
#include "status/LEDManager.h"
3735
#include "status/StatusManager.h"
3836

3937
extern Timer<> globalTimer;
@@ -46,5 +44,3 @@ extern SlimeVR::Network::Connection networkConnection;
4644
extern BatteryMonitor battery;
4745
extern SlimeVR::WiFiNetwork wifiNetwork;
4846
extern SlimeVR::WiFiProvisioning wifiProvisioning;
49-
50-
#endif
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,73 @@ BATTERY_R1(10)
174174
BATTERY_R2(40.2)
175175

176176
#endif
177+
178+
// Default IMU pinouts and definitions for default tracker types
179+
180+
#if BOARD != BOARD_GLOVE_IMU_SLIMEVR_DEV
181+
// Defaunlt definitions for normal 2-sensor trackers
182+
#ifndef MAX_SENSORS_COUNT
183+
#define MAX_SENSORS_COUNT 2
184+
#endif
185+
#ifndef TRACKER_TYPE
186+
#define TRACKER_TYPE TrackerType::TRACKER_TYPE_SVR_ROTATION
187+
#endif
188+
189+
// Axis mapping example
190+
/*
191+
#include "sensors/axisremap.h"
192+
#define BMI160_QMC_REMAP AXIS_REMAP_BUILD(AXIS_REMAP_USE_Y, AXIS_REMAP_USE_XN,
193+
AXIS_REMAP_USE_Z, \ AXIS_REMAP_USE_YN, AXIS_REMAP_USE_X, AXIS_REMAP_USE_Z)
194+
195+
SENSOR_DESC_ENTRY(IMU_BMP160, PRIMARY_IMU_ADDRESS_ONE, IMU_ROTATION, PIN_IMU_SCL,
196+
PIN_IMU_SDA, PRIMARY_IMU_OPTIONAL, BMI160_QMC_REMAP) \
197+
*/
198+
199+
#ifndef SENSOR_DESC_LIST
200+
#if BOARD == BOARD_SLIMEVR_V1_2
201+
#define SENSOR_DESC_LIST \
202+
SENSOR_DESC_ENTRY( \
203+
IMU, \
204+
DIRECT_PIN(15), \
205+
IMU_ROTATION, \
206+
DIRECT_SPI(24'000'000, MSBFIRST, SPI_MODE3), \
207+
PRIMARY_IMU_OPTIONAL, \
208+
DIRECT_PIN(PIN_IMU_INT), \
209+
0 \
210+
) \
211+
SENSOR_DESC_ENTRY( \
212+
SECOND_IMU, \
213+
SECONDARY_IMU_ADDRESS_TWO, \
214+
SECOND_IMU_ROTATION, \
215+
DIRECT_WIRE(PIN_IMU_SCL, PIN_IMU_SDA), \
216+
SECONDARY_IMU_OPTIONAL, \
217+
DIRECT_PIN(PIN_IMU_INT_2), \
218+
0 \
219+
)
220+
#else
221+
#define SENSOR_DESC_LIST \
222+
SENSOR_DESC_ENTRY( \
223+
IMU, \
224+
PRIMARY_IMU_ADDRESS_ONE, \
225+
IMU_ROTATION, \
226+
DIRECT_WIRE(PIN_IMU_SCL, PIN_IMU_SDA), \
227+
PRIMARY_IMU_OPTIONAL, \
228+
DIRECT_PIN(PIN_IMU_INT), \
229+
0 \
230+
) \
231+
SENSOR_DESC_ENTRY( \
232+
SECOND_IMU, \
233+
SECONDARY_IMU_ADDRESS_TWO, \
234+
SECOND_IMU_ROTATION, \
235+
DIRECT_WIRE(PIN_IMU_SCL, PIN_IMU_SDA), \
236+
SECONDARY_IMU_OPTIONAL, \
237+
DIRECT_PIN(PIN_IMU_INT_2), \
238+
0 \
239+
)
240+
#endif
241+
#endif
242+
#else // BOARD == BOARD_GLOVE_IMU_SLIMEVR_DEV
243+
244+
#include "glove_default.h"
245+
246+
#endif // BOARD != BOARD_GLOVE_IMU_SLIMEVR_DEV
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#include "defines_helpers.h"
2525

26-
#include "consts.h"
26+
#include "../consts.h"
2727

2828
#ifndef LED_BUILTIN
2929
#define LED_BUILTIN LED_OFF

0 commit comments

Comments
 (0)