Layered menu (#229)

* Split menu handling,speed up OLED

* Split menu apart

Split menu apart.
Next to add icons etc

* Finished main menu re-layout

* Added menu option for scroll speed

* Speed up scroll settings, pad translations
This commit is contained in:
Ben V. Brown
2018-03-14 22:11:04 +11:00
committed by GitHub
parent 17c0d15a8b
commit fcfa44a949
17 changed files with 808 additions and 340 deletions

View File

@@ -595,6 +595,47 @@ const uint8_t idleScreenBGF[] = {
0x87,0x86,0x86,0x86,0x82,0x80,0x40,0x40,0x20,0x18,0x07,0x00
};
/*
* 16x16 icons
* */
const uint8_t SettingsMenuIcons[] = {
// Soldering
//width = 16
//height = 16
0x00,0x00,0x02,0x04,0x09,0x11,0x23,0xC3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x07,0x0A,0x14,0x28,0x50,0x60,0x00,
//Sleep
//width = 16
//height = 16
0x00,0x00,0x00,0xC6,0xE6,0xF6,0xBE,0x9E,0x86,0x00,0x40,0x40,0xC0,0xC0,0xC0,0x00,
0x00,0x00,0x00,0x01,0x01,0x45,0x65,0x75,0x5D,0x00,0x06,0x07,0x07,0x05,0x04,0x00,
//Menu
//width = 16
//height = 16
0x00,0x80,0x18,0x98,0x58,0x18,0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x00,0x00,
0x00,0x00,0x19,0x18,0x00,0x00,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x00,0x00,
//Wrench
//width = 16
//height = 16
0x00,0x00,0x18,0x30,0x32,0x7E,0x7C,0xF0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x0F,0x3E,0x7E,0x4C,0x0C,0x18,0x00,
#ifdef NOTUSED
//Calibration (Not used, kept for future menu layouts)
//width = 16
//height = 16
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0x70,0x7A,0x5E,0x8E,0x1C,0x30,0x00,
0x00,0x20,0x70,0x38,0x1C,0x0E,0x07,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
#endif
};
const uint8_t FONT_6x8[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 000: ' ' U+0020 (utf-8: 20)
0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, // 001: '!' U+0021 (utf-8: 21)

View File

@@ -11,7 +11,7 @@
#define SETTINGS_H_
#include <stdint.h>
#include "stm32f1xx_hal.h"
#define SETTINGSVERSION 0x11 /*Change this if you change the struct below to prevent people getting out of sync*/
#define SETTINGSVERSION 0x12 /*Change this if you change the struct below to prevent people getting out of sync*/
/*
* This struct must be a multiple of 2 bytes as it is saved / restored from flash in uint16_t chunks
@@ -30,6 +30,7 @@ typedef struct {
uint8_t detailedIDLE :1; //Detailed idle screen
uint8_t detailedSoldering :1; //Detailed soldering screens
uint8_t temperatureInF; //Should the temp be in F or C (true is F)
uint8_t descriptionScrollSpeed:1; // Description scroll speed
uint16_t voltageDiv; //Voltage divisor factor
uint16_t BoostTemp; //Boost mode set point for the iron
int16_t CalibrationOffset; //This stores the temperature offset for this tip in the iron.
@@ -37,7 +38,7 @@ typedef struct {
uint32_t padding; //This is here for in case we are not an even divisor so that nothing gets cut off
} systemSettingsType;
extern systemSettingsType systemSettings;
extern volatile systemSettingsType systemSettings;
void saveSettings();
void restoreSettings();

View File

@@ -17,8 +17,11 @@ enum ShortNameType {
* use SettingsShortNames as SettingsShortNames[16][1].. second column undefined
*/
extern const enum ShortNameType SettingsShortNameType;
extern const char* SettingsShortNames[16][2];
extern const char* SettingsLongNames[16];
extern const char* SettingsShortNames[17][2];
extern const char* SettingsDescriptions[17];
extern const char* SettingsMenuEntries[4];
extern const char* SettingsMenuEntriesDescriptions[4];
extern const char* SettingsCalibrationWarning;
extern const char* SettingsResetWarning;
extern const char* UVLOWarningString;
@@ -43,6 +46,9 @@ extern const char SettingRightChar;
extern const char SettingLeftChar;
extern const char SettingAutoChar;
#define LANG_EN
extern const char SettingFastChar;
extern const char SettingSlowChar;
#endif /* TRANSLATION_H_ */

View File

@@ -5,17 +5,16 @@
* Author: Ben V. Brown
*/
#ifndef GUI_H_
#define GUI_H_
#ifndef GUI_HPP_
#define GUI_HPP_
#include "Translation.h"
#include "Settings.h"
#include "hardware.h"
//GUI holds the menu structure and all its methods for the menu itself
#include "main.hpp"
#include "Settings.h"
#include "Translation.h"
//Declarations for all the methods for the settings menu (at end of this file)
//Wrapper for holding a function pointer
typedef struct state_func_t {
void (*func)(void);
@@ -28,6 +27,7 @@ typedef struct {
const state_func draw;
} menuitem;
extern const menuitem settingsMenu[];
void enterSettingsMenu();
extern const menuitem rootSettingsMenu[];
#endif /* GUI_H_ */
#endif /* GUI_HPP_ */