mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-27 01:58:09 -07:00
Merge branch 'DarkFlippers:dev' into dev
This commit is contained in:
+1
-1
@@ -23,7 +23,7 @@ env.Append(
|
||||
env.Append(
|
||||
CPPPATH=[
|
||||
"#/",
|
||||
"#/lib", # TODO: remove!
|
||||
"#/lib", # TODO FL-3553: remove!
|
||||
"#/lib/mlib",
|
||||
# Ugly hack
|
||||
Dir("../assets/compiled"),
|
||||
|
||||
@@ -69,7 +69,7 @@ static bool bq27220_parameter_check(
|
||||
|
||||
uint8_t checksum = bq27220_get_checksum(buffer, size + 2);
|
||||
buffer[0] = checksum;
|
||||
buffer[1] = 4 + size; // TODO: why 4?
|
||||
buffer[1] = 4 + size; // TODO FL-3519: why 4?
|
||||
if(!furi_hal_i2c_write_mem(
|
||||
handle, BQ27220_ADDRESS, CommandMACDataSum, buffer, 2, BQ27220_I2C_TIMEOUT)) {
|
||||
FURI_LOG_I(TAG, "CRC write failed");
|
||||
|
||||
@@ -16,7 +16,7 @@ extern "C" {
|
||||
#define FAP_MANIFEST_SUPPORTED_VERSION 1
|
||||
|
||||
#define FAP_MANIFEST_MAX_APP_NAME_LENGTH 32
|
||||
#define FAP_MANIFEST_MAX_ICON_SIZE 32 // TODO: reduce size?
|
||||
#define FAP_MANIFEST_MAX_ICON_SIZE 32 // TODO FL-3524: reduce size?
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "storage/storage.h"
|
||||
#include <elf.h>
|
||||
#include "elf_file.h"
|
||||
#include "elf_file_i.h"
|
||||
@@ -57,6 +58,13 @@ static void address_cache_put(AddressCache_t cache, int symEntry, Elf32_Addr sym
|
||||
/********************************************** ELF ***********************************************/
|
||||
/**************************************************************************************************/
|
||||
|
||||
static void elf_file_maybe_release_fd(ELFFile* elf) {
|
||||
if(elf->fd) {
|
||||
storage_file_free(elf->fd);
|
||||
elf->fd = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static ELFSection* elf_file_get_section(ELFFile* elf, const char* name) {
|
||||
return ELFSectionDict_get(elf->sections, name);
|
||||
}
|
||||
@@ -507,7 +515,7 @@ static SectionType elf_preload_section(
|
||||
#endif
|
||||
|
||||
// ignore .ARM and .rel.ARM sections
|
||||
// TODO: how to do it not by name?
|
||||
// TODO FL-3525: how to do it not by name?
|
||||
// .ARM: type 0x70000001, flags SHF_ALLOC | SHF_LINK_ORDER
|
||||
// .rel.ARM: type 0x9, flags SHT_REL
|
||||
if(str_prefix(name, ".ARM.") || str_prefix(name, ".rel.ARM.") ||
|
||||
@@ -764,7 +772,7 @@ void elf_file_free(ELFFile* elf) {
|
||||
free(elf->debug_link_info.debug_link);
|
||||
}
|
||||
|
||||
storage_file_free(elf->fd);
|
||||
elf_file_maybe_release_fd(elf);
|
||||
free(elf);
|
||||
}
|
||||
|
||||
@@ -792,7 +800,7 @@ bool elf_file_load_section_table(ELFFile* elf) {
|
||||
FuriString* name = furi_string_alloc();
|
||||
|
||||
FURI_LOG_D(TAG, "Scan ELF indexs...");
|
||||
// TODO: why we start from 1?
|
||||
// TODO FL-3526: why we start from 1?
|
||||
for(size_t section_idx = 1; section_idx < elf->sections_count; section_idx++) {
|
||||
Elf32_Shdr section_header;
|
||||
|
||||
@@ -828,7 +836,7 @@ ElfProcessSectionResult elf_process_section(
|
||||
Elf32_Shdr section_header;
|
||||
|
||||
// find section
|
||||
// TODO: why we start from 1?
|
||||
// TODO FL-3526: why we start from 1?
|
||||
for(size_t section_idx = 1; section_idx < elf->sections_count; section_idx++) {
|
||||
furi_string_reset(section_name);
|
||||
if(!elf_read_section(elf, section_idx, §ion_header, section_name)) {
|
||||
@@ -855,6 +863,7 @@ ElfProcessSectionResult elf_process_section(
|
||||
}
|
||||
|
||||
ELFFileLoadStatus elf_file_load_sections(ELFFile* elf) {
|
||||
furi_check(elf->fd != NULL);
|
||||
ELFFileLoadStatus status = ELFFileLoadStatusSuccess;
|
||||
ELFSectionDict_it_t it;
|
||||
|
||||
@@ -895,6 +904,7 @@ ELFFileLoadStatus elf_file_load_sections(ELFFile* elf) {
|
||||
FURI_LOG_I(TAG, "Total size of loaded sections: %zu", total_size);
|
||||
}
|
||||
|
||||
elf_file_maybe_release_fd(elf);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ void ibutton_worker_mode_write_blank_tick(iButtonWorker* worker) {
|
||||
furi_assert(worker->key);
|
||||
|
||||
const bool success = ibutton_protocols_write_blank(worker->protocols, worker->key);
|
||||
// TODO: pass a proper result to the callback
|
||||
// TODO FL-3527: pass a proper result to the callback
|
||||
const iButtonWorkerWriteResult result = success ? iButtonWorkerWriteOK :
|
||||
iButtonWorkerWriteNoDetect;
|
||||
if(worker->write_cb != NULL) {
|
||||
@@ -139,7 +139,7 @@ void ibutton_worker_mode_write_copy_tick(iButtonWorker* worker) {
|
||||
furi_assert(worker->key);
|
||||
|
||||
const bool success = ibutton_protocols_write_copy(worker->protocols, worker->key);
|
||||
// TODO: pass a proper result to the callback
|
||||
// TODO FL-3527: pass a proper result to the callback
|
||||
const iButtonWorkerWriteResult result = success ? iButtonWorkerWriteOK :
|
||||
iButtonWorkerWriteNoDetect;
|
||||
if(worker->write_cb != NULL) {
|
||||
|
||||
@@ -62,7 +62,7 @@ bool rw1990_write_v1(OneWireHost* host, const uint8_t* data, size_t data_size) {
|
||||
onewire_host_write_bit(host, true);
|
||||
furi_delay_us(10000);
|
||||
|
||||
// TODO: Better error handling
|
||||
// TODO FL-3528: Better error handling
|
||||
return rw1990_read_and_compare(host, data, data_size);
|
||||
}
|
||||
|
||||
@@ -90,6 +90,6 @@ bool rw1990_write_v2(OneWireHost* host, const uint8_t* data, size_t data_size) {
|
||||
onewire_host_write_bit(host, false);
|
||||
furi_delay_us(10000);
|
||||
|
||||
// TODO: Better error handling
|
||||
// TODO Fl-3528: Better error handling
|
||||
return rw1990_read_and_compare(host, data, data_size);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ bool tm2004_write(OneWireHost* host, const uint8_t* data, size_t data_size) {
|
||||
|
||||
onewire_host_write(host, data[i]);
|
||||
answer = onewire_host_read(host);
|
||||
// TODO: check answer CRC
|
||||
// TODO FL-3529: check answer CRC
|
||||
|
||||
// pulse indicating that data is correct
|
||||
furi_delay_us(600);
|
||||
@@ -37,6 +37,6 @@ bool tm2004_write(OneWireHost* host, const uint8_t* data, size_t data_size) {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Better error handling
|
||||
// TODO FL-3529: Better error handling
|
||||
return i == data_size;
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ bool dallas_common_emulate_search_rom(OneWireSlave* bus, const DallasCommonRomDa
|
||||
if(!onewire_slave_send_bit(bus, !bit)) return false;
|
||||
|
||||
onewire_slave_receive_bit(bus);
|
||||
// TODO: check for errors and return if any
|
||||
// TODO FL-3530: check for errors and return if any
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ const iButtonProtocolDallasBase ibutton_protocol_ds1971 = {
|
||||
.name = DS1971_FAMILY_NAME,
|
||||
|
||||
.read = dallas_ds1971_read,
|
||||
.write_blank = NULL, // TODO: Implement writing to blank
|
||||
.write_blank = NULL, // TODO FL-3531: Implement writing to blank
|
||||
.write_copy = dallas_ds1971_write_copy,
|
||||
.emulate = dallas_ds1971_emulate,
|
||||
.save = dallas_ds1971_save,
|
||||
|
||||
@@ -73,7 +73,7 @@ bool dallas_ds1992_read(OneWireHost* host, iButtonProtocolData* protocol_data) {
|
||||
|
||||
bool dallas_ds1992_write_blank(OneWireHost* host, iButtonProtocolData* protocol_data) {
|
||||
DS1992ProtocolData* data = protocol_data;
|
||||
// TODO: Make this work, currently broken
|
||||
// TODO FL-3532: Make this work, currently broken
|
||||
return tm2004_write(host, (uint8_t*)data, sizeof(DallasCommonRomData) + DS1992_SRAM_DATA_SIZE);
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ static bool dallas_ds1996_command_callback(uint8_t command, void* context) {
|
||||
|
||||
case DALLAS_COMMON_CMD_MATCH_ROM:
|
||||
case DALLAS_COMMON_CMD_OVERDRIVE_MATCH_ROM:
|
||||
/* TODO: Match ROM command support */
|
||||
/* TODO FL-3533: Match ROM command support */
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -17,13 +17,13 @@ bool lfrfid_dict_file_save(ProtocolDict* dict, ProtocolId protocol, const char*
|
||||
if(!flipper_format_file_open_always(file, filename)) break;
|
||||
if(!flipper_format_write_header_cstr(file, LFRFID_DICT_FILETYPE, 1)) break;
|
||||
|
||||
// TODO: write comment about protocol types into file
|
||||
// TODO FL-3517: write comment about protocol types into file
|
||||
|
||||
if(!flipper_format_write_string_cstr(
|
||||
file, "Key type", protocol_dict_get_name(dict, protocol)))
|
||||
break;
|
||||
|
||||
// TODO: write comment about protocol sizes into file
|
||||
// TODO FL-3517: write comment about protocol sizes into file
|
||||
|
||||
protocol_dict_get_data(dict, protocol, data, data_size);
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ typedef enum {
|
||||
} LFRFIDWorkerReadType;
|
||||
|
||||
typedef enum {
|
||||
LFRFIDWorkerReadSenseStart, // TODO: not implemented
|
||||
LFRFIDWorkerReadSenseEnd, // TODO: not implemented
|
||||
LFRFIDWorkerReadSenseStart, // TODO FL-3516: not implemented
|
||||
LFRFIDWorkerReadSenseEnd, // TODO FL-3516: not implemented
|
||||
LFRFIDWorkerReadSenseCardStart,
|
||||
LFRFIDWorkerReadSenseCardEnd,
|
||||
LFRFIDWorkerReadStartASK,
|
||||
|
||||
@@ -193,7 +193,7 @@ bool protocol_hid_ex_generic_write_data(ProtocolHIDEx* protocol, void* data) {
|
||||
};
|
||||
|
||||
void protocol_hid_ex_generic_render_data(ProtocolHIDEx* protocol, FuriString* result) {
|
||||
// TODO: parser and render functions
|
||||
// TODO FL-3518: parser and render functions
|
||||
UNUSED(protocol);
|
||||
furi_string_printf(result, "Generic HID Extended\r\nData: Unknown");
|
||||
};
|
||||
|
||||
@@ -38,7 +38,7 @@ uint8_t bit_lib_get_bits(const uint8_t* data, size_t position, uint8_t length) {
|
||||
if(shift == 0) {
|
||||
return data[position / 8] >> (8 - length);
|
||||
} else {
|
||||
// TODO fix read out of bounds
|
||||
// TODO FL-3534: fix read out of bounds
|
||||
uint8_t value = (data[position / 8] << (shift));
|
||||
value |= data[position / 8 + 1] >> (8 - shift);
|
||||
value = value >> (8 - length);
|
||||
|
||||
+1
-1
Submodule lib/littlefs updated: 40dba4a556...611c9b20db
@@ -29,7 +29,7 @@ ReturnCode nfcv_inventory(uint8_t* uid) {
|
||||
ReturnCode ret = ERR_NONE;
|
||||
|
||||
for(int tries = 0; tries < NFCV_COMMAND_RETRIES; tries++) {
|
||||
/* TODO: needs proper abstraction via fury_hal(_ll)_* */
|
||||
/* TODO: needs proper abstraction via furi_hal(_ll)_* */
|
||||
ret = rfalNfcvPollerInventory(RFAL_NFCV_NUM_SLOTS_1, 0, NULL, &res, &received);
|
||||
|
||||
if(ret == ERR_NONE) {
|
||||
@@ -89,7 +89,7 @@ ReturnCode nfcv_read_sysinfo(FuriHalNfcDevData* nfc_data, NfcVData* nfcv_data) {
|
||||
FURI_LOG_D(TAG, "Read SYSTEM INFORMATION...");
|
||||
|
||||
for(int tries = 0; tries < NFCV_COMMAND_RETRIES; tries++) {
|
||||
/* TODO: needs proper abstraction via fury_hal(_ll)_* */
|
||||
/* TODO: needs proper abstraction via furi_hal(_ll)_* */
|
||||
ret = rfalNfcvPollerGetSystemInformation(
|
||||
RFAL_NFCV_REQ_FLAG_DEFAULT, NULL, rxBuf, sizeof(rxBuf), &received);
|
||||
|
||||
|
||||
@@ -59,7 +59,6 @@ int __wrap_fflush(FILE* stream) {
|
||||
__attribute__((__noreturn__)) void __wrap___assert(const char* file, int line, const char* e) {
|
||||
UNUSED(file);
|
||||
UNUSED(line);
|
||||
// TODO: message file and line number
|
||||
furi_crash(e);
|
||||
}
|
||||
|
||||
@@ -68,6 +67,5 @@ __attribute__((__noreturn__)) void
|
||||
UNUSED(file);
|
||||
UNUSED(line);
|
||||
UNUSED(func);
|
||||
// TODO: message file and line number
|
||||
furi_crash(e);
|
||||
}
|
||||
@@ -22,7 +22,7 @@ void subghz_device_registry_init(void) {
|
||||
SUBGHZ_RADIO_DEVICE_PLUGIN_API_VERSION,
|
||||
firmware_api_interface);
|
||||
|
||||
//ToDo: fix path to plugins
|
||||
//TODO FL-3556: fix path to plugins
|
||||
if(plugin_manager_load_all(subghz_device->manager, "/any/apps_data/subghz/plugins") !=
|
||||
//if(plugin_manager_load_all(subghz_device->manager, APP_DATA_PATH("plugins")) !=
|
||||
PluginManagerErrorNone) {
|
||||
|
||||
@@ -744,7 +744,7 @@ static bool
|
||||
|
||||
bin_raw_debug("\r\n\r\n");
|
||||
#endif
|
||||
//todo can be optimized
|
||||
//TODO FL-3557: can be optimized
|
||||
BinRAW_Markup markup_temp[BIN_RAW_MAX_MARKUP_COUNT];
|
||||
memcpy(
|
||||
markup_temp,
|
||||
@@ -770,7 +770,7 @@ static bool
|
||||
}
|
||||
}
|
||||
}
|
||||
//todo can be optimized
|
||||
//TODO FL-3557: can be optimized
|
||||
if(bin_raw_type == BinRAWTypeGap) {
|
||||
if(data_temp != 0) { //there are sequences with the same number of bits
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@ SubGhzProtocolStatus
|
||||
furi_assert(context);
|
||||
UNUSED(context);
|
||||
UNUSED(flipper_format);
|
||||
//ToDo stub, for backwards compatibility
|
||||
// stub, for backwards compatibility
|
||||
return SubGhzProtocolStatusOk;
|
||||
}
|
||||
|
||||
@@ -273,7 +273,6 @@ void subghz_protocol_decoder_raw_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
//SubGhzProtocolDecoderRAW* instance = context;
|
||||
UNUSED(context);
|
||||
//ToDo no use
|
||||
furi_string_cat_printf(output, "RAW Data");
|
||||
}
|
||||
|
||||
|
||||
@@ -255,7 +255,7 @@ void subghz_setting_load(SubGhzSetting* instance, const char* file_path) {
|
||||
}
|
||||
while(flipper_format_read_uint32(
|
||||
fff_data_file, "Frequency", (uint32_t*)&temp_data32, 1)) {
|
||||
//Todo: add a frequency support check depending on the selected radio device
|
||||
//Todo FL-3535: add a frequency support check depending on the selected radio device
|
||||
if(furi_hal_subghz_is_frequency_valid(temp_data32)) {
|
||||
FURI_LOG_I(TAG, "Frequency loaded %lu", temp_data32);
|
||||
FrequencyList_push_back(instance->frequencies, temp_data32);
|
||||
|
||||
@@ -165,7 +165,7 @@ static int32_t subghz_tx_rx_worker_thread(void* context) {
|
||||
SUBGHZ_TXRX_WORKER_TIMEOUT_READ_WRITE_BUF);
|
||||
subghz_tx_rx_worker_tx(instance, data, SUBGHZ_TXRX_WORKER_MAX_TXRX_SIZE);
|
||||
} else {
|
||||
//todo checking that he managed to write all the data to the TX buffer
|
||||
//TODO FL-3554: checking that it managed to write all the data to the TX buffer
|
||||
furi_stream_buffer_receive(
|
||||
instance->stream_tx, &data, size_tx, SUBGHZ_TXRX_WORKER_TIMEOUT_READ_WRITE_BUF);
|
||||
subghz_tx_rx_worker_tx(instance, data, size_tx);
|
||||
@@ -178,7 +178,7 @@ static int32_t subghz_tx_rx_worker_thread(void* context) {
|
||||
furi_stream_buffer_bytes_available(instance->stream_rx) == 0) {
|
||||
callback_rx = true;
|
||||
}
|
||||
//todo checking that he managed to write all the data to the RX buffer
|
||||
//TODO FL-3554: checking that it managed to write all the data to the RX buffer
|
||||
furi_stream_buffer_send(
|
||||
instance->stream_rx,
|
||||
&data,
|
||||
@@ -189,7 +189,7 @@ static int32_t subghz_tx_rx_worker_thread(void* context) {
|
||||
callback_rx = false;
|
||||
}
|
||||
} else {
|
||||
//todo RX buffer overflow
|
||||
//TODO FL-3555: RX buffer overflow
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#define CRC_DATA_BUFFER_MAX_LEN 512
|
||||
|
||||
uint32_t crc32_calc_buffer(uint32_t crc, const void* buffer, size_t size) {
|
||||
// TODO: consider removing dependency on LFS
|
||||
// TODO FL-3547: consider removing dependency on LFS
|
||||
return ~lfs_crc(~crc, buffer, size);
|
||||
}
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ static size_t file_stream_size(FileStream* stream) {
|
||||
}
|
||||
|
||||
static size_t file_stream_write(FileStream* stream, const uint8_t* data, size_t size) {
|
||||
// TODO cache
|
||||
// TODO FL-3545: cache
|
||||
size_t need_to_write = size;
|
||||
while(need_to_write > 0) {
|
||||
uint16_t was_written =
|
||||
@@ -148,7 +148,7 @@ static size_t file_stream_write(FileStream* stream, const uint8_t* data, size_t
|
||||
}
|
||||
|
||||
static size_t file_stream_read(FileStream* stream, uint8_t* data, size_t size) {
|
||||
// TODO cache
|
||||
// TODO FL-3545: cache
|
||||
size_t need_to_read = size;
|
||||
while(need_to_read > 0) {
|
||||
uint16_t was_read =
|
||||
@@ -172,7 +172,7 @@ static bool file_stream_delete_and_insert(
|
||||
// open scratchpad
|
||||
Stream* scratch_stream = file_stream_alloc(_stream->storage);
|
||||
|
||||
// TODO: we need something like "storage_open_tmpfile and storage_close_tmpfile"
|
||||
// TODO FL-3546: we need something like "storage_open_tmpfile and storage_close_tmpfile"
|
||||
FuriString* scratch_name;
|
||||
FuriString* tmp_name;
|
||||
tmp_name = furi_string_alloc();
|
||||
|
||||
@@ -106,7 +106,7 @@ static size_t string_stream_size(StringStream* stream) {
|
||||
}
|
||||
|
||||
static size_t string_stream_write(StringStream* stream, const char* data, size_t size) {
|
||||
// TODO: can be optimized for edge cases
|
||||
// TODO FL-3544: can be optimized for edge cases
|
||||
size_t i;
|
||||
for(i = 0; i < size; i++) {
|
||||
string_stream_write_char(stream, data[i]);
|
||||
|
||||
@@ -55,7 +55,7 @@ uint8_t dfu_file_validate_headers(File* dfuf, const DfuValidationParams* referen
|
||||
if((dfu_suffix.bLength != sizeof(DfuSuffix)) || (dfu_suffix.bcdDFU != DFU_SUFFIX_VERSION)) {
|
||||
return 0;
|
||||
}
|
||||
/* TODO: check DfuSignature?.. */
|
||||
/* TODO FL-3561: check DfuSignature?.. */
|
||||
|
||||
if((dfu_suffix.idVendor != reference_params->vendor) ||
|
||||
(dfu_suffix.idProduct != reference_params->product) ||
|
||||
@@ -137,7 +137,7 @@ bool dfu_file_process_targets(const DfuUpdateTask* task, File* dfuf, const uint8
|
||||
return UpdateBlockResult_Failed;
|
||||
}
|
||||
|
||||
/* TODO: look into TargetPrefix and validate/filter?.. */
|
||||
/* TODO FL-3562: look into TargetPrefix and validate/filter?.. */
|
||||
for(uint32_t i_element = 0; i_element < target_prefix.dwNbElements; ++i_element) {
|
||||
bytes_read = storage_file_read(dfuf, &image_element, sizeof(ImageElementHeader));
|
||||
if(bytes_read != sizeof(ImageElementHeader)) {
|
||||
|
||||
@@ -54,7 +54,7 @@ static bool
|
||||
|
||||
FuriString* filetype;
|
||||
|
||||
// TODO: compare filetype?
|
||||
// TODO FL-3543: compare filetype?
|
||||
filetype = furi_string_alloc();
|
||||
update_manifest->valid =
|
||||
flipper_format_read_header(flipper_file, filetype, &update_manifest->manifest_version) &&
|
||||
|
||||
Reference in New Issue
Block a user