mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-13 13:09:49 +04:00
Merge branch 'ofw-dev' into dev
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user