added LCD_clear
This commit is contained in:
@@ -130,7 +130,10 @@ int main(void)
|
|||||||
|
|
||||||
/* Initialize the filesystem */
|
/* Initialize the filesystem */
|
||||||
llfs_init();
|
llfs_init();
|
||||||
|
|
||||||
|
/*initialize modbus*/
|
||||||
modbus_init();
|
modbus_init();
|
||||||
|
|
||||||
/* USER CODE END 2 */
|
/* USER CODE END 2 */
|
||||||
|
|
||||||
/* Infinite loop */
|
/* Infinite loop */
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
#include "modbus-tcp.h"
|
#include "modbus-tcp.h"
|
||||||
|
|
||||||
char tcp_buffer[1024];
|
|
||||||
|
|
||||||
#define MAX_REG 250
|
#define MAX_REG 250
|
||||||
|
|
||||||
char registers[MAX_REG];
|
char registers[MAX_REG];
|
||||||
@@ -68,7 +66,6 @@ static err_t modbus_incomming_data(void *arg, struct tcp_pcb *pcb, struct pbuf *
|
|||||||
printf("%c ", text[i]);
|
printf("%c ", text[i]);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
// processing the text data to screen
|
// processing the text data to screen
|
||||||
textstring = text;
|
textstring = text;
|
||||||
|
|
||||||
@@ -81,9 +78,6 @@ static err_t modbus_incomming_data(void *arg, struct tcp_pcb *pcb, struct pbuf *
|
|||||||
result_txt |= ((uint32_t)txt_red) << 16;
|
result_txt |= ((uint32_t)txt_red) << 16;
|
||||||
result_txt |= ((uint32_t)txt_green) << 8;
|
result_txt |= ((uint32_t)txt_green) << 8;
|
||||||
result_txt |= txt_blue;
|
result_txt |= txt_blue;
|
||||||
|
|
||||||
lcd_display_text(textstring, 10, 10, result_txt, result_bg, LCD_FONT24);
|
|
||||||
|
|
||||||
// proccesing the image index
|
// proccesing the image index
|
||||||
size_t number_of_files = llfs_file_count(); // hoeveel files er zijn
|
size_t number_of_files = llfs_file_count(); // hoeveel files er zijn
|
||||||
|
|
||||||
@@ -98,10 +92,14 @@ static err_t modbus_incomming_data(void *arg, struct tcp_pcb *pcb, struct pbuf *
|
|||||||
extention[3] = '\0'; //adding the \0
|
extention[3] = '\0'; //adding the \0
|
||||||
|
|
||||||
if(strcmp(extention,"gif") == 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
|
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){
|
if(strcmp(extention,"bmp") == 0){
|
||||||
lcd_draw_img_from_fs(file_list[nr_img - 1].name, 10, 30); //BMP on screen
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (err == ERR_OK){
|
} else if (err == ERR_OK){
|
||||||
|
|||||||
Reference in New Issue
Block a user