mirror of
https://github.com/SlimeVR/SlimeVR-Tracker-ESP.git
synced 2026-04-06 02:01:57 +02:00
Add announcement of magnetometer not supported (#356)
* Add announcement of magnetometer not supported * undo platformio config * remove debug line
This commit is contained in:
@@ -46,11 +46,14 @@ const char* calibrationConfigTypeToString(SensorConfigType type) {
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t configDataToNumber(SensorConfig sensorConfig) {
|
||||
// 1st bit specifies if magnetometer is enabled or disabled
|
||||
// 2nd bit specifies if magnetometer is supported
|
||||
uint16_t configDataToNumber(SensorConfig* sensorConfig, bool magSupported) {
|
||||
uint16_t data = 0;
|
||||
switch (sensorConfig.type) {
|
||||
data += magSupported << 1;
|
||||
switch (sensorConfig->type) {
|
||||
case SensorConfigType::BNO0XX: {
|
||||
auto config = &sensorConfig.data.bno0XX;
|
||||
auto config = &sensorConfig->data.bno0XX;
|
||||
data += config->magEnabled;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#define SLIMEVR_CONFIGURATION_SENSORCONFIG_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "consts.h"
|
||||
|
||||
namespace SlimeVR {
|
||||
@@ -148,7 +149,7 @@ struct SensorConfig {
|
||||
} data;
|
||||
};
|
||||
|
||||
uint16_t configDataToNumber(SensorConfig sensorConfig);
|
||||
uint16_t configDataToNumber(SensorConfig* sensorConfig, bool magSupported);
|
||||
} // namespace Configuration
|
||||
} // namespace SlimeVR
|
||||
|
||||
|
||||
@@ -71,7 +71,10 @@ void Sensor::resetTemperatureCalibrationState() { printTemperatureCalibrationUns
|
||||
|
||||
uint16_t Sensor::getSensorConfigData() {
|
||||
SlimeVR::Configuration::SensorConfig sensorConfig = configuration.getSensor(sensorId);
|
||||
return SlimeVR::Configuration::configDataToNumber(sensorConfig);
|
||||
return SlimeVR::Configuration::configDataToNumber(
|
||||
&sensorConfig,
|
||||
magStatus != MagnetometerStatus::MAG_NOT_SUPPORTED
|
||||
);
|
||||
}
|
||||
|
||||
const char * getIMUNameByType(ImuID imuType) {
|
||||
|
||||
Reference in New Issue
Block a user