@@ -184,13 +184,18 @@ boolean ClassicController_Shared::checkDataMode(boolean *hr) const {
184184 return true ; // successfully read state
185185}
186186
187- boolean ClassicController_Shared::setDataMode (boolean hr) {
187+ boolean ClassicController_Shared::setDataMode (boolean hr, boolean verify ) {
188188 const uint8_t regVal = hr ? 0x03 : 0x01 ; // 0x03 for high res, 0x01 for standard
189189 if (!writeRegister (0xFE , regVal)) return false ; // write to controller
190190
191- boolean currentMode = false ; // check controller's HR setting
192- if (!checkDataMode (¤tMode)) return false ; // error: could not read mode
193- highRes = currentMode; // save current mode to class
191+ if (verify == true ) {
192+ boolean currentMode = false ; // check controller's HR setting
193+ if (!checkDataMode (¤tMode)) return false ; // error: could not read mode
194+ highRes = currentMode; // save current mode to class
195+ }
196+ else {
197+ highRes = hr; // save mode (no verification)
198+ }
194199
195200 if (getHighRes () == true && getRequestSize () < 8 ) {
196201 setRequestSize (8 ); // 8 bytes needed for hr mode
@@ -202,9 +207,9 @@ boolean ClassicController_Shared::setDataMode(boolean hr) {
202207 return true ; // 'success' if no communication errors, regardless of setting
203208}
204209
205- boolean ClassicController_Shared::setHighRes (boolean hr) {
210+ boolean ClassicController_Shared::setHighRes (boolean hr, boolean verify ) {
206211 // 'success' if the mode is changed to the one we're trying to set
207- return setDataMode (hr) && (getHighRes () == hr);
212+ return setDataMode (hr, verify ) && (getHighRes () == hr);
208213}
209214
210215boolean ClassicController_Shared::getHighRes () const {
0 commit comments