@@ -67,13 +67,13 @@ class Peripherals : public StatefulService<PeripheralsConfiguration> {
6767
6868 updatePins ();
6969
70- #if FT_ENABLED(USE_MPU6050)
70+ #if FT_ENABLED(USE_MPU6050 || USE_BNO055 )
7171 if (!_imu.initialize ()) ESP_LOGE (" IMUService" , " IMU initialize failed" );
7272#endif
73- #if FT_ENABLED(USE_MAG )
73+ #if FT_ENABLED(USE_HMC5883 )
7474 if (!_mag.initialize ()) ESP_LOGE (" IMUService" , " MAG initialize failed" );
7575#endif
76- #if FT_ENABLED(USE_BMP )
76+ #if FT_ENABLED(USE_BMP180 )
7777 if (!_bmp.initialize ()) ESP_LOGE (" IMUService" , " BMP initialize failed" );
7878#endif
7979#if FT_ENABLED(USE_USS)
@@ -137,7 +137,7 @@ class Peripherals : public StatefulService<PeripheralsConfiguration> {
137137 /* IMU FUNCTIONS */
138138 bool readIMU () {
139139 bool updated = false ;
140- #if FT_ENABLED(USE_MPU6050)
140+ #if FT_ENABLED(USE_MPU6050 || USE_BNO055 )
141141 beginTransaction ();
142142 updated = _imu.readIMU ();
143143 endTransaction ();
@@ -147,7 +147,7 @@ class Peripherals : public StatefulService<PeripheralsConfiguration> {
147147
148148 bool readMag () {
149149 bool updated = false ;
150- #if FT_ENABLED(USE_MAG )
150+ #if FT_ENABLED(USE_HMC5883 )
151151 beginTransaction ();
152152 updated = _mag.readMagnetometer ();
153153 endTransaction ();
@@ -157,7 +157,7 @@ class Peripherals : public StatefulService<PeripheralsConfiguration> {
157157
158158 bool readBMP () {
159159 bool updated = false ;
160- #if FT_ENABLED(USE_BMP )
160+ #if FT_ENABLED(USE_BMP180 )
161161 beginTransaction ();
162162 updated = _bmp.readBarometer ();
163163 endTransaction ();
@@ -181,13 +181,13 @@ class Peripherals : public StatefulService<PeripheralsConfiguration> {
181181 void emitIMU () {
182182 doc.clear ();
183183 JsonObject root = doc.to <JsonObject>();
184- #if FT_ENABLED(USE_MPU6050)
184+ #if FT_ENABLED(USE_MPU6050 || USE_BNO055 )
185185 _imu.readIMU (root);
186186#endif
187- #if FT_ENABLED(USE_MAG )
187+ #if FT_ENABLED(USE_HMC5883 )
188188 _mag.readMagnetometer (root);
189189#endif
190- #if FT_ENABLED(USE_BMP )
190+ #if FT_ENABLED(USE_BMP180 )
191191 _bmp.readBarometer (root);
192192#endif
193193 serializeJson (doc, message);
@@ -196,7 +196,6 @@ class Peripherals : public StatefulService<PeripheralsConfiguration> {
196196
197197 void emitSonar () {
198198#if FT_ENABLED(USE_USS)
199-
200199 char output[16 ];
201200 snprintf (output, sizeof (output), " [%.1f,%.1f]" , _left_distance, _right_distance);
202201 socket.emit (" sonar" , output);
@@ -214,13 +213,13 @@ class Peripherals : public StatefulService<PeripheralsConfiguration> {
214213
215214 JsonDocument doc;
216215 char message[MAX_ESP_IMU_SIZE];
217- #if FT_ENABLED(USE_MPU6050)
216+ #if FT_ENABLED(USE_MPU6050 || USE_BNO055 )
218217 IMU _imu;
219218#endif
220- #if FT_ENABLED(USE_MAG )
219+ #if FT_ENABLED(USE_HMC5883 )
221220 Magnetometer _mag;
222221#endif
223- #if FT_ENABLED(USE_BMP )
222+ #if FT_ENABLED(USE_BMP180 )
224223 Barometer _bmp;
225224#endif
226225#if FT_ENABLED(USE_USS)
0 commit comments