@@ -78,23 +78,19 @@ class WipperSnapper_I2C_Driver_AS5600 : public WipperSnapper_I2C_Driver {
78
78
*/
79
79
/* ******************************************************************************/
80
80
bool configureSensor () {
81
- return _as5600->enableWatchdog (false ) || // Normal (high) power mode
82
- _as5600->setPowerMode (AS5600_POWER_MODE_NOM) ||
81
+ return _as5600->enableWatchdog (false ) &&
82
+ // Normal (high) power mode
83
+ _as5600->setPowerMode (AS5600_POWER_MODE_NOM) &&
83
84
// No Hysteresis
84
- _as5600->setHysteresis (AS5600_HYSTERESIS_OFF) ||
85
-
85
+ _as5600->setHysteresis (AS5600_HYSTERESIS_OFF) &&
86
86
// analog output (0-VCC for 0-360 degrees)
87
- _as5600->setOutputStage (AS5600_OUTPUT_STAGE_ANALOG_FULL) ||
88
-
87
+ _as5600->setOutputStage (AS5600_OUTPUT_STAGE_ANALOG_FULL) &&
89
88
// setup filters
90
- _as5600->setSlowFilter (AS5600_SLOW_FILTER_16X) ||
91
- _as5600->setFastFilterThresh (AS5600_FAST_FILTER_THRESH_SLOW_ONLY) ||
92
-
89
+ _as5600->setSlowFilter (AS5600_SLOW_FILTER_16X) &&
90
+ _as5600->setFastFilterThresh (AS5600_FAST_FILTER_THRESH_SLOW_ONLY) &&
93
91
// Reset position settings to defaults
94
- _as5600->setZPosition (0 ) || _as5600->setMPosition (4095 ) ||
92
+ _as5600->setZPosition (0 ) && _as5600->setMPosition (4095 ) &&
95
93
_as5600->setMaxAngle (4095 );
96
-
97
- return true ;
98
94
}
99
95
100
96
bool readSensor () {
@@ -107,7 +103,7 @@ class WipperSnapper_I2C_Driver_AS5600 : public WipperSnapper_I2C_Driver {
107
103
uint16_t rawAngle = _as5600->getRawAngle ();
108
104
uint16_t angle = _as5600->getAngle ();
109
105
110
- WS_DEBUG_PRINT (" Raw: " );
106
+ WS_DEBUG_PRINT (" AS5600 Raw: " );
111
107
WS_DEBUG_PRINT (rawAngle);
112
108
WS_DEBUG_PRINT (" (0x" );
113
109
WS_DEBUG_PRINT (rawAngle, HEX);
0 commit comments