mirror of
https://github.com/suchmememanyskill/CYD-Klipper.git
synced 2026-03-22 14:03:25 +00:00
Implement settings, temp control, extrude/retract, untested status display
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user