File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -174,16 +174,16 @@ namespace sfe_KX13X
174
174
return -1 ; // Fail immediately if the transmission isn't successful
175
175
176
176
// We're chunking in data - keeping the max chunk to kMaxI2CBufferLength
177
- // The register address counts as one byte so limit nChunk to kChunkSize -1
178
- nChunk = numBytes > (kChunkSize - 1 ) ? (kChunkSize - 1 ) : numBytes;
177
+ nChunk = numBytes > kChunkSize ? kChunkSize : numBytes;
179
178
180
179
nReturned = _i2cPort->requestFrom ((int )addr, (int )nChunk, (int )true ); // Always send a stop
181
180
182
181
// No data returned, no dice
183
182
if (nReturned == 0 )
184
183
return -1 ; // error
185
184
186
- // Check we got back as much data as was requested
185
+ // Check we got back as much data as was requested.
186
+ // (Fringe case. This should never happen... But, you know, it _could_...)
187
187
if (nReturned != nChunk)
188
188
failCount++; // Increment the failCount
189
189
You can’t perform that action at this time.
0 commit comments