@@ -105,16 +105,14 @@ boolean ClassicController_Shared::specificInit() {
105105 /* On init, try to set the controller to work in "high resolution" mode so
106106 * we get a full byte of data for each analog input.
107107 *
108- * The 'setHighRes ' function also checks the current mode of the controller
108+ * The 'writeHighRes ' function also checks the current mode of the controller
109109 * after the HR setting is set, so the data maps should match the data
110110 * reporting type. This way the class flexes to support controllers that
111111 * only work in standard mode, only work in high res mode, or can support
112112 * both.
113113 */
114114 delayMicroseconds (I2C_ConversionDelay); // wait after ID read before writing register
115- setHighRes (true ); // attempt to set, otherwise will read mode from controller
116-
117- return true ; // unconditional connection
115+ return writeHighRes (true ); // 'success' if no comms errors
118116}
119117
120118boolean ClassicController_Shared::checkHighRes (boolean *hr) const {
@@ -184,7 +182,7 @@ boolean ClassicController_Shared::checkHighRes(boolean *hr) const {
184182 return true ; // successfully read state
185183}
186184
187- boolean ClassicController_Shared::setHighRes (boolean hr) {
185+ boolean ClassicController_Shared::writeHighRes (boolean hr) {
188186 const uint8_t regVal = hr ? 0x03 : 0x01 ; // 0x03 for high res, 0x01 for standard
189187 if (!writeRegister (0xFE , regVal)) return false ; // write to controller
190188
@@ -199,7 +197,12 @@ boolean ClassicController_Shared::setHighRes(boolean hr) {
199197 setRequestSize (MinRequestSize); // if not in HR and *trying* not to be, set back to min
200198 }
201199
202- return hr == highRes; // 'success' if the value we're setting is the one we read
200+ return true ; // 'success' if no communication errors, regardless of setting
201+ }
202+
203+ boolean ClassicController_Shared::setHighRes (boolean hr) {
204+ // 'success' if the mode is changed to the one we're trying to set
205+ return writeHighRes (hr) && (getHighRes () == hr);
203206}
204207
205208boolean ClassicController_Shared::getHighRes () const {
0 commit comments