Commit before I fuck everything up
This commit is contained in:
parent
1cb93af0bc
commit
9685b53bf1
@ -66,7 +66,7 @@ void setup() {
|
|||||||
_shell->init(th, _display_state, sm);
|
_shell->init(th, _display_state, sm);
|
||||||
|
|
||||||
// Create input task on Core 0
|
// Create input task on Core 0
|
||||||
xTaskCreatePinnedToCore(input_task, "input_task", 4096, NULL, 1, &InputTask, 0);
|
xTaskCreatePinnedToCore(input_task, "input_task", 4096, NULL, 15, &InputTask, 0);
|
||||||
|
|
||||||
delay(100);
|
delay(100);
|
||||||
|
|
||||||
|
|||||||
@ -186,7 +186,7 @@ public:
|
|||||||
show_resources.x = _window->x + 7;
|
show_resources.x = _window->x + 7;
|
||||||
show_resources.y = _window->y + 40;
|
show_resources.y = _window->y + 40;
|
||||||
show_resources.width = 80;
|
show_resources.width = 80;
|
||||||
show_resources.height = 10;
|
show_resources.height = 15;
|
||||||
show_resources.pressed = true;
|
show_resources.pressed = true;
|
||||||
|
|
||||||
ContentButton show_tasks;
|
ContentButton show_tasks;
|
||||||
@ -194,7 +194,7 @@ public:
|
|||||||
show_tasks.x = _window->x + show_resources.width + 13;
|
show_tasks.x = _window->x + show_resources.width + 13;
|
||||||
show_tasks.y = _window->y + 40;
|
show_tasks.y = _window->y + 40;
|
||||||
show_tasks.width = 70;
|
show_tasks.width = 70;
|
||||||
show_tasks.height = 10;
|
show_tasks.height = 15;
|
||||||
show_tasks.pressed = false;
|
show_tasks.pressed = false;
|
||||||
|
|
||||||
_window->content_buttons.push_back(show_resources);
|
_window->content_buttons.push_back(show_resources);
|
||||||
|
|||||||
@ -54,6 +54,8 @@ struct WindowContentText {
|
|||||||
short x;
|
short x;
|
||||||
short y;
|
short y;
|
||||||
char size;
|
char size;
|
||||||
|
bool selectable = false;
|
||||||
|
bool selected = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ContentButton {
|
struct ContentButton {
|
||||||
|
|||||||
@ -15,25 +15,25 @@ void TFT_Handler::init(DISPLAY_STATE* display_state) {
|
|||||||
sprite.fillScreen(0x0000);
|
sprite.fillScreen(0x0000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TFT_Handler::draw_box(short int x, short int y, short int size_x, short int size_y, int color) {
|
void TFT_Handler::draw_box(short x, short y, short size_x, short size_y, short color) {
|
||||||
sprite.fillRect(x, y, size_x, size_y, color);
|
sprite.fillRect(x, y, size_x, size_y, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TFT_Handler::draw_rect(short int x, short int y, short int size_x, short int size_y, short int thickness, int color) {
|
void TFT_Handler::draw_rect(short x, short y, short size_x, short size_y, short thickness, short color) {
|
||||||
sprite.drawRect(x, y, size_x, size_y, color);
|
sprite.drawRect(x, y, size_x, size_y, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TFT_Handler::draw_line(short int x1, short int y1, short int x2, short int y2, int color) {
|
void TFT_Handler::draw_line(short x1, short y1, short x2, short y2, short color) {
|
||||||
sprite.drawLine(x1, y1, x2, y2, color);
|
sprite.drawLine(x1, y1, x2, y2, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TFT_Handler::draw_text(short int x, short int y, const std::string& str, int color, short int size) {
|
void TFT_Handler::draw_text(short x, short y, const std::string& str, short color, short size) {
|
||||||
sprite.setTextColor(color);
|
sprite.setTextColor(color);
|
||||||
sprite.setTextSize(size);
|
sprite.setTextSize(size);
|
||||||
sprite.drawString(str.c_str(), x, y);
|
sprite.drawString(str.c_str(), x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TFT_Handler::draw_button(short x, short y, short size_x, short size_y, int color, bool pressed, std::string str) {
|
void TFT_Handler::draw_button(short x, short y, short size_x, short size_y, short color, bool pressed, std::string str) {
|
||||||
if (pressed) {
|
if (pressed) {
|
||||||
sprite.fillRect(x - 2, y - 2, size_x + 2, size_y + 2, COL_BLACK);
|
sprite.fillRect(x - 2, y - 2, size_x + 2, size_y + 2, COL_BLACK);
|
||||||
sprite.fillRect(x - 1, y - 1, size_x + 1, size_y + 1, COL_DARK_GREY);
|
sprite.fillRect(x - 1, y - 1, size_x + 1, size_y + 1, COL_DARK_GREY);
|
||||||
@ -51,7 +51,7 @@ void TFT_Handler::draw_button(short x, short y, short size_x, short size_y, int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TFT_Handler::fill_screen(int color) {
|
void TFT_Handler::fill_screen(short color) {
|
||||||
sprite.fillScreen(color);
|
sprite.fillScreen(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -61,11 +61,11 @@ public:
|
|||||||
|
|
||||||
void init(DISPLAY_STATE* display_state);
|
void init(DISPLAY_STATE* display_state);
|
||||||
|
|
||||||
void draw_box(short x, short y, short size_x, short size_y, int color);
|
void draw_box(short x, short y, short size_x, short size_y, short color);
|
||||||
void draw_rect(short x, short y, short size_x, short size_y, short int thickness, int color);
|
void draw_rect(short x, short y, short size_x, short size_y, short thickness, short color);
|
||||||
void draw_line(short x1, short y1, short x2, short y2, int color);
|
void draw_line(short x1, short y1, short x2, short y2, short color);
|
||||||
void draw_text(short x, short y, const std::string& str, int color, short int size);
|
void draw_text(short x, short y, const std::string& str, short color, short size);
|
||||||
void draw_button(short x, short y, short size_x, short size_y, int color, bool pressed, std::string str);
|
void draw_button(short x, short y, short size_x, short size_y, short color, bool pressed, std::string str);
|
||||||
void fill_screen(int color);
|
void fill_screen(short color);
|
||||||
void push_sprite();
|
void push_sprite();
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user