fix err
This commit is contained in:
@@ -101,19 +101,14 @@ static err_t modbus_incoming_data(void* arg, struct tcp_pcb* pcb, struct pbuf* p
|
|||||||
text_foreground_color |= text_color_blue;
|
text_foreground_color |= text_color_blue;
|
||||||
// proccesing the image index
|
// proccesing the image index
|
||||||
size_t number_of_files = llfs_file_count(); // How many files that there are
|
size_t number_of_files = llfs_file_count(); // How many files that there are
|
||||||
|
if(number_of_files > 0){
|
||||||
|
|
||||||
llfs_file_t file_list[number_of_files]; // Reserving memory for the list
|
llfs_file_t file_list[number_of_files]; // Reserving memory for the list
|
||||||
|
|
||||||
number_of_files = llfs_file_list(file_list, number_of_files, NULL); // Freed memory filled with the list
|
number_of_files = llfs_file_list(file_list, number_of_files, NULL); // Freed memory filled with the list
|
||||||
|
|
||||||
if (number_of_files < nr_img) {
|
if (number_of_files < nr_img) {
|
||||||
lcd_clear_text();
|
lcd_clear_text();
|
||||||
lcd_clear_images();
|
lcd_clear_images();
|
||||||
lcd_stop_all_gifs();
|
lcd_stop_all_gifs();
|
||||||
|
|
||||||
lcd_display_text(text, 10, 10, text_foreground_color, result_background, LCD_FONT24); //When no image
|
lcd_display_text(text, 10, 10, text_foreground_color, result_background, LCD_FONT24); //When no image
|
||||||
|
|
||||||
lcd_display_text("FILE NOT IN FILESYSTEM", 10, 75, LCD_RED, LCD_BLACK, LCD_FONT24);
|
lcd_display_text("FILE NOT IN FILESYSTEM", 10, 75, LCD_RED, LCD_BLACK, LCD_FONT24);
|
||||||
} else {
|
} else {
|
||||||
const char* ext = strrchr(file_list[nr_img - 1].name, '.');
|
const char* ext = strrchr(file_list[nr_img - 1].name, '.');
|
||||||
@@ -124,7 +119,6 @@ static err_t modbus_incoming_data(void* arg, struct tcp_pcb* pcb, struct pbuf* p
|
|||||||
lcd_clear_text();
|
lcd_clear_text();
|
||||||
lcd_clear_images();
|
lcd_clear_images();
|
||||||
lcd_stop_all_gifs();
|
lcd_stop_all_gifs();
|
||||||
|
|
||||||
lcd_display_text(text, 10, 10, text_foreground_color, result_background, LCD_FONT24);
|
lcd_display_text(text, 10, 10, text_foreground_color, result_background, LCD_FONT24);
|
||||||
lcd_gif_t* gif = lcd_draw_gif_from_fs(file_list[nr_img - 1].name, 0, 75); //GIF on screen
|
lcd_gif_t* gif = lcd_draw_gif_from_fs(file_list[nr_img - 1].name, 0, 75); //GIF on screen
|
||||||
} else if (strcmp(ext,".bmp") == 0) {
|
} else if (strcmp(ext,".bmp") == 0) {
|
||||||
@@ -133,9 +127,11 @@ static err_t modbus_incoming_data(void* arg, struct tcp_pcb* pcb, struct pbuf* p
|
|||||||
lcd_stop_all_gifs();
|
lcd_stop_all_gifs();
|
||||||
lcd_display_text(text, 10, 10, text_foreground_color, result_background, LCD_FONT24);
|
lcd_display_text(text, 10, 10, text_foreground_color, result_background, LCD_FONT24);
|
||||||
lcd_draw_img_from_fs(file_list[nr_img - 1].name, 0, 75); //BMP on screen
|
lcd_draw_img_from_fs(file_list[nr_img - 1].name, 0, 75); //BMP on screen
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// LOG_INFO(TAG, "not in writing multiple register mode!!!\n");
|
// LOG_INFO(TAG, "not in writing multiple register mode!!!\n");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user