@@ -731,17 +731,19 @@ void initSensors() {
731
731
Control* handle = ESPUI.getControl ( labelStatusInclino );
732
732
733
733
if ( mma.begin () ) {
734
+ initialisation.inclinoType = SteerConfig::InclinoType::MMA8451;
735
+
734
736
handle->value = " MMA8451 found & initialized" ;
735
737
handle->color = ControlColor::Emerald;
736
- initialisation.inclinoType = SteerConfig::InclinoType::MMA8451;
737
738
738
739
mma.setRange ( MMA8451_RANGE_2_G );
739
740
mma.setDataRate ( MMA8451_DATARATE_200_HZ );
740
741
mma.setFifoSettings ( MMA8451_FIFO_CIRCULAR );
741
742
} else {
743
+ initialisation.inclinoType = SteerConfig::InclinoType::None;
744
+
742
745
handle->value = " MMA8451 not found" ;
743
746
handle->color = ControlColor::Alizarin;
744
- initialisation.inclinoType = SteerConfig::InclinoType::None;
745
747
}
746
748
747
749
ESPUI.updateControl ( handle );
@@ -751,9 +753,10 @@ void initSensors() {
751
753
Control* handle = ESPUI.getControl ( labelStatusImu );
752
754
753
755
if ( bno.begin () ) {
756
+ initialisation.imuType = SteerConfig::ImuType::BNO055;
757
+
754
758
handle->value = " BNO055 found & initialized" ;
755
759
handle->color = ControlColor::Emerald;
756
- initialisation.imuType = SteerConfig::ImuType::BNO055;
757
760
758
761
displaySensorOffsets ( bno055CalibrationData );
759
762
@@ -763,47 +766,61 @@ void initSensors() {
763
766
764
767
bno.setExtCrystalUse ( true );
765
768
} else {
769
+ initialisation.imuType = SteerConfig::ImuType::None;
770
+
766
771
handle->value = " BNO055 not found" ;
767
772
handle->color = ControlColor::Alizarin;
768
- initialisation.imuType = SteerConfig::ImuType::None;
769
773
}
770
774
771
775
ESPUI.updateControl ( handle );
772
776
}
773
777
774
778
if ( steerConfig.inclinoType == SteerConfig::InclinoType::Fxos8700Fxas21002 ||
775
- steerConfig.imuType == SteerConfig::ImuType::Fxos8700Fxas21002
776
- ) {
777
- Control* handle = ESPUI.getControl ( labelStatusImu );
779
+ steerConfig.imuType == SteerConfig::ImuType::Fxos8700Fxas21002 ) {
778
780
779
781
if ( fxas2100.begin () && fxos8700.begin ( ACCEL_RANGE_2G ) ) {
780
782
781
- handle->value = " FXAS2100/FXOS8700 found & initialized" ;
782
- handle->color = ControlColor::Emerald;
783
-
784
783
if ( steerConfig.imuType == SteerConfig::ImuType::Fxos8700Fxas21002 ) {
785
784
initialisation.imuType = steerConfig.imuType ;
785
+
786
+ Control* handle = ESPUI.getControl ( labelStatusImu );
787
+ handle->value = " FXAS2100/FXOS8700 found & initialized" ;
788
+ handle->color = ControlColor::Emerald;
789
+ ESPUI.updateControl ( handle );
786
790
}
787
791
788
792
if ( steerConfig.inclinoType == SteerConfig::InclinoType::Fxos8700Fxas21002 ) {
789
793
initialisation.inclinoType = steerConfig.inclinoType ;
794
+
795
+ Control* handle = ESPUI.getControl ( labelStatusInclino );
796
+ handle->value = " FXAS2100/FXOS8700 found & initialized" ;
797
+ handle->color = ControlColor::Emerald;
798
+ ESPUI.updateControl ( handle );
790
799
}
791
800
792
801
ahrs.begin ( 100 );
793
802
} else {
794
- handle->value = " FXAS2100/FXOS8700 not found" ;
795
- handle->color = ControlColor::Alizarin;
803
+
796
804
797
805
if ( steerConfig.imuType == SteerConfig::ImuType::Fxos8700Fxas21002 ) {
798
806
initialisation.imuType = SteerConfig::ImuType::None;
807
+
808
+ Control* handle = ESPUI.getControl ( labelStatusImu );
809
+ handle->value = " FXAS2100/FXOS8700 not found" ;
810
+ handle->color = ControlColor::Alizarin;
811
+ ESPUI.updateControl ( handle );
799
812
}
800
813
801
814
if ( steerConfig.inclinoType == SteerConfig::InclinoType::Fxos8700Fxas21002 ) {
802
815
initialisation.inclinoType = SteerConfig::InclinoType::None;
816
+
817
+ Control* handle = ESPUI.getControl ( labelStatusInclino );
818
+ handle->value = " FXAS2100/FXOS8700 not found" ;
819
+ handle->color = ControlColor::Alizarin;
820
+ ESPUI.updateControl ( handle );
803
821
}
804
822
}
805
823
806
- ESPUI.updateControl ( handle );
807
824
}
808
825
809
826
// initialise ads1115 everytime, even if not avaible (no answer in the init -> just sending)
0 commit comments