[FL-1904] LFRFID: dedicated reading modes (#823)

* LFRFID: dedicated reading modes
* LFRFID: normal and indala mode
This commit is contained in:
SG
2021-11-16 18:47:49 +10:00
committed by GitHub
parent b3d8f0b950
commit 4cb986b534
3 changed files with 34 additions and 10 deletions

View File

@@ -102,7 +102,7 @@ void RfidReader::stop() {
stop_comparator();
}
bool RfidReader::read(LfrfidKeyType* _type, uint8_t* data, uint8_t data_size) {
bool RfidReader::read(LfrfidKeyType* _type, uint8_t* data, uint8_t data_size, bool switch_enable) {
bool result = false;
bool something_readed = false;
@@ -140,7 +140,7 @@ bool RfidReader::read(LfrfidKeyType* _type, uint8_t* data, uint8_t data_size) {
}
// mode switching
if(switch_timer_elapsed()) {
if(switch_enable && switch_timer_elapsed()) {
switch_mode();
last_readed_count = 0;
}

View File

@@ -19,7 +19,7 @@ public:
void start();
void start_forced(RfidReader::Type type);
void stop();
bool read(LfrfidKeyType* type, uint8_t* data, uint8_t data_size);
bool read(LfrfidKeyType* type, uint8_t* data, uint8_t data_size, bool switch_enable = true);
bool detect();
bool any_read();