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:
@@ -77,8 +77,8 @@ static void
|
||||
.event = event,
|
||||
.len = len << 8 | len >> 8,
|
||||
};
|
||||
xStreamBufferSend(instance->stream, &pkt_hdr, sizeof(pkt_hdr), osWaitForever);
|
||||
xStreamBufferSend(instance->stream, data, len, osWaitForever);
|
||||
xStreamBufferSend(instance->stream, &pkt_hdr, sizeof(pkt_hdr), FuriWaitForever);
|
||||
xStreamBufferSend(instance->stream, data, len, FuriWaitForever);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -40,7 +40,7 @@ static void nfc_cli_detect(Cli* cli, string_t args) {
|
||||
break;
|
||||
}
|
||||
furi_hal_nfc_sleep();
|
||||
osDelay(50);
|
||||
furi_delay_ms(50);
|
||||
}
|
||||
furi_hal_nfc_sleep();
|
||||
}
|
||||
@@ -70,7 +70,7 @@ static void nfc_cli_emulate(Cli* cli, string_t args) {
|
||||
printf("Reader detected\r\n");
|
||||
furi_hal_nfc_sleep();
|
||||
}
|
||||
osDelay(50);
|
||||
furi_delay_ms(50);
|
||||
}
|
||||
furi_hal_nfc_sleep();
|
||||
}
|
||||
@@ -90,7 +90,7 @@ static void nfc_cli_field(Cli* cli, string_t args) {
|
||||
printf("Press Ctrl+C to abort\r\n");
|
||||
|
||||
while(!cli_cmd_interrupt_received(cli)) {
|
||||
osDelay(50);
|
||||
furi_delay_ms(50);
|
||||
}
|
||||
|
||||
furi_hal_nfc_field_off();
|
||||
|
@@ -23,7 +23,7 @@ NfcWorker* nfc_worker_alloc() {
|
||||
|
||||
// Initialize rfal
|
||||
while(furi_hal_nfc_is_busy()) {
|
||||
osDelay(10);
|
||||
furi_delay_ms(10);
|
||||
}
|
||||
nfc_worker_change_state(nfc_worker, NfcWorkerStateReady);
|
||||
|
||||
@@ -59,7 +59,7 @@ void nfc_worker_start(
|
||||
furi_assert(nfc_worker);
|
||||
furi_assert(dev_data);
|
||||
while(furi_hal_nfc_is_busy()) {
|
||||
osDelay(10);
|
||||
furi_delay_ms(10);
|
||||
}
|
||||
|
||||
nfc_worker->callback = callback;
|
||||
@@ -148,7 +148,7 @@ void nfc_worker_detect(NfcWorker* nfc_worker) {
|
||||
break;
|
||||
}
|
||||
furi_hal_nfc_sleep();
|
||||
osDelay(100);
|
||||
furi_delay_ms(100);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ void nfc_worker_read_emv_app(NfcWorker* nfc_worker) {
|
||||
FURI_LOG_D(TAG, "Can't find any cards");
|
||||
}
|
||||
furi_hal_nfc_sleep();
|
||||
osDelay(20);
|
||||
furi_delay_ms(20);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ void nfc_worker_read_emv(NfcWorker* nfc_worker) {
|
||||
FURI_LOG_D(TAG, "Can't find any cards");
|
||||
}
|
||||
furi_hal_nfc_sleep();
|
||||
osDelay(20);
|
||||
furi_delay_ms(20);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ void nfc_worker_emulate_apdu(NfcWorker* nfc_worker) {
|
||||
FURI_LOG_D(TAG, "Can't find reader");
|
||||
}
|
||||
furi_hal_nfc_sleep();
|
||||
osDelay(20);
|
||||
furi_delay_ms(20);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@ void nfc_worker_read_mifare_ultralight(NfcWorker* nfc_worker) {
|
||||
FURI_LOG_D(TAG, "Can't find any tags");
|
||||
}
|
||||
furi_hal_nfc_sleep();
|
||||
osDelay(100);
|
||||
furi_delay_ms(100);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -434,7 +434,7 @@ void nfc_worker_mifare_classic_dict_attack(NfcWorker* nfc_worker) {
|
||||
}
|
||||
}
|
||||
if(nfc_worker->state != NfcWorkerStateReadMifareClassic) break;
|
||||
osDelay(1);
|
||||
furi_delay_tick(1);
|
||||
}
|
||||
if(nfc_worker->state != NfcWorkerStateReadMifareClassic) break;
|
||||
if(sector_key_found) {
|
||||
@@ -529,14 +529,14 @@ void nfc_worker_read_mifare_desfire(NfcWorker* nfc_worker) {
|
||||
while(nfc_worker->state == NfcWorkerStateReadMifareDesfire) {
|
||||
furi_hal_nfc_sleep();
|
||||
if(!furi_hal_nfc_detect(nfc_data, 300)) {
|
||||
osDelay(100);
|
||||
furi_delay_ms(100);
|
||||
continue;
|
||||
}
|
||||
memset(data, 0, sizeof(MifareDesfireData));
|
||||
if(nfc_data->type != FuriHalNfcTypeA ||
|
||||
!mf_df_check_card_type(nfc_data->atqa[0], nfc_data->atqa[1], nfc_data->sak)) {
|
||||
FURI_LOG_D(TAG, "Tag is not DESFire");
|
||||
osDelay(100);
|
||||
furi_delay_ms(100);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#include "../nfc_i.h"
|
||||
#include "furi/common_defines.h"
|
||||
#include <core/common_defines.h>
|
||||
|
||||
void nfc_scene_emulate_apdu_sequence_on_enter(void* context) {
|
||||
Nfc* nfc = context;
|
||||
|
Reference in New Issue
Block a user