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

RFID: Fix various EM-Marin typos #635

Merged
merged 1 commit into from
Aug 10, 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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "emmarine.h"
#include "decoder-emmarine.h"
#include "emmarin.h"
#include "decoder-emmarin.h"
#include <furi.h>
#include <furi-hal.h>

Expand All @@ -13,27 +13,27 @@ 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_high = long_time + jitter_time;

void DecoderEMMarine::reset_state() {
void DecoderEMMarin::reset_state() {
ready = false;
readed_data = 0;
manchester_advance(
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;

if(ready) {
result = true;
em_marine.decode(
em_marin.decode(
reinterpret_cast<const uint8_t*>(&readed_data), sizeof(uint64_t), data, data_size);
ready = false;
}

return result;
}

void DecoderEMMarine::process_front(bool polarity, uint32_t time) {
void DecoderEMMarin::process_front(bool polarity, uint32_t time) {
if(ready) return;
if(time < short_time_low) return;

Expand Down Expand Up @@ -61,12 +61,12 @@ void DecoderEMMarine::process_front(bool polarity, uint32_t time) {
if(data_ok) {
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));
}
}
}

DecoderEMMarine::DecoderEMMarine() {
DecoderEMMarin::DecoderEMMarin() {
reset_state();
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
#include <atomic>
#include "manchester-decoder.h"
#include "protocols/protocol-emmarin.h"
class DecoderEMMarine {
class DecoderEMMarin {
public:
bool read(uint8_t* data, uint8_t data_size);
void process_front(bool polarity, uint32_t time);

DecoderEMMarine();
DecoderEMMarin();

private:
void reset_state();
Expand All @@ -17,5 +17,5 @@ class DecoderEMMarine {
std::atomic<bool> ready;

ManchesterState manchester_saved_state;
ProtocolEMMarin em_marine;
ProtocolEMMarin em_marin;
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "encoder-emmarine.h"
#include "encoder-emmarin.h"
#include "protocols/protocol-emmarin.h"
#include <furi.h>

Expand Down
2 changes: 1 addition & 1 deletion applications/lfrfid/helpers/key-info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const char* lfrfid_key_get_type_string(LfrfidKeyType type) {
const char* lfrfid_key_get_manufacturer_string(LfrfidKeyType type) {
switch(type) {
case LfrfidKeyType::KeyEM4100:
return "Em-Marine";
return "EM-Marin";
break;
case LfrfidKeyType::KeyH10301:
return "HID";
Expand Down
4 changes: 2 additions & 2 deletions applications/lfrfid/helpers/rfid-reader.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
//#include "decoder-analyzer.h"
#include "decoder-gpio-out.h"
#include "decoder-emmarine.h"
#include "decoder-emmarin.h"
#include "decoder-hid26.h"
#include "decoder-indala.h"
#include "key-info.h"
Expand Down Expand Up @@ -31,7 +31,7 @@ class RfidReader {
#ifdef RFID_GPIO_DEBUG
DecoderGpioOut decoder_gpio_out;
#endif
DecoderEMMarine decoder_em;
DecoderEMMarin decoder_em;
DecoderHID26 decoder_hid26;
DecoderIndala decoder_indala;

Expand Down
2 changes: 1 addition & 1 deletion applications/lfrfid/helpers/rfid-timer-emulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <furi-hal.h>
#include "key-info.h"
#include "encoder-generic.h"
#include "encoder-emmarine.h"
#include "encoder-emmarin.h"
#include "encoder-hid-h10301.h"
#include "encoder-indala-40134.h"
#include "pulse-joiner.h"
Expand Down