Implement settings, temp control, extrude/retract, untested status display

This commit is contained in:
suchmememanyskill
2023-11-12 21:49:51 +01:00
parent ef1afa6560
commit 86fca4ca16
16 changed files with 497 additions and 16 deletions

View File

@@ -1,8 +1,19 @@
#include <Preferences.h>
#include "global_config.h"
#include "lvgl.h"
GLOBAL_CONFIG global_config = {0};
COLOR_DEF color_defs[] = {
{LV_PALETTE_BLUE, LV_PALETTE_RED},
{LV_PALETTE_GREEN, LV_PALETTE_PURPLE},
{LV_PALETTE_GREY, LV_PALETTE_CYAN},
{LV_PALETTE_YELLOW, LV_PALETTE_PINK},
{LV_PALETTE_ORANGE, LV_PALETTE_BLUE},
{LV_PALETTE_RED, LV_PALETTE_GREEN},
{LV_PALETTE_PURPLE, LV_PALETTE_GREY},
};
void WriteGlobalConfig() {
Preferences preferences;
preferences.begin("global_config", false);

View File

@@ -1,6 +1,8 @@
#ifndef _GLOBAL_CONFIG_INIT
#define _GLOBAL_CONFIG_INIT
#include "lvgl.h"
#define CONFIG_VERSION 80
typedef struct _GLOBAL_CONFIG {
@@ -11,6 +13,8 @@ typedef struct _GLOBAL_CONFIG {
bool screenCalibrated : 1;
bool wifiConfigured : 1;
bool ipConfigured : 1;
bool lightMode : 1;
bool invertColors : 1;
};
};
float screenCalXOffset;
@@ -23,9 +27,17 @@ typedef struct _GLOBAL_CONFIG {
char klipperHost[64];
unsigned short klipperPort;
unsigned char color_scheme;
} GLOBAL_CONFIG;
typedef struct _COLOR_DEF {
lv_palette_t primary_color;
lv_palette_t secondary_color;
} COLOR_DEF;
extern GLOBAL_CONFIG global_config;
extern COLOR_DEF color_defs[];
void WriteGlobalConfig();
void VerifyVersion();