Procházet zdrojové kódy

fix hidfiletransfer

MX před 2 roky
rodič
revize
b31a49a88b

+ 1 - 1
base_pack/nfc_maker/scenes/nfc_maker_scene_result.c

@@ -102,7 +102,7 @@ void nfc_maker_scene_result_on_enter(void* context) {
 
 
             FuriString* vcard = furi_string_alloc_set("BEGIN:VCARD\r\nVERSION:3.0\r\n");
             FuriString* vcard = furi_string_alloc_set("BEGIN:VCARD\r\nVERSION:3.0\r\n");
             furi_string_cat_printf(
             furi_string_cat_printf(
-                vcard, "PRODID:-//Flipper Xtreme//%s//EN\r\n", version_get_version(NULL));
+                vcard, "PRODID:-//Flipper Zero//%s//EN\r\n", version_get_version(NULL));
             furi_string_cat_printf(vcard, "N:%s;%s;;;\r\n", app->small_buf2, app->small_buf1);
             furi_string_cat_printf(vcard, "N:%s;%s;;;\r\n", app->small_buf2, app->small_buf1);
             furi_string_cat_printf(
             furi_string_cat_printf(
                 vcard,
                 vcard,

+ 0 - 108
non_catalog_apps/hid_file_transfer/filelogger.c

@@ -1,108 +0,0 @@
-#include "filelogger.h"
-#include <core/check.h>
-#include <core/mutex.h>
-#include <furi_hal.h>
-#include <storage/storage.h>
-
-#define FURI_LOG_LEVEL_DEFAULT FuriLogLevelInfo
-
-typedef struct {
-    FuriLogLevel log_level;
-    FuriLogPuts puts;
-    FuriLogTimestamp timestamp;
-    FuriMutex* mutex;
-    File *logFile;
-    Storage *storage;
-} FuriLogParams;
-
-static FuriLogParams furi_log;
-
-void writeToLog(const char *msg) {
-    furi_hal_console_puts(msg);
-
-    // Storage *s = furi_record_open(RECORD_STORAGE);
-    // File *f = storage_file_alloc(s);
-    // storage_file_open(f, "/any/log.txt", FSAM_READ_WRITE, FSOM_OPEN_APPEND);
-    storage_file_write(furi_log.logFile, msg, strlen(msg));
-    // storage_file_close(f);
-    // storage_file_free(f);
-    // furi_record_close(RECORD_STORAGE);
-}
-
-
-
-void file_log_init() {
-    // Set default logging parameters
-    furi_log.log_level = FURI_LOG_LEVEL_DEFAULT;
-    furi_log.puts = writeToLog;
-    furi_log.timestamp = furi_get_tick;
-    furi_log.mutex = furi_mutex_alloc(FuriMutexTypeNormal);
-    furi_log.storage = furi_record_open(RECORD_STORAGE);
-    furi_log.logFile = storage_file_alloc(furi_log.storage);    
-    storage_file_open(furi_log.logFile, "/any/log.txt", FSAM_READ_WRITE, FSOM_OPEN_APPEND);
-}
-
-
-void file_log_deinit() {
-    storage_file_close(furi_log.logFile);
-    storage_file_free(furi_log.logFile);
-    furi_record_close(RECORD_STORAGE);
-    furi_mutex_free(furi_log.mutex);
-}
-
-void file_log_print_format(FuriLogLevel level, const char* tag, const char* format, ...) {
-    if(level <= furi_log_get_level() &&
-       furi_mutex_acquire(furi_log.mutex, FuriWaitForever) == FuriStatusOk) {
-        FuriString* string;
-        string = furi_string_alloc();
-
-        const char* log_letter = " ";
-        switch(level) {
-        case FuriLogLevelError:
-            log_letter = "E";
-            break;
-        case FuriLogLevelWarn:
-            log_letter = "W";
-            break;
-        case FuriLogLevelInfo:
-            log_letter = "I";
-            break;
-        case FuriLogLevelDebug:
-            log_letter = "D";
-            break;
-        case FuriLogLevelTrace:
-            log_letter = "T";
-            break;
-        default:
-            break;
-        }
-
-        // Timestamp
-        furi_string_printf(
-            string,
-            "%lu [%s][%s] ",
-            furi_log.timestamp(),
-            log_letter,
-            tag);
-        furi_log.puts(furi_string_get_cstr(string));
-        furi_string_reset(string);
-
-        va_list args;
-        va_start(args, format);
-        furi_string_vprintf(string, format, args);
-        va_end(args);
-
-        furi_log.puts(furi_string_get_cstr(string));
-        furi_string_free(string);
-
-        furi_log.puts("\r\n");
-
-        furi_mutex_release(furi_log.mutex);
-    }
-}
-
-
-void file_log_set_timestamp(FuriLogTimestamp timestamp) {
-    furi_assert(timestamp);
-    furi_log.timestamp = timestamp;
-}

+ 0 - 70
non_catalog_apps/hid_file_transfer/filelogger.h

@@ -1,70 +0,0 @@
-/**
- * @file log.h
- * Furi Logging system
- */
-#pragma once
-
-#include <core/log.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** Initialize logging */
-void file_log_init();
-void file_log_deinit();
-
-/** Print log record
- * 
- * @param level 
- * @param tag 
- * @param format 
- * @param ... 
- */
-void file_log_print_format(FuriLogLevel level, const char* tag, const char* format, ...)
-    _ATTRIBUTE((__format__(__printf__, 3, 4)));
-
-// /** Set log level
-//  *
-//  * @param[in]  level  The level
-//  */
-// void file_log_set_level(FuriLogLevel level);
-
-// /** Get log level
-//  *
-//  * @return     The furi log level.
-//  */
-// FuriLogLevel file_log_get_level();
-
-// /** Set log output callback
-//  *
-//  * @param[in]  puts  The puts callback
-//  */
-// void file_log_set_puts(FuriLogPuts puts);
-
-/** Set timestamp callback
- *
- * @param[in]  timestamp  The timestamp callback
- */
-void file_log_set_timestamp(FuriLogTimestamp timestamp);
-
-/** Log methods
- *
- * @param      tag     The application tag
- * @param      format  The format
- * @param      ...     VA Args
- */
-#define FILE_LOG_E(tag, format, ...) \
-    file_log_print_format(FuriLogLevelError, tag, format, ##__VA_ARGS__)
-#define FILE_LOG_W(tag, format, ...) \
-    file_log_print_format(FuriLogLevelWarn, tag, format, ##__VA_ARGS__)
-#define FILE_LOG_I(tag, format, ...) \
-    file_log_print_format(FuriLogLevelInfo, tag, format, ##__VA_ARGS__)
-#define FILE_LOG_D(tag, format, ...) \
-    file_log_print_format(FuriLogLevelDebug, tag, format, ##__VA_ARGS__)
-#define FILE_LOG_T(tag, format, ...) \
-    file_log_print_format(FuriLogLevelTrace, tag, format, ##__VA_ARGS__)
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 3
non_catalog_apps/hid_file_transfer/main.c

@@ -14,7 +14,6 @@
 #include <stream/stream.h>
 #include <stream/stream.h>
 #include <stream/buffered_file_stream.h>
 #include <stream/buffered_file_stream.h>
 #include <toolbox/stream/file_stream.h>
 #include <toolbox/stream/file_stream.h>
-#include "filelogger.h"
 #include "constants.h"
 #include "constants.h"
 #include <assets_icons.h>
 #include <assets_icons.h>
 #include "hidtransfer_icons.h"
 #include "hidtransfer_icons.h"
@@ -409,8 +408,6 @@ bool inputCallback(InputEvent* event, void* context) {
 
 
 int32_t hidtransfer_app() {
 int32_t hidtransfer_app() {
     furi_log_set_level(FuriLogLevelDebug);
     furi_log_set_level(FuriLogLevelDebug);
-    furi_hal_console_enable();
-
     FURI_LOG_D(TAG, "APP STARTED");
     FURI_LOG_D(TAG, "APP STARTED");
 
 
     FuriHalUsbInterface* mode = furi_hal_usb_get_config();
     FuriHalUsbInterface* mode = furi_hal_usb_get_config();

+ 0 - 1
non_catalog_apps/hid_file_transfer/usbif.c

@@ -6,7 +6,6 @@
 #include <usb_hid.h>
 #include <usb_hid.h>
 #include "usbd_core.h"
 #include "usbd_core.h"
 #include "usb_std.h"
 #include "usb_std.h"
-#include "filelogger.h"
 
 
 #include "usbif.h"
 #include "usbif.h"
 #include <storage/storage.h>
 #include <storage/storage.h>