FuriHal: replace HAL with LL in RFID Part 1. Drop F6. (#1049)
* FuriHal: new speaker HAL * FuriHal: drop PWM * FuriHal: move COMP1 to LL * FuriHal: move COMP1 to LL backport to F6 * FuriHal: remove missing gpio_rfid_carrier from F6 * FurHal: use LL for system controls in flash HAL * Drop F6 source tree * Drop F6 from GitHub workflow * Tie USE_FULL_ASSERT with APP_UNIT_TESTS * Speaker: return to old volume calculation * FreeRTOS: move TCB header to glue Co-authored-by: DrZlo13 <who.just.the.doctor@gmail.com>
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
#include <callback-connector.h>
|
||||
#include <maxim_crc.h>
|
||||
|
||||
extern COMP_HandleTypeDef hcomp1;
|
||||
|
||||
KeyReader::Error KeyReader::read(iButtonKey* key) {
|
||||
uint8_t tmp_key_data[8] = {0, 0, 0, 0, 0, 0, 0, 0};
|
||||
iButtonKeyType key_type;
|
||||
@@ -116,9 +114,9 @@ void KeyReader::start_comaparator(void) {
|
||||
|
||||
comparator_callback_pointer =
|
||||
cbc::obtain_connector(this, &KeyReader::comparator_trigger_callback);
|
||||
api_interrupt_add(comparator_callback_pointer, InterruptTypeComparatorTrigger, this);
|
||||
furi_hal_rfid_comp_set_callback(comparator_callback_pointer, this);
|
||||
last_dwt_value = DWT->CYCCNT;
|
||||
HAL_COMP_Start(&hcomp1);
|
||||
furi_hal_rfid_comp_start();
|
||||
}
|
||||
|
||||
void KeyReader::stop_comaparator(void) {
|
||||
@@ -127,23 +125,19 @@ void KeyReader::stop_comaparator(void) {
|
||||
// rfid_pins_reset will disable ibutton pin
|
||||
furi_hal_ibutton_start();
|
||||
|
||||
HAL_COMP_Stop(&hcomp1);
|
||||
api_interrupt_remove(comparator_callback_pointer, InterruptTypeComparatorTrigger);
|
||||
furi_hal_rfid_comp_stop();
|
||||
furi_hal_rfid_comp_set_callback(NULL, NULL);
|
||||
}
|
||||
|
||||
void KeyReader::comparator_trigger_callback(void* hcomp, void* comp_ctx) {
|
||||
void KeyReader::comparator_trigger_callback(bool level, void* comp_ctx) {
|
||||
KeyReader* _this = static_cast<KeyReader*>(comp_ctx);
|
||||
|
||||
if(hcomp == &hcomp1) {
|
||||
uint32_t current_dwt_value = DWT->CYCCNT;
|
||||
uint32_t current_dwt_value = DWT->CYCCNT;
|
||||
|
||||
_this->cyfral_decoder.process_front(
|
||||
hal_gpio_get_rfid_in_level(), current_dwt_value - last_dwt_value);
|
||||
_this->metakom_decoder.process_front(
|
||||
hal_gpio_get_rfid_in_level(), current_dwt_value - last_dwt_value);
|
||||
_this->cyfral_decoder.process_front(level, current_dwt_value - last_dwt_value);
|
||||
_this->metakom_decoder.process_front(level, current_dwt_value - last_dwt_value);
|
||||
|
||||
last_dwt_value = current_dwt_value;
|
||||
}
|
||||
last_dwt_value = current_dwt_value;
|
||||
}
|
||||
|
||||
void KeyReader::switch_to(ReadMode mode) {
|
||||
|
@@ -28,8 +28,8 @@ private:
|
||||
bool verify_key(iButtonKeyType key_type, const uint8_t* const data, uint8_t data_size);
|
||||
|
||||
// cyfral and metakom readers data
|
||||
void comparator_trigger_callback(void* hcomp, void* comp_ctx);
|
||||
void (*comparator_callback_pointer)(void* hcomp, void* comp_ctx);
|
||||
void comparator_trigger_callback(bool level, void* comp_ctx);
|
||||
void (*comparator_callback_pointer)(bool level, void* comp_ctx);
|
||||
|
||||
void start_comaparator(void);
|
||||
void stop_comaparator(void);
|
||||
@@ -51,4 +51,4 @@ private:
|
||||
|
||||
void switch_to(ReadMode mode);
|
||||
void switch_mode_if_needed();
|
||||
};
|
||||
};
|
||||
|
@@ -2,8 +2,6 @@
|
||||
#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);
|
||||
|
||||
@@ -51,4 +49,4 @@ KeyWorker::KeyWorker(const GpioPin* one_wire_gpio)
|
||||
}
|
||||
|
||||
KeyWorker::~KeyWorker() {
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user