Skip to content

Commit

Permalink
mks stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed May 3, 2023
1 parent a4fb128 commit fc4b59e
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
if (dir_offset[curDirLever].cur_page_first_offset >= FILE_NUM)
list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset - FILE_NUM;

#if HAS_MEDIA
file_count = search_file();
#endif
TERN_(HAS_MEDIA, file_count = search_file());
if (file_count != 0) {
dir_offset[curDirLever].curPage--;
lv_clear_print_file();
Expand All @@ -142,9 +140,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
if (dir_offset[curDirLever].cur_page_last_offset > 0) {
list_file.Sd_file_cnt = 0;
list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_last_offset + 1;
#if HAS_MEDIA
file_count = search_file();
#endif
TERN_(HAS_MEDIA, file_count = search_file());
if (file_count != 0) {
dir_offset[curDirLever].curPage++;
lv_clear_print_file();
Expand All @@ -159,17 +155,13 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
int8_t *ch = (int8_t *)strrchr(list_file.curDirPath, '/');
if (ch) {
*ch = 0;
#if HAS_MEDIA
card.cdup();
#endif
TERN_(HAS_MEDIA, card.cdup());
dir_offset[curDirLever].curPage = 0;
dir_offset[curDirLever].cur_page_first_offset = 0;
dir_offset[curDirLever].cur_page_last_offset = 0;
curDirLever--;
list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset;
#if HAS_MEDIA
file_count = search_file();
#endif
TERN_(HAS_MEDIA, file_count = search_file());
lv_clear_print_file();
disp_gcode_icon(file_count);
}
Expand All @@ -187,9 +179,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
strcpy(list_file.curDirPath, list_file.file_name[i]);
curDirLever++;
list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset;
#if HAS_MEDIA
file_count = search_file();
#endif
TERN_(HAS_MEDIA, file_count = search_file());
lv_clear_print_file();
disp_gcode_icon(file_count);
}
Expand Down Expand Up @@ -394,8 +384,7 @@ int ascii2dec_test(char *ascii) {

void lv_gcode_file_read(uint8_t *data_buf) {
#if HAS_MEDIA
uint16_t i = 0, j = 0, k = 0;
uint16_t row_1 = 0;
uint16_t i = 0, j = 0, k = 0, row_1 = 0;
bool ignore_start = true;
char temp_test[200];
volatile uint16_t *p_index;
Expand Down

0 comments on commit fc4b59e

Please sign in to comment.