File tree Expand file tree Collapse file tree 2 files changed +20
-10
lines changed Expand file tree Collapse file tree 2 files changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -101,20 +101,20 @@ void Enroll()
101
101
if (bret != false )
102
102
{
103
103
Serial.println (" Remove finger" );
104
- fps.Enroll1 ();
104
+ iret = fps.Enroll1 ();
105
105
while (fps.IsPressFinger () == true ) delay (100 );
106
106
Serial.println (" Press same finger again" );
107
107
while (fps.IsPressFinger () == false ) delay (100 );
108
108
bret = fps.CaptureFinger (true );
109
- if (bret != false )
109
+ if (bret != false && !iret )
110
110
{
111
111
Serial.println (" Remove finger" );
112
- fps.Enroll2 ();
112
+ iret = fps.Enroll2 ();
113
113
while (fps.IsPressFinger () == true ) delay (100 );
114
114
Serial.println (" Press same finger yet again" );
115
115
while (fps.IsPressFinger () == false ) delay (100 );
116
116
bret = fps.CaptureFinger (true );
117
- if (bret != false )
117
+ if (bret != false && !iret )
118
118
{
119
119
Serial.println (" Remove finger" );
120
120
iret = fps.Enroll3 ();
@@ -128,8 +128,18 @@ void Enroll()
128
128
Serial.println (iret);
129
129
}
130
130
}
131
+ else if (iret)
132
+ {
133
+ Serial.print (" Enrolling Failed with error code:" );
134
+ Serial.println (iret);
135
+ }
131
136
else Serial.println (" Failed to capture third finger" );
132
137
}
138
+ else if (iret)
139
+ {
140
+ Serial.print (" Enrolling Failed with error code:" );
141
+ Serial.println (iret);
142
+ }
133
143
else Serial.println (" Failed to capture second finger" );
134
144
}
135
145
else Serial.println (" Failed to capture first finger" );
Original file line number Diff line number Diff line change @@ -602,9 +602,9 @@ uint8_t FPS_GT511C3::Enroll1()
602
602
{
603
603
if (rp->Error == Response_Packet::ErrorCodes::NACK_ENROLL_FAILED) retval = 1 ;
604
604
if (rp->Error == Response_Packet::ErrorCodes::NACK_BAD_FINGER) retval = 2 ;
605
- }
605
+ } else retval = 0 ;
606
606
delete rp;
607
- if (rp-> ACK ) return 0 ; else return retval;
607
+ return retval;
608
608
}
609
609
610
610
// Gets the Second scan of an enrollment
@@ -633,9 +633,9 @@ uint8_t FPS_GT511C3::Enroll2()
633
633
{
634
634
if (rp->Error == Response_Packet::ErrorCodes::NACK_ENROLL_FAILED) retval = 1 ;
635
635
if (rp->Error == Response_Packet::ErrorCodes::NACK_BAD_FINGER) retval = 2 ;
636
- }
636
+ } else retval = 0 ;
637
637
delete rp;
638
- if (rp-> ACK ) return 0 ; else return retval;
638
+ return retval;
639
639
}
640
640
641
641
// Gets the Third scan of an enrollment
@@ -665,9 +665,9 @@ uint8_t FPS_GT511C3::Enroll3()
665
665
{
666
666
if (rp->Error == Response_Packet::ErrorCodes::NACK_ENROLL_FAILED) retval = 1 ;
667
667
if (rp->Error == Response_Packet::ErrorCodes::NACK_BAD_FINGER) retval = 2 ;
668
- }
668
+ } else retval = 0 ;
669
669
delete rp;
670
- if (rp-> ACK ) return 0 ; else return retval;
670
+ return retval;
671
671
}
672
672
673
673
// Checks to see if a finger is pressed on the FPS
You can’t perform that action at this time.
0 commit comments