Check for SD

This commit is contained in:
Just Call Me Koko
2021-04-17 13:52:32 -04:00
parent d6f20ec1fa
commit 2ec82c509b

View File

@@ -128,6 +128,7 @@ void MenuFunctions::writeBadUSB(){
lv_textarea_set_text(ta1, "");
lv_textarea_set_placeholder_text(ta1, "Ducky script");
if (sd_obj.supported) {
// Create load button
lv_obj_t * label;
lv_obj_t * load_btn = lv_btn_create(lv_scr_act(), NULL);
@@ -147,6 +148,7 @@ void MenuFunctions::writeBadUSB(){
lv_obj_align(save_as_btn, ta1, LV_ALIGN_IN_TOP_MID, NULL, (LV_VER_RES / 2) - 35); // align to text area
label2 = lv_label_create(save_as_btn, NULL);
lv_label_set_text(label2, "Save As");
}
// Focus it on one of the text areas to start
lv_keyboard_set_textarea(kb, ta1);
@@ -313,12 +315,6 @@ void test_btn_cb(lv_obj_t * btn, lv_event_t event) {
display_string.toCharArray(buf, display_string.length() + 1);
lv_textarea_set_text(ta1, buf);
}
}
// Delete the file list obj
lv_obj_del_async(lv_obj_get_parent(lv_obj_get_parent(btn)));
menu_function_obj.loaded_file = btn_text;
// Create Save button
lv_obj_t * save_label;
@@ -330,6 +326,12 @@ void test_btn_cb(lv_obj_t * btn, lv_event_t event) {
save_label = lv_label_create(save_btn, NULL);
lv_label_set_text(save_label, "Save");
}
}
// Delete the file list obj
lv_obj_del_async(lv_obj_get_parent(lv_obj_get_parent(btn)));
menu_function_obj.loaded_file = btn_text;
}
}
void load_btn_cb(lv_obj_t * load_btn, lv_event_t event) {