updatet clears
This commit is contained in:
@@ -85,23 +85,30 @@ static err_t modbus_incomming_data(void *arg, struct tcp_pcb *pcb, struct pbuf *
|
||||
|
||||
number_of_files = llfs_file_list(file_list, number_of_files, NULL); // vrijgemaakt geheugen invullen met de lijst
|
||||
|
||||
|
||||
lenght = strlen(file_list[nr_img - 1].name); //lenght from filename
|
||||
|
||||
strncpy(extention, file_list[nr_img - 1].name + lenght - 3, 3); //putting the last tree digits in string
|
||||
extention[3] = '\0'; //adding the \0
|
||||
|
||||
if(strcmp(extention,"gif") == 0){
|
||||
lcd_clear(LCD_BLACK);
|
||||
lcd_display_text(textstring, 10, 10, result_txt, result_bg, LCD_FONT24);
|
||||
lcd_gif_t* gif = lcd_draw_gif_from_fs(file_list[nr_img - 1].name, 0, 75); //GIF on screen
|
||||
}
|
||||
if(strcmp(extention,"bmp") == 0){
|
||||
lcd_clear(LCD_BLACK);
|
||||
lcd_display_text(textstring, 10, 10, result_txt, result_bg, LCD_FONT24);
|
||||
lcd_draw_img_from_fs(file_list[nr_img - 1].name, 0, 75); //BMP on screen
|
||||
if(number_of_files < nr_img){
|
||||
lcd_clear_txt(void);
|
||||
lcd_clear_images(void);
|
||||
lcd_display_text("FILE NOT IN FILESYSTEM", 10, 10, LCD_RED, LCD_BLACK, LCD_FONT24);
|
||||
}
|
||||
else{
|
||||
lenght = strlen(file_list[nr_img - 1].name); //lenght from filename
|
||||
|
||||
strncpy(extention, file_list[nr_img - 1].name + lenght - 3, 3); //putting the last tree digits in string
|
||||
extention[3] = '\0'; //adding the \0
|
||||
|
||||
if(strcmp(extention,"gif") == 0){
|
||||
lcd_clear_txt(void);
|
||||
lcd_clear_images(void);
|
||||
lcd_display_text(textstring, 10, 10, result_txt, result_bg, LCD_FONT24);
|
||||
lcd_gif_t* gif = lcd_draw_gif_from_fs(file_list[nr_img - 1].name, 0, 75); //GIF on screen
|
||||
}
|
||||
if(strcmp(extention,"bmp") == 0){
|
||||
lcd_clear_txt(void);
|
||||
lcd_clear_images(void);
|
||||
lcd_display_text(textstring, 10, 10, result_txt, result_bg, LCD_FONT24);
|
||||
lcd_draw_img_from_fs(file_list[nr_img - 1].name, 0, 75); //BMP on screen
|
||||
}
|
||||
}
|
||||
} else if (err == ERR_OK){
|
||||
tcp_close(pcb); // when everithing was ok close the tcpconnection
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user