Added support for setImage command for .bmp files
Implemented code for displaying .bmp images with the steImage command.
This commit is contained in:
@@ -119,8 +119,13 @@ static err_t echo_recv( void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t er
|
||||
|
||||
check = 1;
|
||||
}
|
||||
else if( strncmp(tcp_buffer, "setImages", 9) == 0 ) {
|
||||
|
||||
else if( strncmp(tcp_buffer, "setImage", 8) == 0 ) {
|
||||
char filename[len - 8];
|
||||
for (int i = 0; i < len - 9; i++) {
|
||||
filename[i] = tcp_buffer[i+9];
|
||||
}
|
||||
filename[sizeof(filename)-1] = '\0';
|
||||
lcd_draw_img_from_fs(filename, 10, 10);
|
||||
check = 1;
|
||||
}
|
||||
else if( strncmp(tcp_buffer, "exit", 4) == 0 ) {
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "tftp.h"
|
||||
#include "modbus_tcp.h"
|
||||
#include "UDP_broadcast.h"
|
||||
#include "tcp_cmd.h"
|
||||
#include "cmd.h"
|
||||
#include "website_backend.h"
|
||||
|
||||
#include "cmd.h"
|
||||
@@ -124,10 +124,7 @@ int main(void) {
|
||||
MX_QUADSPI_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
||||
/* Initialize QSPI */
|
||||
BSP_QSPI_Init();
|
||||
BSP_QSPI_MemoryMappedMode();
|
||||
WRITE_REG(QUADSPI->LPTR, 0xFFF);
|
||||
/* USER CODE END 2 */
|
||||
|
||||
/* Clear terminal */
|
||||
printf(CLEAR_SCREEN);
|
||||
|
||||
Reference in New Issue
Block a user