RFID: Fix various EM-Marin typos (#635)

This commit is contained in:
Anna Prosvetova 2021-08-11 02:09:51 +03:00 committed by GitHub
parent b8b0417374
commit b05453ecff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 16 additions and 16 deletions

View File

@ -1,5 +1,5 @@
#include "emmarine.h" #include "emmarin.h"
#include "decoder-emmarine.h" #include "decoder-emmarin.h"
#include <furi.h> #include <furi.h>
#include <furi-hal.h> #include <furi-hal.h>
@ -13,19 +13,19 @@ constexpr uint32_t short_time_high = short_time + jitter_time;
constexpr uint32_t long_time_low = long_time - jitter_time; constexpr uint32_t long_time_low = long_time - jitter_time;
constexpr uint32_t long_time_high = long_time + jitter_time; constexpr uint32_t long_time_high = long_time + jitter_time;
void DecoderEMMarine::reset_state() { void DecoderEMMarin::reset_state() {
ready = false; ready = false;
readed_data = 0; readed_data = 0;
manchester_advance( manchester_advance(
manchester_saved_state, ManchesterEventReset, &manchester_saved_state, nullptr); manchester_saved_state, ManchesterEventReset, &manchester_saved_state, nullptr);
} }
bool DecoderEMMarine::read(uint8_t* data, uint8_t data_size) { bool DecoderEMMarin::read(uint8_t* data, uint8_t data_size) {
bool result = false; bool result = false;
if(ready) { if(ready) {
result = true; result = true;
em_marine.decode( em_marin.decode(
reinterpret_cast<const uint8_t*>(&readed_data), sizeof(uint64_t), data, data_size); reinterpret_cast<const uint8_t*>(&readed_data), sizeof(uint64_t), data, data_size);
ready = false; ready = false;
} }
@ -33,7 +33,7 @@ bool DecoderEMMarine::read(uint8_t* data, uint8_t data_size) {
return result; return result;
} }
void DecoderEMMarine::process_front(bool polarity, uint32_t time) { void DecoderEMMarin::process_front(bool polarity, uint32_t time) {
if(ready) return; if(ready) return;
if(time < short_time_low) return; if(time < short_time_low) return;
@ -61,12 +61,12 @@ void DecoderEMMarine::process_front(bool polarity, uint32_t time) {
if(data_ok) { if(data_ok) {
readed_data = (readed_data << 1) | data; readed_data = (readed_data << 1) | data;
ready = em_marine.can_be_decoded( ready = em_marin.can_be_decoded(
reinterpret_cast<const uint8_t*>(&readed_data), sizeof(uint64_t)); reinterpret_cast<const uint8_t*>(&readed_data), sizeof(uint64_t));
} }
} }
} }
DecoderEMMarine::DecoderEMMarine() { DecoderEMMarin::DecoderEMMarin() {
reset_state(); reset_state();
} }

View File

@ -3,12 +3,12 @@
#include <atomic> #include <atomic>
#include "manchester-decoder.h" #include "manchester-decoder.h"
#include "protocols/protocol-emmarin.h" #include "protocols/protocol-emmarin.h"
class DecoderEMMarine { class DecoderEMMarin {
public: public:
bool read(uint8_t* data, uint8_t data_size); bool read(uint8_t* data, uint8_t data_size);
void process_front(bool polarity, uint32_t time); void process_front(bool polarity, uint32_t time);
DecoderEMMarine(); DecoderEMMarin();
private: private:
void reset_state(); void reset_state();
@ -17,5 +17,5 @@ private:
std::atomic<bool> ready; std::atomic<bool> ready;
ManchesterState manchester_saved_state; ManchesterState manchester_saved_state;
ProtocolEMMarin em_marine; ProtocolEMMarin em_marin;
}; };

View File

@ -1,4 +1,4 @@
#include "encoder-emmarine.h" #include "encoder-emmarin.h"
#include "protocols/protocol-emmarin.h" #include "protocols/protocol-emmarin.h"
#include <furi.h> #include <furi.h>

View File

@ -20,7 +20,7 @@ const char* lfrfid_key_get_type_string(LfrfidKeyType type) {
const char* lfrfid_key_get_manufacturer_string(LfrfidKeyType type) { const char* lfrfid_key_get_manufacturer_string(LfrfidKeyType type) {
switch(type) { switch(type) {
case LfrfidKeyType::KeyEM4100: case LfrfidKeyType::KeyEM4100:
return "Em-Marine"; return "EM-Marin";
break; break;
case LfrfidKeyType::KeyH10301: case LfrfidKeyType::KeyH10301:
return "HID"; return "HID";

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
//#include "decoder-analyzer.h" //#include "decoder-analyzer.h"
#include "decoder-gpio-out.h" #include "decoder-gpio-out.h"
#include "decoder-emmarine.h" #include "decoder-emmarin.h"
#include "decoder-hid26.h" #include "decoder-hid26.h"
#include "decoder-indala.h" #include "decoder-indala.h"
#include "key-info.h" #include "key-info.h"
@ -31,7 +31,7 @@ private:
#ifdef RFID_GPIO_DEBUG #ifdef RFID_GPIO_DEBUG
DecoderGpioOut decoder_gpio_out; DecoderGpioOut decoder_gpio_out;
#endif #endif
DecoderEMMarine decoder_em; DecoderEMMarin decoder_em;
DecoderHID26 decoder_hid26; DecoderHID26 decoder_hid26;
DecoderIndala decoder_indala; DecoderIndala decoder_indala;

View File

@ -2,7 +2,7 @@
#include <furi-hal.h> #include <furi-hal.h>
#include "key-info.h" #include "key-info.h"
#include "encoder-generic.h" #include "encoder-generic.h"
#include "encoder-emmarine.h" #include "encoder-emmarin.h"
#include "encoder-hid-h10301.h" #include "encoder-hid-h10301.h"
#include "encoder-indala-40134.h" #include "encoder-indala-40134.h"
#include "pulse-joiner.h" #include "pulse-joiner.h"