Skip to content

Commit d1a0c63

Browse files
committed
Update ClassicCon specificInit block comment
Better-describing this function and how it's supposed to work.
1 parent d35e661 commit d1a0c63

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/controllers/ClassicController.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,15 @@ constexpr BitMap ClassicController_Shared::MapsHR::ButtonHome;
103103

104104
boolean ClassicController_Shared::specificInit() {
105105
/* On init, try to set the controller to work in "high resolution" mode so
106-
* we get a full byte of data for each analog input.
106+
* we get a full byte of data for each analog input. Then read the current
107+
* "data mode" from the controller so that the control surface functions
108+
* use the correct mappings. This way, the class flexes to support
109+
* all controllers regardless of their available data mode.
107110
*
108-
* The 'setDataMode' function also checks the current mode of the controller
109-
* after the HR setting is set, so the data maps should match the data
110-
* reporting type. This way the class flexes to support controllers that
111-
* only work in standard mode, only work in high res mode, or can support
112-
* both.
111+
* This function will only return false if there is a *communciation error*
112+
* on the I2C bus, meaning that the controller did not respond to a write
113+
* or did not provide the right amount of data for a request. It will *not*
114+
* return false if the "high resolution" mode is not successfully set.
113115
*/
114116
delayMicroseconds(I2C_ConversionDelay); // wait after ID read before writing register
115117
return setDataMode(true); // try to set 'high res' mode. 'success' if no comms errors

0 commit comments

Comments
 (0)