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:
あく
2022-07-20 13:56:33 +03:00
committed by GitHub
parent f9c2287ea7
commit e3c7201a20
264 changed files with 2569 additions and 3883 deletions

View File

@@ -1,6 +1,6 @@
#include "encoder.h"
#include "math.h"
#include <furi/check.h>
#include <core/check.h>
#define TAG "SubGhzBlockEncoder"
@@ -42,4 +42,4 @@ size_t subghz_protocol_blocks_get_upload(
upload[size_upload++] = level_duration_make(
subghz_protocol_blocks_get_bit_array(data_array, index_bit - 1), duration);
return size_upload;
}
}

View File

@@ -76,9 +76,8 @@ void subghz_encoder_princeton_for_testing_set(
instance->count_key = instance->count_key_package + 3;
if((furi_hal_get_tick() - instance->time_stop) < instance->timeout) {
instance->time_stop =
(instance->timeout - (furi_hal_get_tick() - instance->time_stop)) * 1000;
if((furi_get_tick() - instance->time_stop) < instance->timeout) {
instance->time_stop = (instance->timeout - (furi_get_tick() - instance->time_stop)) * 1000;
} else {
instance->time_stop = 0;
}

View File

@@ -287,7 +287,7 @@ static bool subghz_protocol_encoder_raw_worker_init(SubGhzProtocolEncoderRAW* in
if(subghz_file_encoder_worker_start(
instance->file_worker_encoder, string_get_cstr(instance->file_name))) {
//the worker needs a file in order to open and read part of the file
osDelay(100);
furi_delay_ms(100);
instance->is_runing = true;
} else {
subghz_protocol_encoder_raw_stop(instance);

View File

@@ -153,19 +153,19 @@ static int32_t subghz_file_encoder_worker_thread(void* context) {
break;
}
}
osDelay(5);
furi_delay_ms(5);
}
//waiting for the end of the transfer
FURI_LOG_I(TAG, "End read file");
while(!furi_hal_subghz_is_async_tx_complete() && instance->worker_running) {
osDelay(5);
furi_delay_ms(5);
}
FURI_LOG_I(TAG, "End transmission");
while(instance->worker_running) {
if(instance->worker_stoping) {
if(instance->callback_end) instance->callback_end(instance->context_end);
}
osDelay(50);
furi_delay_ms(50);
}
flipper_format_file_close(instance->flipper_format);

View File

@@ -68,11 +68,11 @@ bool subghz_tx_rx_worker_rx(SubGhzTxRxWorker* instance, uint8_t* data, uint8_t*
if(instance->status != SubGhzTxRxWorkerStatusRx) {
furi_hal_subghz_rx();
instance->status = SubGhzTxRxWorkerStatusRx;
osDelay(1);
furi_delay_tick(1);
}
//waiting for reception to complete
while(furi_hal_gpio_read(&gpio_cc1101_g0)) {
osDelay(1);
furi_delay_tick(1);
if(!--timeout) {
FURI_LOG_W(TAG, "RX cc1101_g0 timeout");
furi_hal_subghz_flush_rx();
@@ -106,14 +106,14 @@ void subghz_tx_rx_worker_tx(SubGhzTxRxWorker* instance, uint8_t* data, size_t si
furi_hal_subghz_tx(); //start send
instance->status = SubGhzTxRxWorkerStatusTx;
while(!furi_hal_gpio_read(&gpio_cc1101_g0)) { // Wait for GDO0 to be set -> sync transmitted
osDelay(1);
furi_delay_tick(1);
if(!--timeout) {
FURI_LOG_W(TAG, "TX !cc1101_g0 timeout");
break;
}
}
while(furi_hal_gpio_read(&gpio_cc1101_g0)) { // Wait for GDO0 to be cleared -> end of packet
osDelay(1);
furi_delay_tick(1);
if(!--timeout) {
FURI_LOG_W(TAG, "TX cc1101_g0 timeout");
break;
@@ -189,7 +189,7 @@ static int32_t subghz_tx_rx_worker_thread(void* context) {
}
if(timeout_tx) timeout_tx--;
osDelay(1);
furi_delay_tick(1);
}
furi_hal_subghz_set_path(FuriHalSubGhzPathIsolate);