mp_flipper_halport.c 877 B

123456789101112131415161718192021222324252627282930313233
  1. #include <stdio.h>
  2. #include <furi.h>
  3. #include <storage/storage.h>
  4. #include <mp_flipper_runtime.h>
  5. #include <mp_flipper_halport.h>
  6. #include "mp_flipper_file_helper.h"
  7. inline void mp_flipper_stdout_tx_str(const char* str) {
  8. furi_thread_stdout_write(str, strlen(str));
  9. }
  10. inline void mp_flipper_stdout_tx_strn_cooked(const char* str, size_t len) {
  11. furi_thread_stdout_write(str, len);
  12. }
  13. inline mp_flipper_import_stat_t mp_flipper_import_stat(const char* path) {
  14. FuriString* file_path = furi_string_alloc_printf("%s", path);
  15. mp_flipper_import_stat_t stat = mp_flipper_try_resolve_filesystem_path(file_path);
  16. stat = furi_string_end_with_str(file_path, path) ? stat : MP_FLIPPER_IMPORT_STAT_NO_EXIST;
  17. furi_string_free(file_path);
  18. return stat;
  19. }
  20. inline size_t mp_flipper_gc_get_max_new_split(void) {
  21. return memmgr_heap_get_max_free_block();
  22. }