Furi: core refactoring and CMSIS removal part 2 (#1410)
* Furi: rename and move core * Furi: drop CMSIS_OS header and unused api, partially refactor and cleanup the rest * Furi: CMSIS_OS drop and refactoring. * Furi: refactoring, remove cmsis legacy * Furi: fix incorrect assert on queue deallocation, cleanup timer * Furi: improve delay api, get rid of floats * hal: dropped furi_hal_crc * Furi: move DWT based delay to cortex HAL * Furi: update core documentation Co-authored-by: hedger <hedger@nanode.su>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#include "rfid_key.h"
|
||||
#include <furi/check.h>
|
||||
#include <core/check.h>
|
||||
#include <string.h>
|
||||
|
||||
RfidKey::RfidKey() {
|
||||
|
@@ -39,12 +39,12 @@ void RfidReader::decode(bool polarity) {
|
||||
}
|
||||
|
||||
bool RfidReader::switch_timer_elapsed() {
|
||||
const uint32_t seconds_to_switch = osKernelGetTickFreq() * 2.0f;
|
||||
return (osKernelGetTickCount() - switch_os_tick_last) > seconds_to_switch;
|
||||
const uint32_t seconds_to_switch = furi_kernel_get_tick_frequency() * 2.0f;
|
||||
return (furi_get_tick() - switch_os_tick_last) > seconds_to_switch;
|
||||
}
|
||||
|
||||
void RfidReader::switch_timer_reset() {
|
||||
switch_os_tick_last = osKernelGetTickCount();
|
||||
switch_os_tick_last = furi_get_tick();
|
||||
}
|
||||
|
||||
void RfidReader::switch_mode() {
|
||||
|
@@ -49,15 +49,15 @@ void RfidWriter::stop() {
|
||||
|
||||
void RfidWriter::write_gap(uint32_t gap_time) {
|
||||
furi_hal_rfid_tim_read_stop();
|
||||
furi_hal_delay_us(gap_time * 8);
|
||||
furi_delay_us(gap_time * 8);
|
||||
furi_hal_rfid_tim_read_start();
|
||||
}
|
||||
|
||||
void RfidWriter::write_bit(bool value) {
|
||||
if(value) {
|
||||
furi_hal_delay_us(T55xxTiming::data_1 * 8);
|
||||
furi_delay_us(T55xxTiming::data_1 * 8);
|
||||
} else {
|
||||
furi_hal_delay_us(T55xxTiming::data_0 * 8);
|
||||
furi_delay_us(T55xxTiming::data_0 * 8);
|
||||
}
|
||||
write_gap(T55xxTiming::write_gap);
|
||||
}
|
||||
@@ -69,7 +69,7 @@ void RfidWriter::write_byte(uint8_t value) {
|
||||
}
|
||||
|
||||
void RfidWriter::write_block(uint8_t page, uint8_t block, bool lock_bit, uint32_t data) {
|
||||
furi_hal_delay_us(T55xxTiming::wait_time * 8);
|
||||
furi_delay_us(T55xxTiming::wait_time * 8);
|
||||
|
||||
// start gap
|
||||
write_gap(T55xxTiming::start_gap);
|
||||
@@ -102,9 +102,9 @@ void RfidWriter::write_block(uint8_t page, uint8_t block, bool lock_bit, uint32_
|
||||
write_bit((block >> 1) & 1);
|
||||
write_bit((block >> 0) & 1);
|
||||
|
||||
furi_hal_delay_us(T55xxTiming::program * 8);
|
||||
furi_delay_us(T55xxTiming::program * 8);
|
||||
|
||||
furi_hal_delay_us(T55xxTiming::wait_time * 8);
|
||||
furi_delay_us(T55xxTiming::wait_time * 8);
|
||||
write_reset();
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#include "lfrfid_app.h"
|
||||
#include "assets_icons.h"
|
||||
#include "furi/common_defines.h"
|
||||
#include <core/common_defines.h>
|
||||
#include "m-string.h"
|
||||
#include "scene/lfrfid_app_scene_start.h"
|
||||
#include "scene/lfrfid_app_scene_read.h"
|
||||
|
@@ -94,7 +94,7 @@ static void lfrfid_cli_read(Cli* cli, string_t args) {
|
||||
printf("\r\n");
|
||||
break;
|
||||
}
|
||||
furi_hal_delay_ms(100);
|
||||
furi_delay_ms(100);
|
||||
}
|
||||
|
||||
printf("Reading stopped\r\n");
|
||||
@@ -144,7 +144,7 @@ static void lfrfid_cli_emulate(Cli* cli, string_t args) {
|
||||
|
||||
printf("Emulating RFID...\r\nPress Ctrl+C to abort\r\n");
|
||||
while(!cli_cmd_interrupt_received(cli)) {
|
||||
furi_hal_delay_ms(100);
|
||||
furi_delay_ms(100);
|
||||
}
|
||||
printf("Emulation stopped\r\n");
|
||||
emulator.stop();
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#include "lfrfid_app_scene_emulate.h"
|
||||
#include "furi/common_defines.h"
|
||||
#include <core/common_defines.h>
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
static const NotificationSequence sequence_blink_start_magenta = {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#include "lfrfid_app_scene_rpc.h"
|
||||
#include "furi/common_defines.h"
|
||||
#include <core/common_defines.h>
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
void LfRfidAppSceneRpc::on_enter(LfRfidApp* app, bool /* need_restore */) {
|
||||
|
Reference in New Issue
Block a user