Fixed compilation warnings
Removed unnecessary magReading variable in F_BMX055.cpp because it generated a warning that caused problems with some compiler setups. The initialisation of AccelData, GyroData, MagData and calData has been refactored as it was also generating warnings.
Hey @LiquidCGS,
Could you take a look at this PR to see if it works for you or if it needs some tweaking?
Also on RISC-V (ES32-C3) the zero-initialisation causes lots of warnings about incorrect initialisation. The suggested solution however would create a problem when a new variable is added to the struct.
As a suggestion, I would rather create some defines in IMUBase.hpp
#define ACCELDATA_ZERO { 0, 0, 0 }
#define GYRODATA_ZERO { 0, 0, 0 }
#define CALDATA_ZERO {0, {0,0,0},{0,0,0},{0,0,0},{0,0,0}}
Also on RISC-V (ES32-C3) the zero-initialisation causes lots of warnings about incorrect initialisation. The suggested solution however would create a problem when a new variable is added to the struct.
As a suggestion, I would rather create some defines in IMUBase.hpp
#define ACCELDATA_ZERO { 0, 0, 0 } #define GYRODATA_ZERO { 0, 0, 0 } #define CALDATA_ZERO {0, {0,0,0},{0,0,0},{0,0,0},{0,0,0}}
And
AccelData accel = { 0 }; GyroData gyro = { 0 };
to
AccelData accel = { 0.0f, 0.0f, 0.0f }; GyroData gyro = { 0.0f, 0.0f, 0.0f };