File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -1162,12 +1162,12 @@ void FPS_GT511C3::GetData(uint16_t length)
1162
1162
Data_Packet dp (firstdata);
1163
1163
1164
1164
uint16_t numberPacketsNeeded = (length-4 ) / 64 ;
1165
- bool smallLastPacket = false ;
1166
1165
uint8_t lastPacketSize = (length-4 ) % 64 ;
1167
- if (lastPacketSize != 0 )
1168
- {
1169
- numberPacketsNeeded++;
1170
- smallLastPacket = true ;
1166
+ if (lastPacketSize != 0 ) numberPacketsNeeded++;
1167
+ else {
1168
+ // Last packet requires special treatment, so you don't want it to pass over the main loop
1169
+ numberPacketsNeeded--;
1170
+ lastPacketSize = 64 ;
1171
1171
}
1172
1172
1173
1173
uint8_t data[64 ];
@@ -1237,16 +1237,7 @@ bool FPS_GT511C3::ReturnData(uint16_t length, uint8_t data[])
1237
1237
while (_serial.available () == false ) delay (10 );
1238
1238
firstdata[i]= (uint8_t ) _serial.read ();
1239
1239
}
1240
- Data_Packet dp (firstdata);
1241
-
1242
- uint16_t numberPacketsNeeded = (length-4 ) / 64 ;
1243
- bool smallLastPacket = false ;
1244
- uint8_t lastPacketSize = (length-4 ) % 64 ;
1245
- if (lastPacketSize != 0 )
1246
- {
1247
- numberPacketsNeeded++;
1248
- smallLastPacket = true ;
1249
- }
1240
+ Data_Packet dp (firstdata); // Not needed
1250
1241
1251
1242
for (uint16_t i=0 ; i < length-4 ; i++)
1252
1243
{
You can’t perform that action at this time.
0 commit comments