[FL-1629] Better RFID writing (#632)
* RFID: ground the antenna when writing * RFID: forced switch to indala mode
This commit is contained in:
parent
c799fcf416
commit
b8b0417374
@ -20,7 +20,10 @@ void RfidReader::decode(bool polarity) {
|
|||||||
uint32_t period = current_dwt_value - last_dwt_value;
|
uint32_t period = current_dwt_value - last_dwt_value;
|
||||||
last_dwt_value = current_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) {
|
switch(type) {
|
||||||
case Type::Normal:
|
case Type::Normal:
|
||||||
decoder_em.process_front(polarity, period);
|
decoder_em.process_front(polarity, period);
|
||||||
@ -86,20 +89,9 @@ void RfidReader::start() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RfidReader::start_forced(RfidReader::Type _type) {
|
void RfidReader::start_forced(RfidReader::Type _type) {
|
||||||
type = _type;
|
|
||||||
switch(type) {
|
|
||||||
case Type::Normal:
|
|
||||||
start();
|
start();
|
||||||
break;
|
if(_type == Type::Indala) {
|
||||||
case Type::Indala:
|
switch_mode();
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
#include "decoder-indala.h"
|
#include "decoder-indala.h"
|
||||||
#include "key-info.h"
|
#include "key-info.h"
|
||||||
|
|
||||||
|
//#define RFID_GPIO_DEBUG 1
|
||||||
|
|
||||||
class RfidReader {
|
class RfidReader {
|
||||||
public:
|
public:
|
||||||
enum class Type : uint8_t {
|
enum class Type : uint8_t {
|
||||||
@ -26,7 +28,9 @@ private:
|
|||||||
friend struct RfidReaderAccessor;
|
friend struct RfidReaderAccessor;
|
||||||
|
|
||||||
//DecoderAnalyzer decoder_analyzer;
|
//DecoderAnalyzer decoder_analyzer;
|
||||||
//DecoderGpioOut decoder_gpio_out;
|
#ifdef RFID_GPIO_DEBUG
|
||||||
|
DecoderGpioOut decoder_gpio_out;
|
||||||
|
#endif
|
||||||
DecoderEMMarine decoder_em;
|
DecoderEMMarine decoder_em;
|
||||||
DecoderHID26 decoder_hid26;
|
DecoderHID26 decoder_hid26;
|
||||||
DecoderIndala decoder_indala;
|
DecoderIndala decoder_indala;
|
||||||
|
@ -37,6 +37,7 @@ void RfidWriter::start() {
|
|||||||
furi_hal_rfid_tim_read(125000, 0.5);
|
furi_hal_rfid_tim_read(125000, 0.5);
|
||||||
furi_hal_rfid_pins_read();
|
furi_hal_rfid_pins_read();
|
||||||
furi_hal_rfid_tim_read_start();
|
furi_hal_rfid_tim_read_start();
|
||||||
|
hal_gpio_write(&gpio_rfid_pull, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RfidWriter::stop() {
|
void RfidWriter::stop() {
|
||||||
|
Loading…
Reference in New Issue
Block a user