Skip to content

Commit ae59956

Browse files
committed
A few little fixes. Tested GetImage(), and it works as correct as GetRawImage().
1 parent e200f8a commit ae59956

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/FPS_GT511C3.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ void Data_Packet::GetData(uint8_t buffer[], uint16_t length)
234234
}
235235

236236
// Get the last data packet (<=128 bytes), calculate checksum, validate checksum received and send it to serial
237-
void Data_Packet::GetLastData(uint8_t* buffer, uint16_t length, bool UseSerialDebug)
237+
void Data_Packet::GetLastData(uint8_t buffer[], uint16_t length, bool UseSerialDebug)
238238
{
239-
for(uint16_t i = 0; i<length-2, i++) Serial.write(buffer[i]);
239+
for(uint16_t i = 0; i<(length-2); i++) Serial.write(buffer[i]);
240240
// The checksum here is arguably useless and may make the serial buffer overflow
241241
/*this->checksum = CalculateChecksum(buffer, length);
242242
uint8_t checksum_low = GetLowByte(this->checksum);
@@ -727,11 +727,15 @@ bool FPS_GT511C3::CaptureFinger(bool highquality)
727727

728728
// Gets an image that is 258x202 (52116 bytes) and sends it over serial
729729
// Returns: True (device confirming download)
730+
// It only worked with baud rate at 38400-57600 in GT-511C3.
731+
// Slower speeds and the FPS will shutdown. Higher speeds and the serial buffer will overflow.
732+
// Make sure you are allocating enough CPU time for this task or you will overflow nonetheless.
733+
// Also, avoid using UseSerialDebug for this task, since it's easier to overflow.
730734
bool FPS_GT511C3::GetImage()
731735
{
732736
if (UseSerialDebug) Serial.println("FPS - GetImage");
733737
Command_Packet* cp = new Command_Packet();
734-
cp->Command = Command_Packet::Commands::GetRawImage;
738+
cp->Command = Command_Packet::Commands::GetImage;
735739
uint8_t* packetbytes = cp->GetPacketBytes();
736740
delete cp;
737741
SendCommand(packetbytes, 12);

0 commit comments

Comments
 (0)