gif + bmp on screen, checking the extension
This commit is contained in:
@@ -10,6 +10,8 @@ static err_t modbus_incomming_data(void *arg, struct tcp_pcb *pcb, struct pbuf *
|
|||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
int len;
|
int len;
|
||||||
|
int lenght;
|
||||||
|
char extention[4];
|
||||||
char *pc;
|
char *pc;
|
||||||
char *textstring;
|
char *textstring;
|
||||||
char text[200];
|
char text[200];
|
||||||
@@ -90,7 +92,17 @@ 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
|
number_of_files = llfs_file_list(file_list, number_of_files, NULL); // vrijgemaakt geheugen invullen met de lijst
|
||||||
|
|
||||||
|
|
||||||
lcd_draw_img_from_fs(file_list[nr_img - 1].name, 10, 30); //BMP on screen
|
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_gif_t* gif = lcd_draw_gif_from_fs(file_list[nr_img - 1].name, 10, 30); //GIF on screen
|
||||||
|
}
|
||||||
|
if(strcmp(extention,"bmp") == 0){
|
||||||
|
lcd_draw_img_from_fs(file_list[nr_img - 1].name, 10, 30); //BMP on screen
|
||||||
|
}
|
||||||
|
|
||||||
} else if (err == ERR_OK){
|
} else if (err == ERR_OK){
|
||||||
tcp_close(pcb); // when everithing was ok close the tcpconnection
|
tcp_close(pcb); // when everithing was ok close the tcpconnection
|
||||||
|
|||||||
Reference in New Issue
Block a user