Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FL-1629] Better RFID writing #632

Merged
merged 2 commits into from
Aug 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 7 additions & 15 deletions applications/lfrfid/helpers/rfid-reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ void RfidReader::decode(bool polarity) {
uint32_t period = current_dwt_value - last_dwt_value;
last_dwt_value = current_dwt_value;

//decoder_gpio_out.process_front(polarity, period);
#ifdef RFID_GPIO_DEBUG
decoder_gpio_out.process_front(polarity, period);
#endif

switch(type) {
case Type::Normal:
decoder_em.process_front(polarity, period);
Expand Down Expand Up @@ -86,20 +89,9 @@ void RfidReader::start() {
}

void RfidReader::start_forced(RfidReader::Type _type) {
type = _type;
switch(type) {
case Type::Normal:
start();
break;
case Type::Indala:
furi_hal_rfid_pins_read();
furi_hal_rfid_tim_read(62500.0f, 0.25f);
furi_hal_rfid_tim_read_start();
start_comparator();

switch_timer_reset();
last_readed_count = 0;
break;
start();
if(_type == Type::Indala) {
switch_mode();
}
}

Expand Down
6 changes: 5 additions & 1 deletion applications/lfrfid/helpers/rfid-reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include "decoder-indala.h"
#include "key-info.h"

//#define RFID_GPIO_DEBUG 1

class RfidReader {
public:
enum class Type : uint8_t {
Expand All @@ -26,7 +28,9 @@ class RfidReader {
friend struct RfidReaderAccessor;

//DecoderAnalyzer decoder_analyzer;
//DecoderGpioOut decoder_gpio_out;
#ifdef RFID_GPIO_DEBUG
DecoderGpioOut decoder_gpio_out;
#endif
DecoderEMMarine decoder_em;
DecoderHID26 decoder_hid26;
DecoderIndala decoder_indala;
Expand Down
1 change: 1 addition & 0 deletions applications/lfrfid/helpers/rfid-writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ void RfidWriter::start() {
furi_hal_rfid_tim_read(125000, 0.5);
furi_hal_rfid_pins_read();
furi_hal_rfid_tim_read_start();
hal_gpio_write(&gpio_rfid_pull, true);
}

void RfidWriter::stop() {
Expand Down