[FL-1682] Faster file receiving function. Storage management scripts. (#647)

* Storage-cli: the file write function is splitted into a function for working with text and function for raw data
* Storage-cli: read_chunks, renamed write_raw to write_chunk
* Storage-cli: fix typo
* SD Hal: fixed wrong read/write block address
* HAL-console: printf
* Storage benchmark: more popular sizes
* Toolbox: md5
* Storage-cli: better read_chunks function, md5 hash function
* Notification: fixed incorrect error message when loading settings
* Storage-cli: stat command
* Storage-cli: stat, "/" is also storage
* Scripts: add storage managment script
* Scripts, storage lib: send command with known response syntax instead of SOH
* Scripts: python3 from env
* Storage-cli: fixed mess with error texts
* Storage-cli: write, show welcome message only if we didn't have any errors
* Storage: poorly fixed folders copying
* Storage: close an old file if an error occurred while opening a new file
* Storage-cli: fixed storage info spacing
* Scripts: use positional arguments in storage.
* Scripts: explicit string encoding and decoding, documentation in comments.

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
SG
2021-08-19 08:06:18 +10:00
committed by GitHub
parent d04deb48b8
commit 9d38f28de7
11 changed files with 1314 additions and 105 deletions

View File

@@ -3,6 +3,7 @@
#include <stdbool.h>
#include <stm32wbxx_ll_gpio.h>
#include <stm32wbxx_ll_usart.h>
#include <m-string.h>
#include <furi.h>
@@ -55,4 +56,14 @@ void furi_hal_console_tx(const uint8_t* buffer, size_t buffer_size) {
/* Wait for TC flag to be raised for last char */
while (!LL_USART_IsActiveFlag_TC(USART1));
}
void furi_hal_console_printf(const char format[], ...) {
string_t string;
va_list args;
va_start(args, format);
string_init_vprintf(string, format, args);
va_end(args);
furi_hal_console_tx((const uint8_t*)string_get_cstr(string), string_size(string));
string_clear(string);
}

View File

@@ -11,6 +11,8 @@ void furi_hal_console_init();
void furi_hal_console_tx(const uint8_t* buffer, size_t buffer_size);
void furi_hal_console_printf(const char format[], ...);
#ifdef __cplusplus
}
#endif