0fb3c22f79
Main / Build (Brainfuck) (push) Has been cancelled
Main / Build (Breakout) (push) Has been cancelled
Main / Build (Calculator) (push) Has been cancelled
Main / Build (Diceware) (push) Has been cancelled
Main / Build (EpubReader) (push) Has been cancelled
Main / Build (GPIO) (push) Has been cancelled
Main / Build (GraphicsDemo) (push) Has been cancelled
Main / Build (HelloWorld) (push) Has been cancelled
Main / Build (M5UnitTest) (push) Has been cancelled
Main / Build (Magic8Ball) (push) Has been cancelled
Main / Build (MediaKeys) (push) Has been cancelled
Main / Build (MystifyDemo) (push) Has been cancelled
Main / Build (SerialConsole) (push) Has been cancelled
Main / Build (Snake) (push) Has been cancelled
Main / Build (TamaTac) (push) Has been cancelled
Main / Build (TodoList) (push) Has been cancelled
Main / Build (TwoEleven) (push) Has been cancelled
Main / Bundle (push) Has been cancelled
77 lines
1.7 KiB
C
77 lines
1.7 KiB
C
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#include <freertos/FreeRTOS.h>
|
|
#include <freertos/task.h>
|
|
#include <lvgl.h>
|
|
#include <tt_app.h>
|
|
|
|
typedef struct {
|
|
volatile bool running;
|
|
volatile bool http_ready;
|
|
volatile bool http_exited;
|
|
volatile bool discovery_ready;
|
|
volatile bool visible;
|
|
volatile bool override_active;
|
|
|
|
int http_socket;
|
|
int client_socket;
|
|
int discovery_socket;
|
|
TaskHandle_t http_task;
|
|
TaskHandle_t discovery_task;
|
|
|
|
AppHandle app;
|
|
lv_obj_t* draw_area;
|
|
lv_obj_t* server_label;
|
|
lv_obj_t* tool_label;
|
|
|
|
uint16_t* framebuffer;
|
|
size_t framebuffer_size;
|
|
uint16_t display_width;
|
|
uint16_t display_height;
|
|
uint16_t draw_width;
|
|
uint16_t draw_height;
|
|
int draw_color;
|
|
} McpScreenState;
|
|
|
|
bool mcp_services_start(McpScreenState* state);
|
|
void mcp_services_hide(McpScreenState* state);
|
|
void mcp_services_stop(McpScreenState* state);
|
|
|
|
void mcp_ui_set_server_status(McpScreenState* state, const char* status);
|
|
void mcp_ui_set_last_tool(McpScreenState* state, const char* tool);
|
|
bool mcp_ui_clear(McpScreenState* state, int color);
|
|
bool mcp_ui_draw_text(
|
|
McpScreenState* state,
|
|
const char* text,
|
|
int x,
|
|
int y,
|
|
int size
|
|
);
|
|
bool mcp_ui_draw_rgb565_be(
|
|
McpScreenState* state,
|
|
const uint8_t* data,
|
|
size_t data_size,
|
|
int x,
|
|
int y,
|
|
int width,
|
|
int height
|
|
);
|
|
bool mcp_ui_draw_bmp(
|
|
McpScreenState* state,
|
|
const uint8_t* data,
|
|
size_t data_size,
|
|
int x,
|
|
int y
|
|
);
|
|
bool mcp_ui_draw_pbm(
|
|
McpScreenState* state,
|
|
const uint8_t* data,
|
|
size_t data_size,
|
|
int x,
|
|
int y
|
|
);
|
|
char* mcp_ui_get_screenshot_pbm_base64(McpScreenState* state);
|