Willy-JL пре 2 година
родитељ
комит
e62d51d273
3 измењених фајлова са 7 додато и 7 уклоњено
  1. 1 1
      text2sam/application.fam
  2. 2 1
      text2sam/sam_app.cpp
  3. 4 5
      text2sam/stm32_sam.cpp

+ 1 - 1
text2sam/application.fam

@@ -12,6 +12,6 @@ App(
     stack_size=4 * 1024,
     # stack_size=2 * 1024,
     fap_icon="icon.png",
-    fap_category="",
+    fap_category="Media",
     order=20,
 )

+ 2 - 1
text2sam/sam_app.cpp

@@ -14,7 +14,7 @@
 #include "stm32_sam.h"
 
 #define TAG "SAM"
-#define SAM_SAVE_PATH EXT_PATH("sam.txt")
+#define SAM_SAVE_PATH APP_DATA_PATH("message.txt")
 #define TEXT_BUFFER_SIZE 256
 STM32SAM voice;
 
@@ -89,6 +89,7 @@ static void save_message(FuriString* save_string) {
 
 static bool load_messages() {
     Storage* storage = (Storage*)furi_record_open(RECORD_STORAGE);
+    storage_common_migrate(storage, EXT_PATH("sam.txt"), SAM_SAVE_PATH);
     File* file = storage_file_alloc(storage);
     uint16_t bytes_read = 0;
     if(storage_file_open(file, SAM_SAVE_PATH, FSAM_READ, FSOM_OPEN_EXISTING)) {

+ 4 - 5
text2sam/stm32_sam.cpp

@@ -5400,15 +5400,14 @@ void STM32SAM::sam(
         }
     }
 
+    if(i < 256) {
+        input[i] = phonetic ? '\x9b' : '[';
+    }
+
     if(!phonetic) {
-        strncat(input, "[", 256);
         if(!TextToPhonemes((unsigned char*)input)) {
-            // PrintUsage();
             return;
         }
-
-    } else {
-        strncat(input, "\x9b", 256);
     }
 
     SetInput(input);