Naming and coding style convention, new linter tool. (#945)
* Makefile, Scripts: new linter * About: remove ID from IC * Firmware: remove double define for DIVC/DIVR * Scripts: check folder names too. Docker: replace syntax check with make lint. * Reformat Sources and Migrate to new file naming convention * Docker: symlink clang-format-12 to clang-format * Add coding style guide
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
#include "key_worker.h"
|
||||
#include <callback-connector.h>
|
||||
#include <maxim_crc.h>
|
||||
|
||||
extern COMP_HandleTypeDef hcomp1;
|
||||
|
||||
KeyReader::Error KeyWorker::read(iButtonKey* key) {
|
||||
KeyReader::Error result = key_reader.read(key);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void KeyWorker::start_read() {
|
||||
key_reader.start();
|
||||
}
|
||||
|
||||
void KeyWorker::stop_read() {
|
||||
key_reader.stop();
|
||||
}
|
||||
|
||||
bool KeyWorker::emulated() {
|
||||
return key_emulator.emulated();
|
||||
}
|
||||
|
||||
void KeyWorker::start_emulate(iButtonKey* key) {
|
||||
key_emulator.start(key);
|
||||
}
|
||||
|
||||
void KeyWorker::stop_emulate() {
|
||||
key_emulator.stop();
|
||||
}
|
||||
|
||||
KeyWriter::Error KeyWorker::write(iButtonKey* key) {
|
||||
return key_writer.write(key);
|
||||
}
|
||||
|
||||
void KeyWorker::start_write() {
|
||||
key_writer.start();
|
||||
}
|
||||
|
||||
void KeyWorker::stop_write() {
|
||||
key_writer.stop();
|
||||
}
|
||||
|
||||
KeyWorker::KeyWorker(const GpioPin* one_wire_gpio)
|
||||
: onewire_master{one_wire_gpio}
|
||||
, onewire_slave{one_wire_gpio}
|
||||
, key_reader{&onewire_master}
|
||||
, key_emulator{&onewire_slave}
|
||||
, key_writer{&onewire_master} {
|
||||
}
|
||||
|
||||
KeyWorker::~KeyWorker() {
|
||||
}
|
||||
Reference in New Issue
Block a user