Просмотр исходного кода

* Fix for #158

* Cosmetic refactoring
alex.kopachov 2 лет назад
Родитель
Сommit
5627bc9f98
2 измененных файлов с 6 добавлено и 2 удалено
  1. 4 0
      totp_app.c
  2. 2 2
      workers/type-code-common.c

+ 4 - 0
totp_app.c

@@ -193,7 +193,11 @@ int32_t totp_app() {
     }
 
     // Affecting dolphin level
+#if defined(DOLPHIN_DEED)
     DOLPHIN_DEED(DolphinDeedPluginStart);
+#else
+    dolphin_deed(DolphinDeedPluginStart);
+#endif
 
     // Set system callbacks
     ViewPort* view_port = view_port_alloc();

+ 2 - 2
workers/type-code-common.c

@@ -52,10 +52,10 @@ void totp_type_code_worker_execute_automation(
     while(i < code_buffer_size && (cb_char = code_buffer[i]) != 0) {
         uint8_t char_index = CONVERT_CHAR_TO_DIGIT(cb_char);
         if(char_index > 9) {
-            char_index = cb_char - 0x41 + 10;
+            char_index = cb_char - 'A' + 10;
         }
 
-        if(char_index > 35) break;
+        if(char_index >= sizeof(hid_number_keys)) break;
 
         uint16_t hid_kb_key = hid_number_keys[char_index];
         if(char_index > 9) {