@@ -105,17 +105,17 @@ 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 'writeHighRes ' function also checks the current mode of the controller
108+ * The 'setDataMode ' 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- return writeHighRes (true ); // 'success' if no comms errors
115+ return setDataMode (true ); // try to set 'high res' mode. 'success' if no comms errors
116116}
117117
118- boolean ClassicController_Shared::checkHighRes (boolean *hr) const {
118+ boolean ClassicController_Shared::checkDataMode (boolean *hr) const {
119119 /* Programmator Emptor: vvv This is where all of the headaches stem from vvv */
120120
121121 /* Okay, so here's the deal. The Wii Classic Controller reports its data
@@ -182,12 +182,12 @@ boolean ClassicController_Shared::checkHighRes(boolean *hr) const {
182182 return true ; // successfully read state
183183}
184184
185- boolean ClassicController_Shared::writeHighRes (boolean hr) {
185+ boolean ClassicController_Shared::setDataMode (boolean hr) {
186186 const uint8_t regVal = hr ? 0x03 : 0x01 ; // 0x03 for high res, 0x01 for standard
187187 if (!writeRegister (0xFE , regVal)) return false ; // write to controller
188188
189189 boolean currentMode = false ; // check controller's HR setting
190- if (!checkHighRes (¤tMode)) return false ; // error: could not read mode
190+ if (!checkDataMode (¤tMode)) return false ; // error: could not read mode
191191 highRes = currentMode; // save current mode to class
192192
193193 if (getHighRes () == true && getRequestSize () < 8 ) {
@@ -202,7 +202,7 @@ boolean ClassicController_Shared::writeHighRes(boolean hr) {
202202
203203boolean ClassicController_Shared::setHighRes (boolean hr) {
204204 // 'success' if the mode is changed to the one we're trying to set
205- return writeHighRes (hr) && (getHighRes () == hr);
205+ return setDataMode (hr) && (getHighRes () == hr);
206206}
207207
208208boolean ClassicController_Shared::getHighRes () const {
0 commit comments