- First complete version of firmware. Currently being tested in the rehearsal room
- Added bunch of screens, fonts and images - Added script to read out frame buffer (function currently disabled in Firmware)
This commit is contained in:
286
Firmware/Screens_Display/Common_Screen_Elements.c
Normal file
286
Firmware/Screens_Display/Common_Screen_Elements.c
Normal file
@@ -0,0 +1,286 @@
|
||||
/*
|
||||
* File: Common_Screen_Elements.c
|
||||
*
|
||||
* Created: Created: Sunday October 2025 19:57:27
|
||||
* Author: Chris
|
||||
*/
|
||||
#include "Common_Screen_Elements.h"
|
||||
|
||||
// ============================================================================================
|
||||
// Includes
|
||||
#include "../Display_Color.h"
|
||||
#include "../Display_Config.h"
|
||||
#include "../Display_Shapes.h"
|
||||
#include "../Display_Objects.h"
|
||||
|
||||
#include "../Hue.h"
|
||||
#include "../EEPROM_M24C64.h"
|
||||
#include "../MIDI_Note_List.h"
|
||||
#include "../Command_Definition.h"
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Defines
|
||||
#define PAUSE_LIGHT_COLOR_RGB565 DISPLAY_COLOR_FROM_RGB888(_EEPROM_Content.Pause_Light_Configuration[LED_Channel_1].Color.R, _EEPROM_Content.Pause_Light_Configuration[LED_Channel_1].Color.G, _EEPROM_Content.Pause_Light_Configuration[LED_Channel_1].Color.B)
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Variables
|
||||
extern const uint8_t _Font_DejaVu_Sans_Mono_10x17[];
|
||||
extern const uint8_t _Font_DejaVu_Sans_Mono_15x25[];
|
||||
extern const uint8_t _Font_DejaVu_Sans_Mono_Bold_11x17[];
|
||||
extern const uint8_t _Font_DejaVu_Sans_Mono_Bold_15x26[];
|
||||
|
||||
extern const uint16_t _Image_Forest_Pine_Midi_64x64[];
|
||||
extern const uint16_t _Image_Steel_Blue_Jam_Happy_64x64[];
|
||||
extern const uint16_t _Image_Stone_Blue_Light_On_64x64[];
|
||||
|
||||
extern volatile bool _MIDI_To_Light_Enabled;
|
||||
extern Info_Last_Received_Note_t _Info_Last_Applied_Note[NUM_LED_CHANNELS];
|
||||
extern uint8_t _Current_Duty_Cylces[NUM_LED_CHANNELS][NUM_LED_COLORS];
|
||||
extern volatile Pause_Light_Timer_s _Pause_Light_Timer[NUM_LED_CHANNELS];
|
||||
|
||||
|
||||
// Variables and Objects IDs for the MIDI Mode Activity
|
||||
static Object_ID _Object_Midi_Text_MIDI_Enabled;
|
||||
static Object_ID _Object_Midi_Text_MIDI_Last_Applied;
|
||||
static Object_ID _Object_Midi_Text_Pause_Light_Enabled;
|
||||
static Object_ID _Object_Midi_Text_Pause_Light_Active;
|
||||
static Object_ID _Object_Midi_Text_Pause_Light_Counter;
|
||||
static Object_ID _Object_Midi_Text_Pause_Light_ValueBar;
|
||||
|
||||
static float _Pause_Light_Timeout_s;
|
||||
static uint32_t _Pause_Light_Timeout_Ticks;
|
||||
static uint32_t _Pause_Light_FadeOut_Counter;
|
||||
|
||||
// Variables and Objects IDs for the JAM Mode Activity
|
||||
static Object_ID _Object_Jam_Current_Hue_Angle;
|
||||
static Object_ID _Object_Jam_Timeout_ValueBar;
|
||||
|
||||
static uint32_t _Jam_Hue_Angle_Now;
|
||||
static uint32_t _Jam_Hue_Angle_Next;
|
||||
static float _Jam_Hue_Angle_Timer_s;
|
||||
static uint32_t _Jam_Hue_Angle_Timer_Ticks;
|
||||
|
||||
// Objects IDs for the Const Mode Activity
|
||||
static Object_ID _Object_Const_Color_Circle;
|
||||
static Object_ID _Object_Const_Color_Text_1, _Object_Const_Color_Text_2;
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Function Declarations
|
||||
void Common_Screen_Element_Init_Mode_Activity_Midi();
|
||||
void Common_Screen_Element_Init_Mode_Activity_Jam();
|
||||
void Common_Screen_Element_Init_Mode_Activity_Const();
|
||||
|
||||
void Common_Screen_Element_Tick_Mode_Activity_Midi();
|
||||
void Common_Screen_Element_Tick_Mode_Activity_Jam();
|
||||
void Common_Screen_Element_Tick_Mode_Activity_Const();
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
Functions
|
||||
*******************************************************************/
|
||||
void Common_Screen_Element_Init_Current_Mode(Mode mode)
|
||||
{
|
||||
uint16_t* Image = NULL;
|
||||
char Mode_Name[20];
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case MIDI: sprintf(Mode_Name, "MIDI"); Image = (uint16_t*)_Image_Forest_Pine_Midi_64x64; break;
|
||||
case JAM: sprintf(Mode_Name, "Jam"); Image = (uint16_t*)_Image_Steel_Blue_Jam_Happy_64x64; break;
|
||||
case CONSTANT: sprintf(Mode_Name, "Constant"); Image = (uint16_t*)_Image_Stone_Blue_Light_On_64x64; break;
|
||||
}
|
||||
|
||||
Display_Objects_Add_Image(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 40, NOT_SELECTABLE, Image, 0, NO_STYLE, NO_ANIMATION);
|
||||
|
||||
char Title[30];
|
||||
sprintf(Title, "Mode: %s", Mode_Name);
|
||||
|
||||
Font_ID Font_Title = Display_Objects_Add_Font(_Font_DejaVu_Sans_Mono_15x25, 0);
|
||||
Display_Objects_Add_Text(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 65, NOT_SELECTABLE, Title, Font_Title, DISPLAY_COLOR_LIGHTGREY, NO_STYLE, NO_ANIMATION);
|
||||
}
|
||||
|
||||
void Common_Screen_Element_Init_Mode_Activity(Mode mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case MIDI: Common_Screen_Element_Init_Mode_Activity_Midi(); break;
|
||||
case JAM: Common_Screen_Element_Init_Mode_Activity_Jam(); break;
|
||||
case CONSTANT: Common_Screen_Element_Init_Mode_Activity_Const(); break;
|
||||
}
|
||||
}
|
||||
|
||||
void Common_Screen_Element_Tick_Mode_Activity(Mode mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case MIDI: Common_Screen_Element_Tick_Mode_Activity_Midi(); break;
|
||||
case JAM: Common_Screen_Element_Tick_Mode_Activity_Jam(); break;
|
||||
case CONSTANT: Common_Screen_Element_Tick_Mode_Activity_Const(); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
Internal Functions
|
||||
*******************************************************************/
|
||||
void Common_Screen_Element_Init_Mode_Activity_Midi()
|
||||
{
|
||||
_Pause_Light_Timeout_s = 0.0f;
|
||||
_Pause_Light_Timeout_Ticks = 0;
|
||||
|
||||
const int16_t Text_Y_Percent_Distance = 8;
|
||||
|
||||
char MIDI_Settings[100];
|
||||
|
||||
sprintf(MIDI_Settings, "Ch %02u / Octave %+d", _EEPROM_Content.Channel_MIDI_Configuration[LED_Channel_1].MIDI_Channel+1, _EEPROM_Content.Channel_MIDI_Configuration[LED_Channel_1].Octave);
|
||||
|
||||
Font_ID Font_Regular = Display_Objects_Add_Font(_Font_DejaVu_Sans_Mono_10x17, 0);
|
||||
Font_ID Font_Bold = Display_Objects_Add_Font(_Font_DejaVu_Sans_Mono_Bold_11x17, 0);
|
||||
|
||||
int16_t Midi_Y_Percent = 20;
|
||||
Display_Objects_Add_Text(LEFT_MIDDLE, BOTH_IN_PERCENT, 20, Midi_Y_Percent, NOT_SELECTABLE, "Midi to Light", Font_Bold, DISPLAY_COLOR_LIGHTGREY, NO_STYLE, NO_ANIMATION);
|
||||
Midi_Y_Percent += Text_Y_Percent_Distance;
|
||||
|
||||
_Object_Midi_Text_MIDI_Enabled = Display_Objects_Add_Text(LEFT_MIDDLE, BOTH_IN_PERCENT, 20, Midi_Y_Percent, NOT_SELECTABLE, "", Font_Regular, DISPLAY_COLOR_BLACK, NO_STYLE, NO_ANIMATION);
|
||||
Midi_Y_Percent += Text_Y_Percent_Distance;
|
||||
|
||||
Display_Objects_Add_Text(LEFT_MIDDLE, BOTH_IN_PERCENT, 20, Midi_Y_Percent, NOT_SELECTABLE, MIDI_Settings, Font_Regular, DISPLAY_COLOR_LIGHTGREY, NO_STYLE, NO_ANIMATION);
|
||||
Midi_Y_Percent += Text_Y_Percent_Distance;
|
||||
|
||||
_Object_Midi_Text_MIDI_Last_Applied = Display_Objects_Add_Text(LEFT_MIDDLE, BOTH_IN_PERCENT, 20, Midi_Y_Percent, NOT_SELECTABLE, "", Font_Regular, DISPLAY_COLOR_LIGHTGREY, NO_STYLE, NO_ANIMATION);
|
||||
|
||||
|
||||
|
||||
int16_t Pause_Light_Y_Percent = 57;
|
||||
Display_Objects_Add_Text(LEFT_MIDDLE, BOTH_IN_PERCENT, 20, Pause_Light_Y_Percent, NOT_SELECTABLE, "Pause Light", Font_Bold, DISPLAY_COLOR_LIGHTGREY, NO_STYLE, NO_ANIMATION);
|
||||
Pause_Light_Y_Percent += Text_Y_Percent_Distance;
|
||||
|
||||
_Object_Midi_Text_Pause_Light_Enabled = Display_Objects_Add_Text(LEFT_MIDDLE, BOTH_IN_PERCENT, 20, Pause_Light_Y_Percent, NOT_SELECTABLE, "", Font_Regular, DISPLAY_COLOR_BLACK, NO_STYLE, NO_ANIMATION);
|
||||
Pause_Light_Y_Percent += Text_Y_Percent_Distance;
|
||||
|
||||
_Object_Midi_Text_Pause_Light_Active = Display_Objects_Add_Text(LEFT_MIDDLE, BOTH_IN_PERCENT, 20, Pause_Light_Y_Percent, NOT_SELECTABLE, "", Font_Regular, DISPLAY_COLOR_BLACK, NO_STYLE, NO_ANIMATION);
|
||||
Pause_Light_Y_Percent += Text_Y_Percent_Distance;
|
||||
|
||||
_Object_Midi_Text_Pause_Light_ValueBar = Display_Objects_Add_Value_Bar_Arc(BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, &_Pause_Light_Timeout_Ticks,
|
||||
(uint32_t)(_EEPROM_Content.Pause_Light_Configuration[LED_Channel_1].Timeout * 1000 / TIMER_INTERVALL_LED_UPDATE_ms), 1,
|
||||
(uint32_t)(_EEPROM_Content.Pause_Light_Configuration[LED_Channel_1].Timeout * 1000 / TIMER_INTERVALL_LED_UPDATE_ms), 10,
|
||||
PAUSE_LIGHT_COLOR_RGB565, 110, 4, ARC_FRAME_AUTO_STEPS, -90, 270, NO_STYLE, NO_ANIMATION);
|
||||
|
||||
_Object_Midi_Text_Pause_Light_Counter = Display_Objects_Add_Float(LEFT_MIDDLE, BOTH_IN_PERCENT, 20, Pause_Light_Y_Percent, NOT_SELECTABLE, &_Pause_Light_Timeout_s, "%04.2fs", Font_Regular, DISPLAY_COLOR_LIGHTGREY, NO_STYLE, NO_ANIMATION);
|
||||
}
|
||||
|
||||
void Common_Screen_Element_Init_Mode_Activity_Jam()
|
||||
{
|
||||
_Jam_Hue_Angle_Now = 0;
|
||||
_Jam_Hue_Angle_Next = 0;
|
||||
_Jam_Hue_Angle_Timer_s = 0.0;
|
||||
_Jam_Hue_Angle_Timer_Ticks = 0;
|
||||
|
||||
const int16_t Text_Y_Percent_Distance = 8;
|
||||
|
||||
Font_ID Font_Regular = Display_Objects_Add_Font(_Font_DejaVu_Sans_Mono_10x17, 0);
|
||||
Font_ID Font_Bold = Display_Objects_Add_Font(_Font_DejaVu_Sans_Mono_Bold_11x17, 0);
|
||||
|
||||
int16_t Text_Y_Percent = 35;
|
||||
Display_Objects_Add_Text(LEFT_MIDDLE, BOTH_IN_PERCENT, 20, Text_Y_Percent, NOT_SELECTABLE, "Jam Mode", Font_Bold, DISPLAY_COLOR_LIGHTGREY, NO_STYLE, NO_ANIMATION);
|
||||
Text_Y_Percent += Text_Y_Percent_Distance;
|
||||
|
||||
Display_Objects_Add_Integer(LEFT_MIDDLE, BOTH_IN_PERCENT, 20, Text_Y_Percent, NOT_SELECTABLE, (int*)&_Jam_Hue_Angle_Now, "Now: %d Deg", Font_Regular, DISPLAY_COLOR_LIGHTGREY, NO_STYLE, NO_ANIMATION);
|
||||
Text_Y_Percent += Text_Y_Percent_Distance;
|
||||
|
||||
Display_Objects_Add_Integer(LEFT_MIDDLE, BOTH_IN_PERCENT, 20, Text_Y_Percent, NOT_SELECTABLE, (int*)&_Jam_Hue_Angle_Next, "Next: %d Deg", Font_Regular, DISPLAY_COLOR_LIGHTGREY, NO_STYLE, NO_ANIMATION);
|
||||
Text_Y_Percent += Text_Y_Percent_Distance;
|
||||
|
||||
Display_Objects_Add_Float(LEFT_MIDDLE, BOTH_IN_PERCENT, 20, Text_Y_Percent, NOT_SELECTABLE, &_Jam_Hue_Angle_Timer_s, "%04.2fs", Font_Regular, DISPLAY_COLOR_LIGHTGREY, NO_STYLE, NO_ANIMATION);
|
||||
|
||||
_Object_Jam_Current_Hue_Angle = Display_Objects_Add_Value_Bar_Arc(BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, &_Jam_Hue_Angle_Now, 359, 0, 1, 400, DISPLAY_COLOR_RED, 115, 4, ARC_FRAME_AUTO_STEPS, -90, 270, NO_STYLE, NO_ANIMATION);
|
||||
_Object_Jam_Timeout_ValueBar = Display_Objects_Add_Value_Bar_Arc(BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, &_Jam_Hue_Angle_Timer_Ticks, Mode_Manager_Jam_Get_Duration_Tick(), 0, 1000, 1000, DISPLAY_COLOR_LIGHTGREY, 105, 4, ARC_FRAME_AUTO_STEPS, -90, 270, NO_STYLE, NO_ANIMATION);
|
||||
}
|
||||
|
||||
void Common_Screen_Element_Init_Mode_Activity_Const()
|
||||
{
|
||||
Font_ID Font = Display_Objects_Add_Font(_Font_DejaVu_Sans_Mono_Bold_11x17, 0);
|
||||
|
||||
_Object_Const_Color_Circle = Display_Objects_Add_Circle_Filled(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 35, NOT_SELECTABLE, DISPLAY_COLOR_BLACK, 40, NO_STYLE, NO_ANIMATION);
|
||||
_Object_Const_Color_Text_1 = Display_Objects_Add_Text(CENTER_BOTTOM, BOTH_IN_PERCENT, 50, 68, NOT_SELECTABLE, "Constant Light", Font, DISPLAY_COLOR_LIGHTGREY, NO_STYLE, NO_ANIMATION);
|
||||
_Object_Const_Color_Text_2 = Display_Objects_Add_Text(CENTER_TOP, BOTH_IN_PERCENT, 50, 70, NOT_SELECTABLE, "is on", Font, DISPLAY_COLOR_LIGHTGREY, NO_STYLE, NO_ANIMATION);
|
||||
}
|
||||
|
||||
void Common_Screen_Element_Tick_Mode_Activity_Midi()
|
||||
{
|
||||
char MIDI_Last_Applied[100];
|
||||
char Event[4];
|
||||
char Note[3];
|
||||
|
||||
if(_Info_Last_Applied_Note[LED_Channel_1].Event == MIDI_EVENT_NOTE_ON) {
|
||||
sprintf(Event, "On");
|
||||
}
|
||||
else if(_Info_Last_Applied_Note[LED_Channel_1].Event == MIDI_EVENT_NOTE_OFF) {
|
||||
sprintf(Event, "Off");
|
||||
} else
|
||||
{
|
||||
sprintf(Event, "-");
|
||||
}
|
||||
|
||||
if(_Info_Last_Applied_Note[LED_Channel_1].Note_In_Octave != NO_NOTE) {
|
||||
sprintf(Note, "%s", _MIDI_Note_List[_Info_Last_Applied_Note[LED_Channel_1].Note_In_Octave].Tone_Name);
|
||||
}
|
||||
else {
|
||||
sprintf(Note, "-");
|
||||
}
|
||||
|
||||
sprintf(MIDI_Last_Applied, "Note %s %s (%u)", Note, Event, _Info_Last_Applied_Note[LED_Channel_1].Velocity);
|
||||
|
||||
Display_Objects_Update_Text(_Object_Midi_Text_MIDI_Enabled, _MIDI_To_Light_Enabled == true ? "Enabled" : "Disabled");
|
||||
Display_Objects_Update_Text(_Object_Midi_Text_MIDI_Last_Applied, MIDI_Last_Applied);
|
||||
Display_Objects_Update_Text(_Object_Midi_Text_Pause_Light_Enabled, _EEPROM_Content.Pause_Light_Configuration[LED_Channel_1].Enabled > 0 ? "Enabled" : "Disabled");
|
||||
Display_Objects_Update_Text(_Object_Midi_Text_Pause_Light_Active, _Pause_Light_Timer[LED_Channel_1].Is_Active == true ? "On" : "Off");
|
||||
|
||||
Display_Objects_Update_Color(_Object_Midi_Text_MIDI_Enabled, _MIDI_To_Light_Enabled == true ? DISPLAY_COLOR_GREEN : DISPLAY_COLOR_RED);
|
||||
Display_Objects_Update_Color(_Object_Midi_Text_Pause_Light_Enabled, _EEPROM_Content.Pause_Light_Configuration[LED_Channel_1].Enabled > 0 ? DISPLAY_COLOR_GREEN : DISPLAY_COLOR_RED);
|
||||
Display_Objects_Update_Color(_Object_Midi_Text_Pause_Light_Active, _Pause_Light_Timer[LED_Channel_1].Is_Active == true ? DISPLAY_COLOR_GREEN : DISPLAY_COLOR_RED);
|
||||
|
||||
_Pause_Light_Timeout_s = _EEPROM_Content.Pause_Light_Configuration[LED_Channel_1].Timeout - ((float)(_Pause_Light_Timer[LED_Channel_1].Timer * TIMER_INTERVALL_LED_UPDATE_ms)) / 1000.0f;
|
||||
|
||||
if(_Pause_Light_Timeout_s < 0.01f) {
|
||||
if(_Pause_Light_FadeOut_Counter < 60) {
|
||||
_Pause_Light_FadeOut_Counter++;
|
||||
}
|
||||
if(_Pause_Light_FadeOut_Counter >= 20) {
|
||||
// Display_Objects_Update_Color(_Object_Midi_Text_MIDI_Last_Applied, Display_Color_Interpolate_Float(DISPLAY_COLOR_LIGHTGREY, DISPLAY_COLOR_BLACK, (float)(_Pause_Light_FadeOut_Counter-20) / 40.0f));
|
||||
Display_Objects_Update_Color(_Object_Midi_Text_Pause_Light_Counter, Display_Color_Interpolate_Float(DISPLAY_COLOR_LIGHTGREY, DISPLAY_COLOR_BLACK, (float)(_Pause_Light_FadeOut_Counter-20) / 40.0f));
|
||||
Display_Objects_Update_Color(_Object_Midi_Text_Pause_Light_ValueBar, Display_Color_Interpolate_Float(PAUSE_LIGHT_COLOR_RGB565, DISPLAY_COLOR_BLACK, (float)(_Pause_Light_FadeOut_Counter-20) / 40.0f));
|
||||
}
|
||||
}
|
||||
else {
|
||||
_Pause_Light_FadeOut_Counter = 0;
|
||||
// Display_Objects_Update_Color(_Object_Midi_Text_MIDI_Last_Applied, DISPLAY_COLOR_LIGHTGREY);
|
||||
Display_Objects_Update_Color(_Object_Midi_Text_Pause_Light_Counter, DISPLAY_COLOR_LIGHTGREY);
|
||||
Display_Objects_Update_Color(_Object_Midi_Text_Pause_Light_ValueBar, PAUSE_LIGHT_COLOR_RGB565);
|
||||
}
|
||||
|
||||
uint32_t Total_Pause_Light_Timeout_Ticks = (uint32_t)(_EEPROM_Content.Pause_Light_Configuration[LED_Channel_1].Timeout * 1000 / TIMER_INTERVALL_LED_UPDATE_ms);
|
||||
_Pause_Light_Timeout_Ticks = Total_Pause_Light_Timeout_Ticks - _Pause_Light_Timer[LED_Channel_1].Timer;
|
||||
}
|
||||
|
||||
void Common_Screen_Element_Tick_Mode_Activity_Jam()
|
||||
{
|
||||
LED_Data_t Hue_Color;
|
||||
|
||||
_Jam_Hue_Angle_Now = Mode_Manager_Jam_Get_Current_Angle();
|
||||
_Jam_Hue_Angle_Next = Mode_Manager_Jam_Get_Next_Angle();
|
||||
_Jam_Hue_Angle_Timer_Ticks = Mode_Manager_Jam_Get_Time_Left_Tick();
|
||||
_Jam_Hue_Angle_Timer_s = (float)(_Jam_Hue_Angle_Timer_Ticks * 40) / 1000.0f;
|
||||
|
||||
Hue_Color.Pixel = Hue_Get_Color_From_Angle(_Jam_Hue_Angle_Now);
|
||||
Display_Objects_Update_Color(_Object_Jam_Current_Hue_Angle, DISPLAY_COLOR_FROM_RGB888(Hue_Color.R, Hue_Color.G, Hue_Color.B));
|
||||
Display_Objects_Update_Max_Min(_Object_Jam_Timeout_ValueBar, Mode_Manager_Jam_Get_Duration_Tick(), 0);
|
||||
}
|
||||
|
||||
void Common_Screen_Element_Tick_Mode_Activity_Const()
|
||||
{
|
||||
Display_Objects_Update_Color(_Object_Const_Color_Circle, DISPLAY_COLOR_FROM_RGB888(_Current_Duty_Cylces[LED_Channel_1][R], _Current_Duty_Cylces[LED_Channel_1][G], _Current_Duty_Cylces[LED_Channel_1][B]));
|
||||
}
|
||||
34
Firmware/Screens_Display/Common_Screen_Elements.h
Normal file
34
Firmware/Screens_Display/Common_Screen_Elements.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* File: Common_Screen_Elements.h
|
||||
* Created: Created: Sunday October 2025 19:57:22
|
||||
* Author: Chris
|
||||
*/
|
||||
#ifndef COMMON_SCREEN_ELEMENTS_H
|
||||
#define COMMON_SCREEN_ELEMENTS_H
|
||||
|
||||
// ============================================================================================
|
||||
// Includes
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../Mode_Manager.h"
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Defines
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Datatypes
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Function Declarations
|
||||
void Common_Screen_Element_Init_Current_Mode(Mode mode);
|
||||
void Common_Screen_Element_Init_Mode_Activity(Mode mode);
|
||||
|
||||
void Common_Screen_Element_Tick_Mode_Activity(Mode mode);
|
||||
|
||||
|
||||
#endif // COMMON_SCREEN_ELEMENTS_H
|
||||
171
Firmware/Screens_Display/Screen_Default_Notes.c
Normal file
171
Firmware/Screens_Display/Screen_Default_Notes.c
Normal file
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* File: Screen_Default_Notes.c
|
||||
*
|
||||
* Created: Created: Sunday September 2025 21:09:49
|
||||
* Author: Chris
|
||||
*/
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Includes
|
||||
#include "../Screens.h"
|
||||
#include "../UI_Control.h"
|
||||
#include "../Mode_Manager.h"
|
||||
|
||||
#include "../Display.h"
|
||||
#include "../Display_Objects.h"
|
||||
#include "../Display_Render_Complex.h"
|
||||
#include "../Display_Default_Configurations.h"
|
||||
|
||||
// ============================================================================================
|
||||
// Defines
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Variables
|
||||
static Object_ID _Object_Message_Box;
|
||||
|
||||
static const Hierarchical_Menu* _Return_Menu = NULL;
|
||||
static const Menu_List* _Return_List = NULL;
|
||||
static int32_t _Return_Selected_Item;
|
||||
|
||||
static char* _Title;
|
||||
static uint32_t _Title_Length;
|
||||
static bool _Bool_Value;
|
||||
static bool _Decision_Made;
|
||||
static uint32_t _Counter;
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Function Declarations
|
||||
void Screen_Setup_Default_Notes(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration, char* title, uint32_t title_length, const Hierarchical_Menu* return_menu, const Menu_List* return_list, int32_t return_selected_item);
|
||||
|
||||
static void Screen_Init (Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration);
|
||||
static void Screen_Tick (void);
|
||||
static void Screen_Click (uint button_return_value);
|
||||
static void Screen_Touch_Event (int16_t x, int16_t y);
|
||||
static void Screen_Action_CW (Object_ID object_id);
|
||||
static void Screen_Action_CCW (Object_ID object_id);
|
||||
static void Screen_On_Object_Focused (Object_ID object_id);
|
||||
static void Screen_On_Object_Defocused (Object_ID object_id);
|
||||
static void Screen_On_Object_Select (Object_ID object_id);
|
||||
static void Screen_On_Object_Deselect (Object_ID object_id);
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
Functions
|
||||
*******************************************************************/
|
||||
void Screen_Setup_Default_Notes(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration, char* title, uint32_t title_length, const Hierarchical_Menu* return_menu, const Menu_List* return_list, int32_t return_selected_item)
|
||||
{
|
||||
_Title = title;
|
||||
_Title_Length = title_length;
|
||||
_Bool_Value = false;
|
||||
|
||||
Screen_Init(direction_out, direction_in, type, frame_duration);
|
||||
|
||||
_Return_Menu = return_menu;
|
||||
_Return_List = return_list;
|
||||
_Return_Selected_Item = return_selected_item;
|
||||
|
||||
_Decision_Made = false;
|
||||
_Counter = 0;
|
||||
}
|
||||
|
||||
void Screen_Init(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration)
|
||||
{
|
||||
_Screen_Last = Screen_Init;
|
||||
_Screen_Tick = Screen_Tick;
|
||||
_Screen_Click = Screen_Click;
|
||||
_Screen_Touch_Event = Screen_Touch_Event;
|
||||
_Screen_Action_CW = Screen_Action_CW;
|
||||
_Screen_Action_CCW = Screen_Action_CCW;
|
||||
_Screen_On_Objects_Focused = Screen_On_Object_Focused;
|
||||
_Screen_On_Objects_Defocused = Screen_On_Object_Defocused;
|
||||
_Screen_On_Object_Select = Screen_On_Object_Select;
|
||||
_Screen_On_Object_Deselect = Screen_On_Object_Deselect;
|
||||
|
||||
Display_Objects_Clear();
|
||||
Display_Screen_Transition_Start(direction_out, direction_in, type, frame_duration);
|
||||
|
||||
|
||||
//////////////////////////////
|
||||
// Add Display Objects here //
|
||||
//////////////////////////////
|
||||
Display_Render_Complex_Select_YesNo_Set(_Bool_Value, &_Configuration_Default_Select_YesNo);
|
||||
Display_Objects_Add_Select_YesNo(_Title, _Title_Length, &_Bool_Value, &_Configuration_Default_Select_YesNo);
|
||||
_Object_Message_Box = Display_Objects_Add_Message_Box(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, "Notes Set", MESSAGE_BOX_ICON_CIRCLE_CHECKMARK, &_Message_Box_Style_Regular);
|
||||
|
||||
Display_Select_Object();
|
||||
}
|
||||
|
||||
void Screen_Tick(void)
|
||||
{
|
||||
if(_Decision_Made) {
|
||||
_Counter++;
|
||||
}
|
||||
|
||||
if(_Counter == MESSAGE_BOX_DEFAULT_TICKS) {
|
||||
Screen_Setup_Settings_Hierarchical_Menu(TRANSITION_DOWN, TRANSITION_RIGHT, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, _Return_Menu, _Return_List, _Return_Selected_Item);
|
||||
}
|
||||
}
|
||||
|
||||
void Screen_Click(uint button_return_value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_Touch_Event(int16_t x, int16_t y)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_Action_CW(Object_ID object_id)
|
||||
{
|
||||
if(_Decision_Made) {
|
||||
return;
|
||||
}
|
||||
|
||||
_Bool_Value = !_Bool_Value;
|
||||
}
|
||||
|
||||
void Screen_Action_CCW(Object_ID object_id)
|
||||
{
|
||||
Screen_Action_CW(object_id);
|
||||
}
|
||||
|
||||
void Screen_On_Object_Focused(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Defocused(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Select(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Deselect(Object_ID object_id)
|
||||
{
|
||||
if(!_Decision_Made) {
|
||||
|
||||
if(_Bool_Value) {
|
||||
Mode_Manager_Set_Default_Color_Notes();
|
||||
|
||||
Display_Objects_Show_Message_Box(_Object_Message_Box, MESSAGE_BOX_DEFAULT_TICKS);
|
||||
}
|
||||
else {
|
||||
Screen_Setup_Settings_Hierarchical_Menu(TRANSITION_DOWN, TRANSITION_RIGHT, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, _Return_Menu, _Return_List, _Return_Selected_Item);
|
||||
}
|
||||
_Decision_Made = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
Internal Functions
|
||||
*******************************************************************/
|
||||
|
||||
218
Firmware/Screens_Display/Screen_EEPROM_Code.c
Normal file
218
Firmware/Screens_Display/Screen_EEPROM_Code.c
Normal file
@@ -0,0 +1,218 @@
|
||||
/*
|
||||
* File: Screen_EEPROM_Code.c
|
||||
*
|
||||
* Created: Created: Monday September 2025 16:11:48
|
||||
* Author: Chris
|
||||
*/
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Includes
|
||||
#include "../Screens.h"
|
||||
#include "../UI_Control.h"
|
||||
|
||||
#include "../Display.h"
|
||||
#include "../Display_Objects.h"
|
||||
#include "../Display_Default_Configurations.h"
|
||||
|
||||
// ============================================================================================
|
||||
// Defines
|
||||
#define BOX_X_TARGET (DISPLAY_X_CENTER + (_Character_Select - 1) * _Character_X_Distance - 1)
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Variables
|
||||
extern const unsigned char _Font_DejaVu_Sans_Mono_Bold_11x17[];
|
||||
extern const uint8_t _Font_DejaVu_Sans_Mono_20x34[];
|
||||
|
||||
static Object_ID _Object_Code[3];
|
||||
static Object_ID _Object_Box;
|
||||
|
||||
static int32_t _Code[3] = { 4, 4, 12 };
|
||||
static int32_t _Input[3];
|
||||
static int32_t _Character_Select;
|
||||
static char _Character[3][2];
|
||||
|
||||
static const int16_t _Character_X_Distance = 50;
|
||||
static int16_t _Box_X_Current;
|
||||
static int16_t _Box_X_Target;
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Function Declarations
|
||||
void Screen_Setup_EEPROM_Code(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration);
|
||||
|
||||
static char HexNumber_To_ASCII (char hex_number);
|
||||
|
||||
static void Screen_Init (Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration);
|
||||
static void Screen_Tick (void);
|
||||
static void Screen_Click (uint button_return_value);
|
||||
static void Screen_Touch_Event (int16_t x, int16_t y);
|
||||
static void Screen_Action_CW (Object_ID object_id);
|
||||
static void Screen_Action_CCW (Object_ID object_id);
|
||||
static void Screen_On_Object_Focused (Object_ID object_id);
|
||||
static void Screen_On_Object_Defocused (Object_ID object_id);
|
||||
static void Screen_On_Object_Select (Object_ID object_id);
|
||||
static void Screen_On_Object_Deselect (Object_ID object_id);
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
Functions
|
||||
*******************************************************************/
|
||||
void Screen_Setup_EEPROM_Code(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration)
|
||||
{
|
||||
_Input[0] = 0;
|
||||
_Input[1] = 0;
|
||||
_Input[2] = 0;
|
||||
|
||||
_Character_Select = 0;
|
||||
|
||||
_Box_X_Target = BOX_X_TARGET;
|
||||
_Box_X_Current = _Box_X_Target;
|
||||
|
||||
|
||||
Screen_Init(direction_out, direction_in, type, frame_duration);
|
||||
}
|
||||
|
||||
void Screen_Init(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration)
|
||||
{
|
||||
_Screen_Last = Screen_Init;
|
||||
_Screen_Tick = Screen_Tick;
|
||||
_Screen_Click = Screen_Click;
|
||||
_Screen_Touch_Event = Screen_Touch_Event;
|
||||
_Screen_Action_CW = Screen_Action_CW;
|
||||
_Screen_Action_CCW = Screen_Action_CCW;
|
||||
_Screen_On_Objects_Focused = Screen_On_Object_Focused;
|
||||
_Screen_On_Objects_Defocused = Screen_On_Object_Defocused;
|
||||
_Screen_On_Object_Select = Screen_On_Object_Select;
|
||||
_Screen_On_Object_Deselect = Screen_On_Object_Deselect;
|
||||
|
||||
Display_Objects_Clear();
|
||||
Display_Screen_Transition_Start(direction_out, direction_in, type, frame_duration);
|
||||
|
||||
|
||||
//////////////////////////////
|
||||
// Add Display Objects here //
|
||||
//////////////////////////////
|
||||
Font_ID Font_Title = Display_Objects_Add_Font(_Font_DejaVu_Sans_Mono_Bold_11x17, DISPLAY_DEFAULT_CHAR_SPACING);
|
||||
Font_ID Font_Characters = Display_Objects_Add_Font(_Font_DejaVu_Sans_Mono_20x34, 0);
|
||||
|
||||
Display_Objects_Add_Text(CENTER_TOP, X_IN_PERCENT_Y_IN_PIXEL, 50, 45, NOT_SELECTABLE, "Enter Code", Font_Title, DISPLAY_COLOR_WHITE, NO_STYLE, NO_ANIMATION);
|
||||
|
||||
for(int i=0;i<3;i++) {
|
||||
_Character[i][0] = HexNumber_To_ASCII(_Input[i]);
|
||||
_Character[i][1] = '\0';
|
||||
_Object_Code[i] = Display_Objects_Add_Text(CENTER_MIDDLE, X_IN_PIXEL_Y_IN_PERCENT, DISPLAY_X_CENTER + (i-1)*_Character_X_Distance, 50, NOT_SELECTABLE, &(_Character[i][0]), Font_Characters, DISPLAY_COLOR_LIGHTGREY, NO_STYLE, NO_ANIMATION);
|
||||
}
|
||||
|
||||
_Object_Box = Display_Objects_Add_Rounded_Rectangle_Frame(CENTER_MIDDLE, X_IN_PIXEL_Y_IN_PERCENT, _Box_X_Current, 49, NOT_SELECTABLE, DISPLAY_COLOR_LIGHTGREY, 33, 39, 6, 2, NO_STYLE, NO_ANIMATION);
|
||||
|
||||
UI_Control_Acceleration_Reset();
|
||||
UI_Control_Acceleration_Set_Enabled(false);
|
||||
|
||||
Display_Select_Object();
|
||||
}
|
||||
|
||||
void Screen_Tick(void)
|
||||
{
|
||||
for(int i=0;i<3;i++) {
|
||||
Display_Color Color = i == _Character_Select ? DISPLAY_COLOR_LIGHTGREY : DISPLAY_COLOR_DARKGREY;
|
||||
_Character[i][0] = HexNumber_To_ASCII(_Input[i]);
|
||||
|
||||
Display_Objects_Update_Text(_Object_Code[i], &_Character[i][0]);
|
||||
Display_Objects_Update_Color(_Object_Code[i], Color);
|
||||
}
|
||||
|
||||
|
||||
_Box_X_Target = BOX_X_TARGET;
|
||||
|
||||
if(_Box_X_Target > _Box_X_Current) {
|
||||
int16_t Distance = abs(_Box_X_Current - _Box_X_Target);
|
||||
_Box_X_Current += ((Distance >> 1) + 1);
|
||||
}
|
||||
|
||||
Display_Objects_Update_Coordinates(_Object_Box, CENTER_MIDDLE, X_IN_PIXEL_Y_IN_PERCENT, _Box_X_Current, 49);
|
||||
}
|
||||
|
||||
void Screen_Click(uint button_return_value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_Touch_Event(int16_t x, int16_t y)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_Action_CW(Object_ID object_id)
|
||||
{
|
||||
if(_Character_Select >= (sizeof(_Input) / sizeof(int32_t))) {
|
||||
return;
|
||||
}
|
||||
|
||||
UI_Control_Selector_Inc(&_Input[_Character_Select], 0, 15, true);
|
||||
}
|
||||
|
||||
void Screen_Action_CCW(Object_ID object_id)
|
||||
{
|
||||
if(_Character_Select >= (sizeof(_Input) / sizeof(int32_t))) {
|
||||
return;
|
||||
}
|
||||
|
||||
UI_Control_Selector_Dec(&_Input[_Character_Select], 0, 15, true);
|
||||
}
|
||||
|
||||
void Screen_On_Object_Focused(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Defocused(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Select(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Deselect(Object_ID object_id)
|
||||
{
|
||||
Display_Select_Object();
|
||||
|
||||
if(_Character_Select < (sizeof(_Input) / sizeof(int32_t))) {
|
||||
_Character_Select++;
|
||||
}
|
||||
|
||||
if(_Character_Select < (sizeof(_Input) / sizeof(int32_t))) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool Code_Correct = (_Input[0] == _Code[0]) && (_Input[1] == _Code[1]) && (_Input[2] == _Code[2]);
|
||||
|
||||
_Input[0] = 0;
|
||||
_Input[1] = 0;
|
||||
_Input[2] = 0;
|
||||
|
||||
// Move to write screen instead directly to settings menu
|
||||
Screen_Setup_EEPROM_Write(TRANSITION_UP, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, Code_Correct);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
Internal Functions
|
||||
*******************************************************************/
|
||||
char HexNumber_To_ASCII(char hex_number)
|
||||
{
|
||||
if(hex_number >=0 && hex_number <= 9)
|
||||
{
|
||||
return '0' + hex_number;
|
||||
}
|
||||
else if(hex_number >= 10 && hex_number <= 15)
|
||||
{
|
||||
return 'A' + hex_number - 10;
|
||||
}
|
||||
|
||||
return '0';
|
||||
}
|
||||
296
Firmware/Screens_Display/Screen_EEPROM_Write.c
Normal file
296
Firmware/Screens_Display/Screen_EEPROM_Write.c
Normal file
@@ -0,0 +1,296 @@
|
||||
/*
|
||||
* File: Screen_EEPROM_Write.c
|
||||
*
|
||||
* Created: Created: Monday September 2025 16:12:05
|
||||
* Author: Chris
|
||||
*/
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Includes
|
||||
#include "../Screens.h"
|
||||
#include "../Easings.h"
|
||||
#include "../UI_Control.h"
|
||||
#include "../EEPROM_M24C64.h"
|
||||
|
||||
#include "../Display.h"
|
||||
#include "../Display_Color.h"
|
||||
#include "../Display_Objects.h"
|
||||
#include "../Display_Default_Configurations.h"
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Defines
|
||||
#define COLOR_DOT_ACTIVE 0xFFFF // Pure White #FFFFFF
|
||||
#define COLOR_DOT_INACTIVE 0x0842 // Dark Gray #404450
|
||||
|
||||
#define DOT_ANIMATION_SPEED 8
|
||||
|
||||
// Animation timing configuration
|
||||
#define TEXT_FADE_START_FRAME 70 // Start fading text earlier for overlap
|
||||
#define TEXT_FADE_DURATION 30 // Longer fade for smoother transition
|
||||
#define IMAGE_FADE_START_FRAME 80 // Image starts fading in
|
||||
#define IMAGE_FADE_DURATION 20 // Longer fade for smoother appearance
|
||||
#define ANIMATION_END_FRAME 160 // Total animation duration
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Variables
|
||||
extern const uint8_t _Font_DejaVu_Sans_Mono_Bold_15x26[];
|
||||
|
||||
extern const uint16_t _Image_Check_Green_64x64[];
|
||||
extern const uint16_t _Image_Check_Green_128x128[];
|
||||
extern const uint16_t _Image_Failed_Red_64x64[];
|
||||
extern const uint16_t _Image_Failed_Red_128x128[];
|
||||
|
||||
static Object_ID _Object_Text_Writing;
|
||||
static Object_ID _Object_Dots[3];
|
||||
static Object_ID _Object_Image;
|
||||
|
||||
static bool _Code_Correct;
|
||||
static int _Counter;
|
||||
static uint32_t _EEPROM_Write_Status;
|
||||
static int32_t _Dot_Animation_Phase;
|
||||
|
||||
static Display_Color _Text_Original_Color;
|
||||
static Display_Color _Dot_Active_Original_Color;
|
||||
static Display_Color _Dot_Inactive_Original_Color;
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Function Declarations
|
||||
void Screen_Setup_EEPROM_Write(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration, bool code_correct);
|
||||
|
||||
static void Update_Dot_Animation(void);
|
||||
|
||||
static void Screen_Init (Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration);
|
||||
static void Screen_Tick (void);
|
||||
static void Screen_Click (uint button_return_value);
|
||||
static void Screen_Touch_Event (int16_t x, int16_t y);
|
||||
static void Screen_Action_CW (Object_ID object_id);
|
||||
static void Screen_Action_CCW (Object_ID object_id);
|
||||
static void Screen_On_Object_Focused (Object_ID object_id);
|
||||
static void Screen_On_Object_Defocused (Object_ID object_id);
|
||||
static void Screen_On_Object_Select (Object_ID object_id);
|
||||
static void Screen_On_Object_Deselect (Object_ID object_id);
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
Functions
|
||||
*******************************************************************/
|
||||
void Screen_Setup_EEPROM_Write(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration, bool code_correct)
|
||||
{
|
||||
_Code_Correct = code_correct;
|
||||
|
||||
Screen_Init(direction_out, direction_in, type, frame_duration);
|
||||
|
||||
_Counter = 0;
|
||||
_Dot_Animation_Phase = 0;
|
||||
|
||||
if(_Code_Correct) {
|
||||
EEPROM_Trigger_Update();
|
||||
}
|
||||
|
||||
_EEPROM_Write_Status = EEPROM_STATUS_NONE;
|
||||
}
|
||||
|
||||
void Screen_Init(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration)
|
||||
{
|
||||
// _Screen_Last = Screen_Init; // I don't want that here...
|
||||
_Screen_Tick = Screen_Tick;
|
||||
_Screen_Click = Screen_Click;
|
||||
_Screen_Touch_Event = Screen_Touch_Event;
|
||||
_Screen_Action_CW = Screen_Action_CW;
|
||||
_Screen_Action_CCW = Screen_Action_CCW;
|
||||
_Screen_On_Objects_Focused = Screen_On_Object_Focused;
|
||||
_Screen_On_Objects_Defocused = Screen_On_Object_Defocused;
|
||||
_Screen_On_Object_Select = Screen_On_Object_Select;
|
||||
_Screen_On_Object_Deselect = Screen_On_Object_Deselect;
|
||||
|
||||
Display_Objects_Clear();
|
||||
Display_Screen_Transition_Start(direction_out, direction_in, type, frame_duration);
|
||||
|
||||
|
||||
//////////////////////////////
|
||||
// Add Display Objects here //
|
||||
//////////////////////////////
|
||||
_Text_Original_Color = DISPLAY_COLOR_LIGHTGREY;
|
||||
_Dot_Active_Original_Color = COLOR_DOT_ACTIVE;
|
||||
_Dot_Inactive_Original_Color = COLOR_DOT_INACTIVE;
|
||||
|
||||
Font_ID Font_Text = Display_Objects_Add_Font(_Font_DejaVu_Sans_Mono_Bold_15x26, 0);
|
||||
|
||||
if(_Code_Correct) {
|
||||
_Object_Text_Writing = Display_Objects_Add_Text(CENTER_BOTTOM, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, "Writing EEPROM", Font_Text, _Text_Original_Color, NO_STYLE, NO_ANIMATION);
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
_Object_Dots[i] = Display_Objects_Add_Circle_Frame(CENTER_MIDDLE, BOTH_IN_PERCENT, 50 + (i-1) * 6, 60, NOT_SELECTABLE, _Dot_Inactive_Original_Color, 4, 1, NO_STYLE, NO_ANIMATION);
|
||||
}
|
||||
|
||||
_Object_Image = Display_Objects_Add_Image(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, _Image_Check_Green_128x128, 0, NO_STYLE, NO_ANIMATION);
|
||||
Display_Objects_Update_Enabled(_Object_Image, false);
|
||||
}
|
||||
else {
|
||||
Display_Objects_Add_Text(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, "Code Incorrect", Font_Text, _Text_Original_Color, NO_STYLE, NO_ANIMATION);
|
||||
}
|
||||
|
||||
_Screen_Idle_Counter_Disable = true;
|
||||
|
||||
Display_Select_Object();
|
||||
}
|
||||
|
||||
void Screen_Tick(void)
|
||||
{
|
||||
if(_Code_Correct) {
|
||||
Update_Dot_Animation();
|
||||
}
|
||||
|
||||
if(_Counter == IMAGE_FADE_START_FRAME && _Code_Correct)
|
||||
{
|
||||
if(_EEPROM_Write_Status == EEPROM_STATUS_NONE) {
|
||||
_EEPROM_Write_Status = EEPROM_Get_Write_Status();
|
||||
}
|
||||
|
||||
Display_Objects_Update_Enabled(_Object_Text_Writing, false);
|
||||
for(int i = 0; i < 3; i++) {
|
||||
Display_Objects_Update_Enabled(_Object_Dots[i], false);
|
||||
}
|
||||
|
||||
if(_EEPROM_Write_Status == EEPROM_STATUS_WRITE_OK) {
|
||||
Display_Objects_Update_Enabled(_Object_Image, true);
|
||||
} else if(_EEPROM_Write_Status == EEPROM_STATUS_WRITE_FAILED) {
|
||||
Display_Objects_Update_Image(_Object_Image, _Image_Failed_Red_128x128);
|
||||
Display_Objects_Update_Enabled(_Object_Image, true);
|
||||
}
|
||||
|
||||
// Display_Objects_Update_Alpha(_Object_Image, 0);
|
||||
Display_Objects_Update_Scale(_Object_Image, 0);
|
||||
}
|
||||
|
||||
// Smooth text and dots fade-out (overlapping with image fade-in)
|
||||
if(_Counter >= TEXT_FADE_START_FRAME && _Counter < (TEXT_FADE_START_FRAME + TEXT_FADE_DURATION) && _Code_Correct)
|
||||
{
|
||||
float Fade_Progress = (float)(_Counter - TEXT_FADE_START_FRAME) / (float)TEXT_FADE_DURATION;
|
||||
|
||||
// Use Ease_Out_Cubic for smooth, natural fade (accelerates at start, decelerates at end)
|
||||
float Eased_Progress = Ease_Out_Cubic(Fade_Progress);
|
||||
|
||||
// Calculate inverse progress for fade-out (1.0 -> 0.0)
|
||||
float Fade_Out = 1.0f - Eased_Progress;
|
||||
|
||||
// Fade text to background color
|
||||
Display_Color Faded_Text = Display_Color_Interpolate_Float(_Text_Original_Color, DISPLAY_COLOR_BLACK, Eased_Progress);
|
||||
Display_Objects_Update_Color(_Object_Text_Writing, Faded_Text);
|
||||
|
||||
// Fade dots to background
|
||||
Display_Color Faded_Dot_Active = Display_Color_Interpolate_Float(_Dot_Active_Original_Color, DISPLAY_COLOR_BLACK, Eased_Progress);
|
||||
Display_Color Faded_Dot_Inactive = Display_Color_Interpolate_Float(_Dot_Inactive_Original_Color, DISPLAY_COLOR_BLACK, Eased_Progress);
|
||||
|
||||
// Apply faded colors while maintaining animation state
|
||||
int Active_Dot = _Dot_Animation_Phase / DOT_ANIMATION_SPEED;
|
||||
for(int i = 0; i < 3; i++) {
|
||||
Display_Color Dot_Color = (i == Active_Dot) ? Faded_Dot_Active : Faded_Dot_Inactive;
|
||||
Display_Objects_Update_Color(_Object_Dots[i], Dot_Color);
|
||||
}
|
||||
}
|
||||
|
||||
// Disable text and dots after fade-out completes
|
||||
if(_Counter == (TEXT_FADE_START_FRAME + TEXT_FADE_DURATION) && _Code_Correct)
|
||||
{
|
||||
Display_Objects_Update_Enabled(_Object_Text_Writing, false);
|
||||
for(int i = 0; i < 3; i++) {
|
||||
Display_Objects_Update_Enabled(_Object_Dots[i], false);
|
||||
}
|
||||
}
|
||||
|
||||
// Smooth image fade-in with extended duration and better easing
|
||||
if(_Counter >= IMAGE_FADE_START_FRAME && _Counter < (IMAGE_FADE_START_FRAME + IMAGE_FADE_DURATION) && _Code_Correct)
|
||||
{
|
||||
float Fade_Progress = (float)(_Counter - IMAGE_FADE_START_FRAME) / (float)IMAGE_FADE_DURATION;
|
||||
|
||||
// Use Ease_Out_Cubic for smooth, elegant appearance
|
||||
// This creates a fast start that gradually slows down - feels very natural
|
||||
float Eased_Progress = Ease_Out_Cubic(Fade_Progress);
|
||||
|
||||
// Convert to alpha value (0-255)
|
||||
uint8_t Alpha_Value = (uint8_t)(Eased_Progress * 255.0f);
|
||||
|
||||
Display_Objects_Update_Scale(_Object_Image, Eased_Progress);
|
||||
|
||||
// Apply alpha to the appropriate image
|
||||
// Display_Objects_Update_Alpha(_Object_Image, Alpha_Value);
|
||||
}
|
||||
|
||||
// Transition to next screen after animation completes
|
||||
if(_Counter >= ANIMATION_END_FRAME) {
|
||||
_Screen_Idle_Counter_Disable = false;
|
||||
Screen_Setup_Settings(TRANSITION_DOWN, TRANSITION_DOWN, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, 4);
|
||||
}
|
||||
|
||||
_Counter++;
|
||||
}
|
||||
|
||||
void Screen_Click(uint button_return_value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_Touch_Event(int16_t x, int16_t y)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_Action_CW(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_Action_CCW(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Focused(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Defocused(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Select(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Deselect(Object_ID object_id)
|
||||
{
|
||||
if(_Counter >= 120) {
|
||||
_Screen_Idle_Counter_Disable = false;
|
||||
Screen_Setup_Settings(TRANSITION_DOWN, TRANSITION_DOWN, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
Internal Functions
|
||||
*******************************************************************/
|
||||
void Update_Dot_Animation(void)
|
||||
{
|
||||
_Dot_Animation_Phase++;
|
||||
|
||||
if(_Dot_Animation_Phase >= (DOT_ANIMATION_SPEED * 3)) {
|
||||
_Dot_Animation_Phase = 0;
|
||||
}
|
||||
|
||||
// Determine which dot should be active
|
||||
int Active_Dot = _Dot_Animation_Phase / DOT_ANIMATION_SPEED;
|
||||
|
||||
// Update dot colors
|
||||
for(int i = 0; i < 3; i++) {
|
||||
Display_Color Dot_Color = (i == Active_Dot) ? _Dot_Active_Original_Color : _Dot_Inactive_Original_Color;
|
||||
Display_Objects_Update_Color(_Object_Dots[i], Dot_Color);
|
||||
}
|
||||
}
|
||||
@@ -10,27 +10,37 @@
|
||||
#include "../Screens.h"
|
||||
#include "../UI_Control.h"
|
||||
#include "../Command_Definition.h"
|
||||
#include "../Display_Default_Configurations.h"
|
||||
|
||||
#include "../Display.h"
|
||||
#include "../Display_Font.h"
|
||||
#include "../Display_Objects.h"
|
||||
#include "../Display_Default_Configurations.h"
|
||||
|
||||
#include "../INA260.h"
|
||||
#include "../EEPROM_M24C64.h"
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Defines
|
||||
#define GRAPH_DATA_WDITH 200
|
||||
#define COLOR_DARKGREEN DISPLAY_COLOR_FROM_RGB888(0, 100, 0)
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Variables
|
||||
extern const unsigned char _Font_DejaVu_Sans_Mono_6x12[];
|
||||
extern const unsigned char _Font_DejaVu_Sans_Mono_10x17[];
|
||||
extern const unsigned char _Font_DejaVu_Sans_Mono_Bold_7x15[];
|
||||
extern const unsigned char _Font_DejaVu_Sans_Mono_Bold_11x17[];
|
||||
|
||||
static Object_ID _Object_Value_BusVoltage;
|
||||
static Object_ID _Object_Value_Current;
|
||||
|
||||
static uint16_t _Data_BusVoltage[GRAPH_DATA_WDITH];
|
||||
static uint16_t _Data_BusVoltage_Threshold_Overvoltage[GRAPH_DATA_WDITH];
|
||||
static uint16_t _Data_BusVoltage_Threshold_Undervoltage[GRAPH_DATA_WDITH];
|
||||
static float _Current_BusVoltage_V;
|
||||
static uint16_t _Data_Current[GRAPH_DATA_WDITH];
|
||||
static uint16_t _Data_Threshold_Current[GRAPH_DATA_WDITH];
|
||||
static float _Actual_BusVoltage_V;
|
||||
static float _Actual_Current_A;
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
@@ -58,8 +68,8 @@ void Screen_Setup_Graph(Screen_Transition_Direction direction_out, Screen_Transi
|
||||
|
||||
for(int i=0;i<GRAPH_DATA_WDITH;i++) {
|
||||
_Data_BusVoltage[i] = 0;
|
||||
_Data_BusVoltage_Threshold_Overvoltage[i] = THRESHOLD_OVERVOLTAGE_mV;
|
||||
_Data_BusVoltage_Threshold_Undervoltage[i] = THRESHOLD_UNDERVOLTAGE_mV;
|
||||
_Data_Current[i] = 0;
|
||||
_Data_Threshold_Current[i] = _EEPROM_Content.Device_Configuration.Current_Threshold * 5; // 5x, due to 4x 1.25mA
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,23 +92,59 @@ void Screen_Init(Screen_Transition_Direction direction_out, Screen_Transition_Di
|
||||
//////////////////////////////
|
||||
// Add Display Objects here //
|
||||
//////////////////////////////
|
||||
char Current_Threshold[10];
|
||||
Display_Font_Set_Font(_Font_DejaVu_Sans_Mono_6x12);
|
||||
int16_t Font_6_1_Height = Display_Font_Get_Font_Height();
|
||||
|
||||
sprintf(Current_Threshold, "%.3fA", (float)(_EEPROM_Content.Device_Configuration.Current_Threshold * 5) / 1000.0f);
|
||||
int16_t Current_Threshold_Label_Y = DISPLAY_Y_CENTER + 100 - _EEPROM_Content.Device_Configuration.Current_Threshold * 5 / 25;
|
||||
|
||||
if((Current_Threshold_Label_Y <= (149 + Font_6_1_Height)) && (Current_Threshold_Label_Y >= 149)) {
|
||||
Current_Threshold_Label_Y += (Font_6_1_Height + 1);
|
||||
}
|
||||
else if((Current_Threshold_Label_Y <= 149) && (Current_Threshold_Label_Y >= 141)) {
|
||||
Current_Threshold_Label_Y = 141;
|
||||
}
|
||||
|
||||
|
||||
Font_ID Font_6_1 = Display_Objects_Add_Font(_Font_DejaVu_Sans_Mono_6x12, 1);
|
||||
Font_ID Font_10_1 = Display_Objects_Add_Font(_Font_DejaVu_Sans_Mono_10x17, 1);
|
||||
Font_ID Font_7_1_B = Display_Objects_Add_Font(_Font_DejaVu_Sans_Mono_Bold_7x15, 1);
|
||||
Font_ID Font_11_1_B = Display_Objects_Add_Font(_Font_DejaVu_Sans_Mono_Bold_11x17, 1);
|
||||
|
||||
Display_Objects_Add_Graph(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, false, _Data_BusVoltage, GRAPH_DATA_WDITH, 32000, 0, DISPLAY_COLOR_WHITE, 200, NO_STYLE, NO_ANIMATION);
|
||||
Display_Objects_Add_Graph(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, false, _Data_BusVoltage_Threshold_Overvoltage, GRAPH_DATA_WDITH, 32000, 0, DISPLAY_COLOR_RED, 200, NO_STYLE, NO_ANIMATION);
|
||||
Display_Objects_Add_Graph(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, false, _Data_BusVoltage_Threshold_Undervoltage, GRAPH_DATA_WDITH, 32000, 0, DISPLAY_COLOR_RED, 200, NO_STYLE, NO_ANIMATION);
|
||||
// Threshold Lines / Areas
|
||||
Display_Objects_Add_Rectangle_Frame(CENTER_TOP, X_IN_PERCENT_Y_IN_PIXEL, 50, 141, NOT_SELECTABLE, COLOR_DARKGREEN, GRAPH_DATA_WDITH+2, 8, 1, NO_STYLE, NO_ANIMATION);
|
||||
Display_Objects_Add_Graph(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, false, _Data_Threshold_Current, GRAPH_DATA_WDITH, 5000, 0, DISPLAY_COLOR_ORANGE, 200, NO_STYLE, NO_ANIMATION);
|
||||
|
||||
Display_Objects_Add_Float(CENTER_MIDDLE, X_IN_PERCENT_Y_IN_PIXEL, 50, 232, NOT_SELECTABLE, &_Current_BusVoltage_V, "%2.3fV", Font_10_1, DISPLAY_COLOR_LIGHTGREY, NO_STYLE, NO_ANIMATION);
|
||||
// Threshold Labels
|
||||
Display_Objects_Add_Text(LEFT_BOTTOM, BOTH_IN_PIXEL, 19, 140, NOT_SELECTABLE, "12.5V", Font_6_1, COLOR_DARKGREEN, NO_STYLE, NO_ANIMATION);
|
||||
Display_Objects_Add_Text(LEFT_TOP , BOTH_IN_PIXEL, 19, 149, NOT_SELECTABLE, "11.5V", Font_6_1, COLOR_DARKGREEN, NO_STYLE, NO_ANIMATION);
|
||||
Display_Objects_Add_Text(CENTER_BOTTOM, X_IN_PERCENT_Y_IN_PIXEL, 50, Current_Threshold_Label_Y, NOT_SELECTABLE, Current_Threshold, Font_6_1, DISPLAY_COLOR_ORANGE, NO_STYLE, NO_ANIMATION);
|
||||
|
||||
// Data Graphs (Voltage and Current)
|
||||
Display_Objects_Add_Graph(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, false, _Data_BusVoltage, GRAPH_DATA_WDITH, 32000, 0, DISPLAY_COLOR_RED, 200, NO_STYLE, NO_ANIMATION);
|
||||
Display_Objects_Add_Graph(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, false, _Data_Current, GRAPH_DATA_WDITH, 5000, 0, DISPLAY_COLOR_YELLOW, 200, NO_STYLE, NO_ANIMATION);
|
||||
|
||||
// Data Values (Voltage and Current)
|
||||
_Object_Value_BusVoltage = Display_Objects_Add_Float(RIGHT_MIDDLE, X_IN_PERCENT_Y_IN_PIXEL, 48, 50, NOT_SELECTABLE, &_Actual_BusVoltage_V, "%2.1fV", Font_11_1_B, DISPLAY_COLOR_WHITE, NO_STYLE, NO_ANIMATION);
|
||||
_Object_Value_Current = Display_Objects_Add_Float(LEFT_MIDDLE, X_IN_PERCENT_Y_IN_PIXEL, 52, 50, NOT_SELECTABLE, &_Actual_Current_A, "%1.3fA", Font_11_1_B, DISPLAY_COLOR_YELLOW, NO_STYLE, NO_ANIMATION);
|
||||
}
|
||||
|
||||
void Screen_Tick(void)
|
||||
{
|
||||
for(int i=0;i<GRAPH_DATA_WDITH-1;i++) {
|
||||
Display_Objects_Update_Coordinates(_Object_Value_BusVoltage, RIGHT_MIDDLE, X_IN_PERCENT_Y_IN_PIXEL, 48, 50);
|
||||
Display_Objects_Update_Coordinates(_Object_Value_Current, LEFT_MIDDLE, X_IN_PERCENT_Y_IN_PIXEL, 52, 50);
|
||||
|
||||
for(int i=0;i<GRAPH_DATA_WDITH-1;i++) {
|
||||
_Data_BusVoltage[i] = _Data_BusVoltage[i+1];
|
||||
_Data_Current[i] = _Data_Current[i+1];
|
||||
}
|
||||
|
||||
_Data_BusVoltage[GRAPH_DATA_WDITH-1] = INA260_Get_BusVoltage_mV();
|
||||
_Current_BusVoltage_V = ((float)_Data_BusVoltage[GRAPH_DATA_WDITH-1]) / 1000.0f;
|
||||
_Actual_BusVoltage_V = ((float)_Data_BusVoltage[GRAPH_DATA_WDITH-1]) / 1000.0f;
|
||||
|
||||
_Data_Current[GRAPH_DATA_WDITH-1] = INA260_Get_Current_mA();
|
||||
_Actual_Current_A = ((float)_Data_Current[GRAPH_DATA_WDITH-1]) / 1000.0f;
|
||||
}
|
||||
|
||||
void Screen_Click(uint button_return_value)
|
||||
|
||||
161
Firmware/Screens_Display/Screen_Idle.c
Normal file
161
Firmware/Screens_Display/Screen_Idle.c
Normal file
@@ -0,0 +1,161 @@
|
||||
/*
|
||||
* File: Screen_Idle.c
|
||||
*
|
||||
* Created: Created: Saturday October 2025 20:32:05
|
||||
* Author: Chris
|
||||
*/
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Includes
|
||||
#include "../Screens.h"
|
||||
#include "../UI_Control.h"
|
||||
#include "../Mode_Manager.h"
|
||||
#include "../EEPROM_M24C64.h"
|
||||
|
||||
#include "../Display.h"
|
||||
#include "../Display_Objects.h"
|
||||
#include "../Display_Default_Configurations.h"
|
||||
|
||||
#include "Common_Screen_Elements.h"
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Defines
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Variables
|
||||
extern const uint16_t _Image_Fad_Logo_Background_160x160[];
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Function Declarations
|
||||
void Screen_Setup_Idle(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration);
|
||||
|
||||
static void Screen_Init (Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration);
|
||||
static void Screen_Tick (void);
|
||||
static void Screen_Click (uint button_return_value);
|
||||
static void Screen_Touch_Event (int16_t x, int16_t y);
|
||||
static void Screen_Action_CW (Object_ID object_id);
|
||||
static void Screen_Action_CCW (Object_ID object_id);
|
||||
static void Screen_On_Object_Focused (Object_ID object_id);
|
||||
static void Screen_On_Object_Defocused (Object_ID object_id);
|
||||
static void Screen_On_Object_Select (Object_ID object_id);
|
||||
static void Screen_On_Object_Deselect (Object_ID object_id);
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
Functions
|
||||
*******************************************************************/
|
||||
void Screen_Setup_Idle(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration)
|
||||
{
|
||||
Screen_Init(direction_out, direction_in, type, frame_duration);
|
||||
}
|
||||
|
||||
void Screen_Init(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration)
|
||||
{
|
||||
// _Screen_Last = Screen_Init; // We don't want that here...
|
||||
_Screen_Tick = Screen_Tick;
|
||||
_Screen_Click = Screen_Click;
|
||||
_Screen_Touch_Event = Screen_Touch_Event;
|
||||
_Screen_Action_CW = Screen_Action_CW;
|
||||
_Screen_Action_CCW = Screen_Action_CCW;
|
||||
_Screen_On_Objects_Focused = Screen_On_Object_Focused;
|
||||
_Screen_On_Objects_Defocused = Screen_On_Object_Defocused;
|
||||
_Screen_On_Object_Select = Screen_On_Object_Select;
|
||||
_Screen_On_Object_Deselect = Screen_On_Object_Deselect;
|
||||
|
||||
Display_Objects_Clear();
|
||||
Display_Screen_Transition_Start(direction_out, direction_in, type, frame_duration);
|
||||
|
||||
|
||||
//////////////////////////////
|
||||
// Add Display Objects here //
|
||||
//////////////////////////////
|
||||
|
||||
switch(_EEPROM_Content.Device_Configuration.Idle_Screen)
|
||||
{
|
||||
case IDLE_SCREEN_LOGO:
|
||||
Display_Objects_Add_Image(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, _Image_Fad_Logo_Background_160x160, 0, NO_STYLE, NO_ANIMATION);
|
||||
break;
|
||||
|
||||
case IDLE_SCREEN_CURRENT_MODE:
|
||||
Common_Screen_Element_Init_Current_Mode(Mode_Manager_Get_Current_Mode());
|
||||
break;
|
||||
|
||||
case IDLE_SCREEN_MODE_ACTIVITY:
|
||||
Common_Screen_Element_Init_Mode_Activity(Mode_Manager_Get_Current_Mode());
|
||||
break;
|
||||
|
||||
case IDLE_SCREEN_BLACK:
|
||||
default: break;
|
||||
}
|
||||
|
||||
_Screen_Idle_Active = true;
|
||||
Display_Select_Object();
|
||||
}
|
||||
|
||||
void Screen_Tick(void)
|
||||
{
|
||||
switch(_EEPROM_Content.Device_Configuration.Idle_Screen)
|
||||
{
|
||||
case IDLE_SCREEN_MODE_ACTIVITY:
|
||||
Common_Screen_Element_Tick_Mode_Activity(Mode_Manager_Get_Current_Mode());
|
||||
break;
|
||||
|
||||
case IDLE_SCREEN_LOGO:
|
||||
case IDLE_SCREEN_CURRENT_MODE:
|
||||
case IDLE_SCREEN_BLACK:
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
void Screen_Click(uint button_return_value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_Touch_Event(int16_t x, int16_t y)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_Action_CW(Object_ID object_id)
|
||||
{
|
||||
_Screen_Idle_Active = false;
|
||||
_Screen_Last(TRANSITION_DOWN, TRANSITION_DOWN, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES);
|
||||
}
|
||||
|
||||
void Screen_Action_CCW(Object_ID object_id)
|
||||
{
|
||||
_Screen_Idle_Active = false;
|
||||
_Screen_Last(TRANSITION_DOWN, TRANSITION_DOWN, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES);
|
||||
}
|
||||
|
||||
void Screen_On_Object_Focused(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Defocused(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Select(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Deselect(Object_ID object_id)
|
||||
{
|
||||
_Screen_Idle_Active = false;
|
||||
_Screen_Last(TRANSITION_DOWN, TRANSITION_DOWN, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
Internal Functions
|
||||
*******************************************************************/
|
||||
|
||||
@@ -297,12 +297,12 @@ static void Update_Dot_Animation(void)
|
||||
}
|
||||
|
||||
// Determine which dot should be active
|
||||
int active_dot = _Dot_Animation_Phase / DOT_ANIMATION_SPEED;
|
||||
int Active_Dot = _Dot_Animation_Phase / DOT_ANIMATION_SPEED;
|
||||
|
||||
// Update dot colors
|
||||
for(int i = 0; i < 3; i++) {
|
||||
Display_Color dot_color = (i == active_dot) ? COLOR_DOT_ACTIVE : COLOR_DOT_INACTIVE;
|
||||
Display_Objects_Update_Color(_Object_Dots[i], dot_color);
|
||||
Display_Color Dot_Color = (i == Active_Dot) ? COLOR_DOT_ACTIVE : COLOR_DOT_INACTIVE;
|
||||
Display_Objects_Update_Color(_Object_Dots[i], Dot_Color);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,10 +10,14 @@
|
||||
// Includes
|
||||
#include "../Screens.h"
|
||||
#include "../UI_Control.h"
|
||||
#include "../Display_Default_Configurations.h"
|
||||
#include "../Mode_Manager.h"
|
||||
|
||||
#include "../Display.h"
|
||||
#include "../Display_Objects.h"
|
||||
#include "../Display_Default_Configurations.h"
|
||||
|
||||
#include "Common_Screen_Elements.h"
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Defines
|
||||
@@ -67,23 +71,15 @@ void Screen_Init(Screen_Transition_Direction direction_out, Screen_Transition_Di
|
||||
//////////////////////////////
|
||||
// Add Display Objects here //
|
||||
//////////////////////////////
|
||||
Display_Objects_Add_Rectangle_Frame(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, DISPLAY_COLOR_RED, 80, 80, 1, NO_STYLE, NO_ANIMATION);
|
||||
// Display_Objects_Add_Rounded_Rectangle_Frame(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, DISPLAY_COLOR_GREEN, 80, 80, 10, 4, NO_STYLE, NO_ANIMATION);
|
||||
// Display_Objects_Add_Rounded_Rectangle_Frame(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, DISPLAY_COLOR_GREEN, 100, 100, 15, 1, NO_STYLE, NO_ANIMATION);
|
||||
// Display_Objects_Add_Rounded_Rectangle_Frame(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, DISPLAY_COLOR_GREEN, 80, 80, 5, 1, NO_STYLE, NO_ANIMATION);
|
||||
// Display_Objects_Add_Rounded_Rectangle_Frame(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, DISPLAY_COLOR_GREEN , 80, 80, 10, 1, NO_STYLE, NO_ANIMATION);
|
||||
// Display_Objects_Add_Rounded_Rectangle_Frame(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, DISPLAY_COLOR_BLUE , 60, 60, 5, 1, NO_STYLE, NO_ANIMATION);
|
||||
|
||||
// Display_Objects_Add_Circle_Frame(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, DISPLAY_COLOR_BLUE, 40, 5, NO_STYLE, NO_ANIMATION);
|
||||
Display_Objects_Add_Circle_Filled(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, DISPLAY_COLOR_BLUE, 40, NO_STYLE, NO_ANIMATION);
|
||||
// Display_Objects_Add_Circle_Frame(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, DISPLAY_COLOR_ORANGE, 40, 1, NO_STYLE, NO_ANIMATION);
|
||||
Common_Screen_Element_Init_Mode_Activity(Mode_Manager_Get_Current_Mode());
|
||||
|
||||
Display_Select_Object();
|
||||
Display_Select_Object();
|
||||
}
|
||||
|
||||
void Screen_Tick(void)
|
||||
{
|
||||
|
||||
Common_Screen_Element_Tick_Mode_Activity(Mode_Manager_Get_Current_Mode());
|
||||
}
|
||||
|
||||
void Screen_Click(uint button_return_value)
|
||||
|
||||
147
Firmware/Screens_Display/Screen_Mode_Change.c
Normal file
147
Firmware/Screens_Display/Screen_Mode_Change.c
Normal file
@@ -0,0 +1,147 @@
|
||||
/*
|
||||
* File: Screen_Mode_Change.c
|
||||
*
|
||||
* Created: Created: Saturday October 2025 21:07:48
|
||||
* Author: Chris
|
||||
*/
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Includes
|
||||
#include "../Screens.h"
|
||||
#include "../UI_Control.h"
|
||||
#include "../Mode_Manager.h"
|
||||
|
||||
#include "../Display.h"
|
||||
#include "../Display_Objects.h"
|
||||
#include "../Display_Default_Configurations.h"
|
||||
|
||||
#include "Common_Screen_Elements.h"
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Defines
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Variables
|
||||
extern const uint16_t _Image_Forest_Pine_Midi_64x64[];
|
||||
extern const uint16_t _Image_Steel_Blue_Jam_Happy_64x64[];
|
||||
extern const uint16_t _Image_Stone_Blue_Light_On_64x64[];
|
||||
|
||||
static Mode _Mode;
|
||||
static uint32_t _Counter;
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Function Declarations
|
||||
void Screen_Setup_Mode_Change(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration, Mode mode);
|
||||
|
||||
static void Screen_Init (Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration);
|
||||
static void Screen_Tick (void);
|
||||
static void Screen_Click (uint button_return_value);
|
||||
static void Screen_Touch_Event (int16_t x, int16_t y);
|
||||
static void Screen_Action_CW (Object_ID object_id);
|
||||
static void Screen_Action_CCW (Object_ID object_id);
|
||||
static void Screen_On_Object_Focused (Object_ID object_id);
|
||||
static void Screen_On_Object_Defocused (Object_ID object_id);
|
||||
static void Screen_On_Object_Select (Object_ID object_id);
|
||||
static void Screen_On_Object_Deselect (Object_ID object_id);
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
Functions
|
||||
*******************************************************************/
|
||||
void Screen_Setup_Mode_Change(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration, Mode mode)
|
||||
{
|
||||
_Mode = mode;
|
||||
_Counter = 0;
|
||||
|
||||
Screen_Init(direction_out, direction_in, type, frame_duration);
|
||||
}
|
||||
|
||||
void Screen_Init(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration)
|
||||
{
|
||||
// _Screen_Last = Screen_Init; // We don't want that here...
|
||||
_Screen_Tick = Screen_Tick;
|
||||
_Screen_Click = Screen_Click;
|
||||
_Screen_Touch_Event = Screen_Touch_Event;
|
||||
_Screen_Action_CW = Screen_Action_CW;
|
||||
_Screen_Action_CCW = Screen_Action_CCW;
|
||||
_Screen_On_Objects_Focused = Screen_On_Object_Focused;
|
||||
_Screen_On_Objects_Defocused = Screen_On_Object_Defocused;
|
||||
_Screen_On_Object_Select = Screen_On_Object_Select;
|
||||
_Screen_On_Object_Deselect = Screen_On_Object_Deselect;
|
||||
|
||||
Display_Objects_Clear();
|
||||
Display_Screen_Transition_Start(direction_out, direction_in, type, frame_duration);
|
||||
|
||||
|
||||
//////////////////////////////
|
||||
// Add Display Objects here //
|
||||
//////////////////////////////
|
||||
|
||||
Common_Screen_Element_Init_Current_Mode(_Mode);
|
||||
}
|
||||
|
||||
void Screen_Tick(void)
|
||||
{
|
||||
const uint32_t Counter_Max = 50;
|
||||
|
||||
if(_Counter == Counter_Max)
|
||||
{
|
||||
if(_Screen_Idle_Active == true) {
|
||||
Screen_Setup_Idle(TRANSITION_NONE, TRANSITION_NONE, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES);
|
||||
} else {
|
||||
_Screen_Last(TRANSITION_NONE, TRANSITION_NONE, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES);
|
||||
}
|
||||
}
|
||||
|
||||
_Counter++;
|
||||
}
|
||||
|
||||
void Screen_Click(uint button_return_value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_Touch_Event(int16_t x, int16_t y)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_Action_CW(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_Action_CCW(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Focused(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Defocused(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Select(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Deselect(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
Internal Functions
|
||||
*******************************************************************/
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "../Display.h"
|
||||
#include "../Display_Objects.h"
|
||||
#include "../Display_Render_Complex.h"
|
||||
#include "../Display_Default_Configurations.h"
|
||||
|
||||
|
||||
@@ -91,6 +92,7 @@ void Screen_Init(Screen_Transition_Direction direction_out, Screen_Transition_Di
|
||||
//////////////////////////////
|
||||
// Add Display Objects here //
|
||||
//////////////////////////////
|
||||
Display_Render_Complex_Select_YesNo_Set(_Bool_Value, &_Configuration_Default_Select_YesNo);
|
||||
Display_Objects_Add_Select_YesNo(_Title, _Title_Length, &_Bool_Value, &_Configuration_Default_Select_YesNo);
|
||||
_Object_Message_Box = Display_Objects_Add_Message_Box(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, "Saved", MESSAGE_BOX_ICON_CIRCLE_CHECKMARK, &_Message_Box_Style_Regular);
|
||||
|
||||
|
||||
204
Firmware/Screens_Display/Screen_Select_Hue.c
Normal file
204
Firmware/Screens_Display/Screen_Select_Hue.c
Normal file
@@ -0,0 +1,204 @@
|
||||
/*
|
||||
* File: Screen_Select_Hue.c
|
||||
*
|
||||
* Created: Created: Friday October 2025 16:12:34
|
||||
* Author: Chris
|
||||
*/
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Includes
|
||||
#include "../Screens.h"
|
||||
#include "../Hue.h"
|
||||
#include "../Command.h"
|
||||
#include "../UI_Control.h"
|
||||
#include "../Mode_Manager.h"
|
||||
|
||||
#include "../Display.h"
|
||||
#include "../Display_Objects.h"
|
||||
#include "../Display_Default_Configurations.h"
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Defines
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Variables
|
||||
static Object_ID _Object_Message_Box;
|
||||
static Object_ID _Object_Value_Bar;
|
||||
|
||||
static const Hierarchical_Menu* _Return_Menu = NULL;
|
||||
static const Menu_List* _Return_List = NULL;
|
||||
static int32_t _Return_Selected_Item;
|
||||
|
||||
static char* _Title;
|
||||
static uint32_t _Title_Length;
|
||||
static int32_t* _Value;
|
||||
static int32_t _Display_Value;
|
||||
static const Menu_Configuration_Select_Value* _Config;
|
||||
|
||||
static bool _Decision_Made;
|
||||
static uint32_t _Counter;
|
||||
static Mode _Current_Mode;
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Function Declarations
|
||||
void Screen_Setup_Select_Hue(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration, char* title, uint32_t title_length, int32_t* hue_value, const Menu_Configuration_Select_Value* config, const Hierarchical_Menu* return_menu, const Menu_List* return_list, int32_t return_selected_item);
|
||||
|
||||
static void Screen_Init (Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration);
|
||||
static void Screen_Tick (void);
|
||||
static void Screen_Click (uint button_return_value);
|
||||
static void Screen_Touch_Event (int16_t x, int16_t y);
|
||||
static void Screen_Action_CW (Object_ID object_id);
|
||||
static void Screen_Action_CCW (Object_ID object_id);
|
||||
static void Screen_On_Object_Focused (Object_ID object_id);
|
||||
static void Screen_On_Object_Defocused (Object_ID object_id);
|
||||
static void Screen_On_Object_Select (Object_ID object_id);
|
||||
static void Screen_On_Object_Deselect (Object_ID object_id);
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
Functions
|
||||
*******************************************************************/
|
||||
void Screen_Setup_Select_Hue(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration, char* title, uint32_t title_length, int32_t* hue_value, const Menu_Configuration_Select_Value* config, const Hierarchical_Menu* return_menu, const Menu_List* return_list, int32_t return_selected_item)
|
||||
{
|
||||
_Title = title;
|
||||
_Title_Length = title_length;
|
||||
_Value = hue_value;
|
||||
_Display_Value = *hue_value * config->Value_Display_Ratio;
|
||||
_Config = config;
|
||||
|
||||
Screen_Init(direction_out, direction_in, type, frame_duration);
|
||||
|
||||
_Return_Menu = return_menu;
|
||||
_Return_List = return_list;
|
||||
_Return_Selected_Item = return_selected_item;
|
||||
|
||||
_Decision_Made = false;
|
||||
_Counter = 0;
|
||||
|
||||
_Current_Mode = Mode_Manager_Get_Current_Mode();
|
||||
|
||||
Mode_Manager_Set_Mode(PREVIEW);
|
||||
}
|
||||
|
||||
void Screen_Init(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration)
|
||||
{
|
||||
_Screen_Last = Screen_Init;
|
||||
_Screen_Tick = Screen_Tick;
|
||||
_Screen_Click = Screen_Click;
|
||||
_Screen_Touch_Event = Screen_Touch_Event;
|
||||
_Screen_Action_CW = Screen_Action_CW;
|
||||
_Screen_Action_CCW = Screen_Action_CCW;
|
||||
_Screen_On_Objects_Focused = Screen_On_Object_Focused;
|
||||
_Screen_On_Objects_Defocused = Screen_On_Object_Defocused;
|
||||
_Screen_On_Object_Select = Screen_On_Object_Select;
|
||||
_Screen_On_Object_Deselect = Screen_On_Object_Deselect;
|
||||
|
||||
Display_Objects_Clear();
|
||||
Display_Screen_Transition_Start(direction_out, direction_in, type, frame_duration);
|
||||
|
||||
|
||||
//////////////////////////////
|
||||
// Add Display Objects here //
|
||||
//////////////////////////////
|
||||
Style_ID Style_Value_Var = Display_Objects_Add_Style(DISPLAY_COLOR_BLACK, DISPLAY_COLOR_LIGHTGREY, 1, 0, PADDING_1(3), STYLE_WIDTH_HEIGHT_RATIO_AUTO);
|
||||
|
||||
Display_Objects_Add_Select_Value(_Title, _Title_Length, &_Display_Value, _Config->Max, _Config->Min, (char*)_Config->Format, &_Configuration_Default_Select_Value);
|
||||
_Object_Value_Bar = Display_Objects_Add_Value_Bar_Rect(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 63, NOT_SELECTABLE, _Value, 359, 0, LEFT_TO_RIGHT, DISPLAY_COLOR_BLACK, 200, 10, Style_Value_Var, NO_ANIMATION);
|
||||
_Object_Message_Box = Display_Objects_Add_Message_Box(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, "Saved", MESSAGE_BOX_ICON_CIRCLE_CHECKMARK, &_Message_Box_Style_Regular);
|
||||
|
||||
Display_Select_Object();
|
||||
|
||||
UI_Control_Acceleration_Reset();
|
||||
UI_Control_Acceleration_Set_Enabled(_Config->Use_Acceleration);
|
||||
}
|
||||
|
||||
void Screen_Tick(void)
|
||||
{
|
||||
LED_Data_t RGB_Value;
|
||||
RGB_Value.Pixel = Hue_Get_Color_From_Angle(*_Value);
|
||||
|
||||
Command_Issue_Set_Request(MULTICORE_COMMAND_SET_DIRECT_RED , MULTICORE_NO_PARAMETER, RGB_Value.R);
|
||||
Command_Issue_Set_Request(MULTICORE_COMMAND_SET_DIRECT_GREEN, MULTICORE_NO_PARAMETER, RGB_Value.G);
|
||||
Command_Issue_Set_Request(MULTICORE_COMMAND_SET_DIRECT_BLUE , MULTICORE_NO_PARAMETER, RGB_Value.B);
|
||||
|
||||
Display_Objects_Update_Color(_Object_Value_Bar, DISPLAY_COLOR_FROM_RGB888(RGB_Value.R, RGB_Value.G, RGB_Value.B));
|
||||
|
||||
if(_Decision_Made) {
|
||||
_Counter++;
|
||||
}
|
||||
|
||||
if(_Counter == MESSAGE_BOX_DEFAULT_TICKS) {
|
||||
Screen_Setup_Settings_Hierarchical_Menu(TRANSITION_DOWN, TRANSITION_RIGHT, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, _Return_Menu, _Return_List, _Return_Selected_Item);
|
||||
}
|
||||
}
|
||||
|
||||
void Screen_Click(uint button_return_value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_Touch_Event(int16_t x, int16_t y)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_Action_CW(Object_ID object_id)
|
||||
{
|
||||
if(_Decision_Made) {
|
||||
return;
|
||||
}
|
||||
|
||||
UI_Control_Selector_Inc(_Value, _Config->Min, _Config->Max, _Config->Cycle_Selector);
|
||||
|
||||
_Display_Value = *_Value * _Config->Value_Display_Ratio;
|
||||
}
|
||||
|
||||
void Screen_Action_CCW(Object_ID object_id)
|
||||
{
|
||||
if(_Decision_Made) {
|
||||
return;
|
||||
}
|
||||
|
||||
UI_Control_Selector_Dec(_Value, _Config->Min, _Config->Max, _Config->Cycle_Selector);
|
||||
|
||||
_Display_Value = *_Value * _Config->Value_Display_Ratio;
|
||||
}
|
||||
|
||||
void Screen_On_Object_Focused(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Defocused(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Select(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Deselect(Object_ID object_id)
|
||||
{
|
||||
if(!_Decision_Made) {
|
||||
Display_Objects_Show_Message_Box(_Object_Message_Box, MESSAGE_BOX_DEFAULT_TICKS);
|
||||
_Decision_Made = true;
|
||||
|
||||
Command_Issue_Set_Request(MULTICORE_COMMAND_SET_DIRECT_RED , MULTICORE_NO_PARAMETER, 0);
|
||||
Command_Issue_Set_Request(MULTICORE_COMMAND_SET_DIRECT_GREEN, MULTICORE_NO_PARAMETER, 0);
|
||||
Command_Issue_Set_Request(MULTICORE_COMMAND_SET_DIRECT_BLUE , MULTICORE_NO_PARAMETER, 0);
|
||||
|
||||
Mode_Manager_Set_Mode(_Current_Mode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
Internal Functions
|
||||
*******************************************************************/
|
||||
|
||||
175
Firmware/Screens_Display/Screen_Select_List.c
Normal file
175
Firmware/Screens_Display/Screen_Select_List.c
Normal file
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
* File: Screen_Select_List.c
|
||||
*
|
||||
* Created: Created: Friday September 2025 20:06:47
|
||||
* Author: Chris
|
||||
*/
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Includes
|
||||
#include "../Screens.h"
|
||||
#include "../UI_Control.h"
|
||||
|
||||
#include "../Display.h"
|
||||
#include "../Display_Objects.h"
|
||||
#include "../Display_Default_Configurations.h"
|
||||
|
||||
// ============================================================================================
|
||||
// Defines
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Variables
|
||||
extern const uint8_t _Font_DejaVu_Sans_Mono_Bold_11x17[];
|
||||
|
||||
static Object_ID _Object_Message_Box;
|
||||
|
||||
static const Hierarchical_Menu* _Return_Menu = NULL;
|
||||
static const Menu_List* _Return_List = NULL;
|
||||
static int32_t _Return_Selected_Item;
|
||||
|
||||
static char* _Title;
|
||||
static uint32_t _Title_Length;
|
||||
static int32_t* _Value;
|
||||
static const Menu_Configuration_Select_List* _Config;
|
||||
|
||||
static bool _Decision_Made;
|
||||
static uint32_t _Counter;
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Function Declarations
|
||||
void Screen_Setup_Select_List(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration, char* title, uint32_t title_length, int32_t* value, const Menu_Configuration_Select_List* config, const Hierarchical_Menu* return_menu, const Menu_List* return_list, int32_t return_selected_item);
|
||||
|
||||
static void Screen_Init (Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration);
|
||||
static void Screen_Tick (void);
|
||||
static void Screen_Click (uint button_return_value);
|
||||
static void Screen_Touch_Event (int16_t x, int16_t y);
|
||||
static void Screen_Action_CW (Object_ID object_id);
|
||||
static void Screen_Action_CCW (Object_ID object_id);
|
||||
static void Screen_On_Object_Focused (Object_ID object_id);
|
||||
static void Screen_On_Object_Defocused (Object_ID object_id);
|
||||
static void Screen_On_Object_Select (Object_ID object_id);
|
||||
static void Screen_On_Object_Deselect (Object_ID object_id);
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
Functions
|
||||
*******************************************************************/
|
||||
void Screen_Setup_Select_List(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration, char* title, uint32_t title_length, int32_t* value, const Menu_Configuration_Select_List* config, const Hierarchical_Menu* return_menu, const Menu_List* return_list, int32_t return_selected_item)
|
||||
{
|
||||
_Title = title;
|
||||
_Title_Length = title_length;
|
||||
_Value = value;
|
||||
_Config = config;
|
||||
|
||||
Screen_Init(direction_out, direction_in, type, frame_duration);
|
||||
|
||||
_Return_Menu = return_menu;
|
||||
_Return_List = return_list;
|
||||
_Return_Selected_Item = return_selected_item;
|
||||
|
||||
_Decision_Made = false;
|
||||
_Counter = 0;
|
||||
}
|
||||
|
||||
void Screen_Init(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration)
|
||||
{
|
||||
_Screen_Last = Screen_Init;
|
||||
_Screen_Tick = Screen_Tick;
|
||||
_Screen_Click = Screen_Click;
|
||||
_Screen_Touch_Event = Screen_Touch_Event;
|
||||
_Screen_Action_CW = Screen_Action_CW;
|
||||
_Screen_Action_CCW = Screen_Action_CCW;
|
||||
_Screen_On_Objects_Focused = Screen_On_Object_Focused;
|
||||
_Screen_On_Objects_Defocused = Screen_On_Object_Defocused;
|
||||
_Screen_On_Object_Select = Screen_On_Object_Select;
|
||||
_Screen_On_Object_Deselect = Screen_On_Object_Deselect;
|
||||
|
||||
Display_Objects_Clear();
|
||||
Display_Screen_Transition_Start(direction_out, direction_in, type, frame_duration);
|
||||
|
||||
|
||||
//////////////////////////////
|
||||
// Add Display Objects here //
|
||||
//////////////////////////////
|
||||
Font_ID Font_Title = Display_Objects_Add_Font(_Font_DejaVu_Sans_Mono_Bold_11x17, 0);
|
||||
|
||||
Display_Objects_Add_Select_List((char*)_Config->Item_Names, _Config->Item_Count, _Config->Name_Length, _Value, &_Configuration_Default_Select_List);
|
||||
Display_Objects_Add_Text(CENTER_MIDDLE, X_IN_PERCENT_Y_IN_PIXEL, 50, 60, NOT_SELECTABLE, _Title, Font_Title, DISPLAY_COLOR_LIGHTGREY, NO_STYLE, NO_ANIMATION);
|
||||
_Object_Message_Box = Display_Objects_Add_Message_Box(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, "Saved", MESSAGE_BOX_ICON_CIRCLE_CHECKMARK, &_Message_Box_Style_Regular);
|
||||
|
||||
Display_Select_Object();
|
||||
|
||||
UI_Control_Acceleration_Reset();
|
||||
UI_Control_Acceleration_Set_Enabled(_Config->Use_Acceleration);
|
||||
}
|
||||
|
||||
void Screen_Tick(void)
|
||||
{
|
||||
if(_Decision_Made) {
|
||||
_Counter++;
|
||||
}
|
||||
|
||||
if(_Counter == MESSAGE_BOX_DEFAULT_TICKS) {
|
||||
Screen_Setup_Settings_Hierarchical_Menu(TRANSITION_DOWN, TRANSITION_RIGHT, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, _Return_Menu, _Return_List, _Return_Selected_Item);
|
||||
}
|
||||
}
|
||||
|
||||
void Screen_Click(uint button_return_value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_Touch_Event(int16_t x, int16_t y)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_Action_CW(Object_ID object_id)
|
||||
{
|
||||
if(_Decision_Made) {
|
||||
return;
|
||||
}
|
||||
|
||||
UI_Control_Selector_Inc(_Value, 0, _Config->Item_Count-1, _Config->Cycle_Selector);
|
||||
}
|
||||
|
||||
void Screen_Action_CCW(Object_ID object_id)
|
||||
{
|
||||
if(_Decision_Made) {
|
||||
return;
|
||||
}
|
||||
|
||||
UI_Control_Selector_Dec(_Value, 0, _Config->Item_Count-1, _Config->Cycle_Selector);
|
||||
}
|
||||
|
||||
void Screen_On_Object_Focused(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Defocused(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Select(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Deselect(Object_ID object_id)
|
||||
{
|
||||
if(!_Decision_Made) {
|
||||
Display_Objects_Show_Message_Box(_Object_Message_Box, MESSAGE_BOX_DEFAULT_TICKS);
|
||||
_Decision_Made = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
Internal Functions
|
||||
*******************************************************************/
|
||||
|
||||
267
Firmware/Screens_Display/Screen_Select_MinMax.c
Normal file
267
Firmware/Screens_Display/Screen_Select_MinMax.c
Normal file
@@ -0,0 +1,267 @@
|
||||
/*
|
||||
* File: Screen_Select_MinMax.c
|
||||
*
|
||||
* Created: Created: Friday October 2025 16:50:54
|
||||
* Author: Chris
|
||||
*/
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Includes
|
||||
#include "../Screens.h"
|
||||
#include "../UI_Control.h"
|
||||
|
||||
#include "../Display.h"
|
||||
#include "../Display_Color.h"
|
||||
#include "../Display_Objects.h"
|
||||
#include "../Display_Default_Configurations.h"
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Defines
|
||||
#define DISPLAY_COLOR_VERYDARKGREY DISPLAY_COLOR_FROM_RGB888(64, 64, 64)
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Variables
|
||||
extern const uint8_t _Font_DejaVu_Sans_Mono_Bold_7x15[];
|
||||
extern const uint8_t _Font_DejaVu_Sans_Mono_10x17[];
|
||||
|
||||
static Object_ID _Object_Text_Min, _Object_Text_Max;
|
||||
static Object_ID _Object_Box;
|
||||
static Object_ID _Object_Message_Box;
|
||||
static Object_ID _Object_Value_Bar;
|
||||
|
||||
static const Hierarchical_Menu* _Return_Menu = NULL;
|
||||
static const Menu_List* _Return_List = NULL;
|
||||
static int32_t _Return_Selected_Item;
|
||||
|
||||
static char* _Title;
|
||||
static uint32_t _Title_Length;
|
||||
|
||||
static MinMax_t* _Value;
|
||||
static int32_t _Value_Min;
|
||||
static int32_t _Value_Max;
|
||||
static int32_t* _Current_Value;
|
||||
static int32_t _Limit_Min;
|
||||
static int32_t _Limit_Max;
|
||||
|
||||
static int16_t _Box_Y_Current;
|
||||
static int16_t _Box_Y_Target;
|
||||
|
||||
static const Menu_Configuration_Select_MinMax* _Config;
|
||||
static const int16_t _Y_Center_Min = DISPLAY_Y_CENTER;
|
||||
static const int16_t _Y_Center_Max = DISPLAY_Y_CENTER + 40;
|
||||
|
||||
|
||||
static bool _Decision_Made;
|
||||
static uint32_t _Counter;
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Function Declarations
|
||||
void Screen_Setup_Select_MinMax(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration, char* title, uint32_t title_length, MinMax_t* value, const Menu_Configuration_Select_MinMax* config, const Hierarchical_Menu* return_menu, const Menu_List* return_list, int32_t return_selected_item);
|
||||
|
||||
static void Screen_Init (Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration);
|
||||
static void Screen_Tick (void);
|
||||
static void Screen_Click (uint button_return_value);
|
||||
static void Screen_Touch_Event (int16_t x, int16_t y);
|
||||
static void Screen_Action_CW (Object_ID object_id);
|
||||
static void Screen_Action_CCW (Object_ID object_id);
|
||||
static void Screen_On_Object_Focused (Object_ID object_id);
|
||||
static void Screen_On_Object_Defocused (Object_ID object_id);
|
||||
static void Screen_On_Object_Select (Object_ID object_id);
|
||||
static void Screen_On_Object_Deselect (Object_ID object_id);
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
Functions
|
||||
*******************************************************************/
|
||||
void Screen_Setup_Select_MinMax(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration, char* title, uint32_t title_length, MinMax_t* value, const Menu_Configuration_Select_MinMax* config, const Hierarchical_Menu* return_menu, const Menu_List* return_list, int32_t return_selected_item)
|
||||
{
|
||||
_Title = title;
|
||||
_Title_Length = title_length;
|
||||
|
||||
_Value = value;
|
||||
_Value_Min = _Value->Min;
|
||||
_Value_Max = _Value->Max;
|
||||
|
||||
_Current_Value = &_Value_Min;
|
||||
_Limit_Min = config->Min;
|
||||
_Limit_Max = config->Max - 1;
|
||||
|
||||
_Box_Y_Target = _Y_Center_Min;
|
||||
_Box_Y_Current = _Box_Y_Target;
|
||||
|
||||
_Config = config;
|
||||
|
||||
Screen_Init(direction_out, direction_in, type, frame_duration);
|
||||
|
||||
_Return_Menu = return_menu;
|
||||
_Return_List = return_list;
|
||||
_Return_Selected_Item = return_selected_item;
|
||||
|
||||
_Decision_Made = false;
|
||||
_Counter = 0;
|
||||
}
|
||||
|
||||
void Screen_Init(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration)
|
||||
{
|
||||
_Screen_Last = Screen_Init;
|
||||
_Screen_Tick = Screen_Tick;
|
||||
_Screen_Click = Screen_Click;
|
||||
_Screen_Touch_Event = Screen_Touch_Event;
|
||||
_Screen_Action_CW = Screen_Action_CW;
|
||||
_Screen_Action_CCW = Screen_Action_CCW;
|
||||
_Screen_On_Objects_Focused = Screen_On_Object_Focused;
|
||||
_Screen_On_Objects_Defocused = Screen_On_Object_Defocused;
|
||||
_Screen_On_Object_Select = Screen_On_Object_Select;
|
||||
_Screen_On_Object_Deselect = Screen_On_Object_Deselect;
|
||||
|
||||
Display_Objects_Clear();
|
||||
Display_Screen_Transition_Start(direction_out, direction_in, type, frame_duration);
|
||||
|
||||
|
||||
//////////////////////////////
|
||||
// Add Display Objects here //
|
||||
//////////////////////////////
|
||||
Font_ID Font_Title = Display_Objects_Add_Font(_Font_DejaVu_Sans_Mono_Bold_7x15, DISPLAY_DEFAULT_CHAR_SPACING);
|
||||
Font_ID Font_Value = Display_Objects_Add_Font(_Font_DejaVu_Sans_Mono_10x17, 0);
|
||||
Display_Objects_Add_Text(CENTER_MIDDLE, X_IN_PERCENT_Y_IN_PIXEL, 50, DISPLAY_Y_CENTER - 50, NOT_SELECTABLE, _Title, Font_Title, DISPLAY_COLOR_WHITE, NO_STYLE, NO_ANIMATION);
|
||||
|
||||
_Object_Text_Min = Display_Objects_Add_Integer(CENTER_MIDDLE, X_IN_PERCENT_Y_IN_PIXEL, 50, _Y_Center_Min, NOT_SELECTABLE, (int*)(&_Value_Min), (char*)_Config->Format_Min, Font_Value, DISPLAY_COLOR_LIGHTGREY, NO_STYLE, NO_ANIMATION);
|
||||
_Object_Text_Max = Display_Objects_Add_Integer(CENTER_MIDDLE, X_IN_PERCENT_Y_IN_PIXEL, 50, _Y_Center_Max, NOT_SELECTABLE, (int*)(&_Value_Max), (char*)_Config->Format_Max, Font_Value, DISPLAY_COLOR_DARKGREY, NO_STYLE, NO_ANIMATION);
|
||||
|
||||
_Object_Box = Display_Objects_Add_Rounded_Rectangle_Frame(CENTER_MIDDLE, X_IN_PERCENT_Y_IN_PIXEL, 50, _Box_Y_Current, NOT_SELECTABLE, DISPLAY_COLOR_LIGHTGREY, 140, 30, 3, 1, NO_STYLE, NO_ANIMATION);
|
||||
|
||||
_Object_Message_Box = Display_Objects_Add_Message_Box(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, "Saved", MESSAGE_BOX_ICON_CIRCLE_CHECKMARK, &_Message_Box_Style_Regular);
|
||||
|
||||
Display_Select_Object();
|
||||
|
||||
UI_Control_Acceleration_Reset();
|
||||
UI_Control_Acceleration_Set_Enabled(_Config->Use_Acceleration);
|
||||
}
|
||||
|
||||
void Screen_Tick(void)
|
||||
{
|
||||
// Update Values in actual datasctructure passed via pointer
|
||||
_Value->Min = _Value_Min;
|
||||
_Value->Max = _Value_Max;
|
||||
|
||||
// Animate the slection box to see which values in currently being edited
|
||||
if(_Box_Y_Target > _Box_Y_Current) {
|
||||
int16_t Distance = abs(_Box_Y_Current - _Box_Y_Target);
|
||||
_Box_Y_Current += ((Distance >> 1) + 1);
|
||||
}
|
||||
Display_Objects_Update_Coordinates(_Object_Box, CENTER_MIDDLE, X_IN_PERCENT_Y_IN_PIXEL, 50, _Box_Y_Current);
|
||||
|
||||
// Adjust the colors of the text depending if the text is currently edited or not
|
||||
int16_t Max_Distance = abs(_Y_Center_Max - _Y_Center_Min);
|
||||
float Ratio = ((float)(_Box_Y_Current - _Y_Center_Min)) / (float)Max_Distance;
|
||||
Display_Color Color_Min = Display_Color_Interpolate_Float(DISPLAY_COLOR_LIGHTGREY, DISPLAY_COLOR_VERYDARKGREY, Ratio);
|
||||
Display_Color Color_Max = Display_Color_Interpolate_Float(DISPLAY_COLOR_VERYDARKGREY, DISPLAY_COLOR_LIGHTGREY, Ratio);
|
||||
|
||||
Display_Objects_Update_Color(_Object_Text_Min, Color_Min);
|
||||
Display_Objects_Update_Color(_Object_Text_Max, Color_Max);
|
||||
|
||||
// Increment tick counter for message box if all values have been selected
|
||||
if(_Decision_Made) {
|
||||
_Counter++;
|
||||
}
|
||||
|
||||
// Change back to the former screen (Hierarchical Menu), when the ticks are up
|
||||
if(_Counter == MESSAGE_BOX_DEFAULT_TICKS) {
|
||||
Screen_Setup_Settings_Hierarchical_Menu(TRANSITION_DOWN, TRANSITION_RIGHT, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, _Return_Menu, _Return_List, _Return_Selected_Item);
|
||||
}
|
||||
}
|
||||
|
||||
void Screen_Click(uint button_return_value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_Touch_Event(int16_t x, int16_t y)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_Action_CW(Object_ID object_id)
|
||||
{
|
||||
if(_Decision_Made) {
|
||||
return;
|
||||
}
|
||||
|
||||
UI_Control_Selector_Inc(_Current_Value, _Limit_Min, _Limit_Max, _Config->Cycle_Selector);
|
||||
|
||||
if(_Current_Value == &_Value_Min) {
|
||||
if(_Value_Min >= _Value_Max) {
|
||||
_Value_Max = _Value_Min + 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(_Value_Max <= _Value_Min) {
|
||||
_Value_Min = _Value_Max - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Screen_Action_CCW(Object_ID object_id)
|
||||
{
|
||||
if(_Decision_Made) {
|
||||
return;
|
||||
}
|
||||
|
||||
UI_Control_Selector_Dec(_Current_Value, _Limit_Min, _Limit_Max, _Config->Cycle_Selector);
|
||||
|
||||
if(_Current_Value == &_Value_Min) {
|
||||
if(_Value_Min >= _Value_Max) {
|
||||
_Value_Max = _Value_Min + 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(_Value_Max <= _Value_Min) {
|
||||
_Value_Min = _Value_Max - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Screen_On_Object_Focused(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Defocused(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Select(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Deselect(Object_ID object_id)
|
||||
{
|
||||
if(_Current_Value == &_Value_Min) {
|
||||
_Current_Value = &_Value_Max;
|
||||
|
||||
_Limit_Min++;
|
||||
_Limit_Max++;
|
||||
|
||||
_Box_Y_Target = _Y_Center_Max;
|
||||
|
||||
Display_Select_Object();
|
||||
return;
|
||||
}
|
||||
|
||||
if(!_Decision_Made) {
|
||||
Display_Objects_Show_Message_Box(_Object_Message_Box, MESSAGE_BOX_DEFAULT_TICKS);
|
||||
_Decision_Made = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
Internal Functions
|
||||
*******************************************************************/
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
// ============================================================================================
|
||||
// Includes
|
||||
#include "../Screens.h"
|
||||
#include "../Command.h"
|
||||
#include "../UI_Control.h"
|
||||
#include "../Mode_Manager.h"
|
||||
#include "../Command_Definition.h"
|
||||
|
||||
#include "../Display.h"
|
||||
@@ -33,6 +35,7 @@ static uint8_t* _Color;
|
||||
|
||||
static bool _Decision_Made;
|
||||
static uint32_t _Counter;
|
||||
static Mode _Current_Mode;
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
@@ -68,6 +71,9 @@ void Screen_Setup_Select_RGB(Screen_Transition_Direction direction_out, Screen_T
|
||||
|
||||
_Decision_Made = false;
|
||||
_Counter = 0;
|
||||
_Current_Mode = Mode_Manager_Get_Current_Mode();
|
||||
|
||||
Mode_Manager_Set_Mode(PREVIEW);
|
||||
}
|
||||
|
||||
void Screen_Init(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration)
|
||||
@@ -101,6 +107,10 @@ void Screen_Init(Screen_Transition_Direction direction_out, Screen_Transition_Di
|
||||
|
||||
void Screen_Tick(void)
|
||||
{
|
||||
Command_Issue_Set_Request(MULTICORE_COMMAND_SET_DIRECT_RED , MULTICORE_NO_PARAMETER, _RGB_Color->R);
|
||||
Command_Issue_Set_Request(MULTICORE_COMMAND_SET_DIRECT_GREEN, MULTICORE_NO_PARAMETER, _RGB_Color->G);
|
||||
Command_Issue_Set_Request(MULTICORE_COMMAND_SET_DIRECT_BLUE , MULTICORE_NO_PARAMETER, _RGB_Color->B);
|
||||
|
||||
if(_Decision_Made) {
|
||||
_Counter++;
|
||||
}
|
||||
@@ -171,6 +181,12 @@ void Screen_On_Object_Deselect(Object_ID object_id)
|
||||
if(!_Decision_Made) {
|
||||
Display_Objects_Show_Message_Box(_Object_Message_Box, MESSAGE_BOX_DEFAULT_TICKS);
|
||||
_Decision_Made = true;
|
||||
|
||||
Command_Issue_Set_Request(MULTICORE_COMMAND_SET_DIRECT_RED , MULTICORE_NO_PARAMETER, 0);
|
||||
Command_Issue_Set_Request(MULTICORE_COMMAND_SET_DIRECT_GREEN, MULTICORE_NO_PARAMETER, 0);
|
||||
Command_Issue_Set_Request(MULTICORE_COMMAND_SET_DIRECT_BLUE , MULTICORE_NO_PARAMETER, 0);
|
||||
|
||||
Mode_Manager_Set_Mode(_Current_Mode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ static int32_t _Return_Selected_Item;
|
||||
static char* _Title;
|
||||
static uint32_t _Title_Length;
|
||||
static int32_t* _Value;
|
||||
static int32_t _Display_Value;
|
||||
static const Menu_Configuration_Select_Value* _Config;
|
||||
|
||||
static bool _Decision_Made;
|
||||
@@ -54,7 +55,10 @@ static void Screen_On_Object_Deselect (Object_ID object_id);
|
||||
*******************************************************************/
|
||||
void Screen_Setup_Select_Value(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration, char* title, uint32_t title_length, int32_t* value, const Menu_Configuration_Select_Value* config, const Hierarchical_Menu* return_menu, const Menu_List* return_list, int32_t return_selected_item)
|
||||
{
|
||||
_Title = title;
|
||||
_Title_Length = title_length;
|
||||
_Value = value;
|
||||
_Display_Value = *value * config->Value_Display_Ratio;
|
||||
_Config = config;
|
||||
|
||||
Screen_Init(direction_out, direction_in, type, frame_duration);
|
||||
@@ -87,13 +91,13 @@ void Screen_Init(Screen_Transition_Direction direction_out, Screen_Transition_Di
|
||||
//////////////////////////////
|
||||
// Add Display Objects here //
|
||||
//////////////////////////////
|
||||
Display_Objects_Add_Select_Value(_Title, _Title_Length, _Value, _Config->Max, _Config->Min, _Config->Format, &_Configuration_Default_Select_Value);
|
||||
Display_Objects_Add_Select_Value(_Title, _Title_Length, &_Display_Value, _Config->Max, _Config->Min, (char*)_Config->Format, &_Configuration_Default_Select_Value);
|
||||
_Object_Message_Box = Display_Objects_Add_Message_Box(CENTER_MIDDLE, BOTH_IN_PERCENT, 50, 50, "Saved", MESSAGE_BOX_ICON_CIRCLE_CHECKMARK, &_Message_Box_Style_Regular);
|
||||
|
||||
Display_Select_Object();
|
||||
|
||||
UI_Control_Acceleration_Reset();
|
||||
UI_Control_Acceleration_Set_Enabled(true);
|
||||
UI_Control_Acceleration_Set_Enabled(_Config->Use_Acceleration);
|
||||
}
|
||||
|
||||
void Screen_Tick(void)
|
||||
@@ -123,7 +127,9 @@ void Screen_Action_CW(Object_ID object_id)
|
||||
return;
|
||||
}
|
||||
|
||||
UI_Control_Selector_Inc(_Value, _Config->Min, _Config->Max, true);
|
||||
UI_Control_Selector_Inc(_Value, _Config->Min, _Config->Max, _Config->Cycle_Selector);
|
||||
|
||||
_Display_Value = *_Value * _Config->Value_Display_Ratio;
|
||||
}
|
||||
|
||||
void Screen_Action_CCW(Object_ID object_id)
|
||||
@@ -132,7 +138,9 @@ void Screen_Action_CCW(Object_ID object_id)
|
||||
return;
|
||||
}
|
||||
|
||||
UI_Control_Selector_Dec(_Value, _Config->Min, _Config->Max, true);
|
||||
UI_Control_Selector_Dec(_Value, _Config->Min, _Config->Max, _Config->Cycle_Selector);
|
||||
|
||||
_Display_Value = *_Value * _Config->Value_Display_Ratio;
|
||||
}
|
||||
|
||||
void Screen_On_Object_Focused(Object_ID object_id)
|
||||
|
||||
@@ -59,6 +59,9 @@ static Configuration_Menu_Icon_Row _Configuration_Menu_Icon_Row = {
|
||||
static int32_t _Selected_Item;
|
||||
|
||||
extern const Hierarchical_Menu _Hierarchical_Menu_MIDI;
|
||||
extern const Hierarchical_Menu _Hierarchical_Menu_Jam;
|
||||
extern const Hierarchical_Menu _Hierarchical_Menu_Const_Light;
|
||||
extern const Hierarchical_Menu _Hierarchical_Menu_Device;
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
@@ -165,14 +168,13 @@ void Screen_On_Object_Deselect(Object_ID object_id)
|
||||
{
|
||||
switch (_Selected_Item)
|
||||
{
|
||||
// case 0: Screen_Setup_Settings_MIDI(TRANSITION_UP, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, 0); break;
|
||||
case 0: Screen_Setup_Settings_Hierarchical_Menu(TRANSITION_UP, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, &_Hierarchical_Menu_MIDI, _Hierarchical_Menu_MIDI.List, 0); break;
|
||||
case 1: break;
|
||||
case 2: break;
|
||||
case 3: break;
|
||||
case 4: break;
|
||||
case 5: Screen_Setup_Settings_About(TRANSITION_UP, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES); break;
|
||||
case 6: Screen_Setup_Menu_Main(TRANSITION_DOWN, TRANSITION_DOWN, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, false, 1); break;
|
||||
case 0: Screen_Setup_Settings_Hierarchical_Menu(TRANSITION_UP, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, &_Hierarchical_Menu_MIDI, _Hierarchical_Menu_MIDI.List , 0); break;
|
||||
case 1: Screen_Setup_Settings_Hierarchical_Menu(TRANSITION_UP, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, &_Hierarchical_Menu_Jam, _Hierarchical_Menu_Jam.List , 0); break;
|
||||
case 2: Screen_Setup_Settings_Hierarchical_Menu(TRANSITION_UP, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, &_Hierarchical_Menu_Const_Light, _Hierarchical_Menu_Const_Light.List , 0); break;
|
||||
case 3: Screen_Setup_Settings_Hierarchical_Menu(TRANSITION_UP, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, &_Hierarchical_Menu_Device, _Hierarchical_Menu_Device.List , 0); break;
|
||||
case 4: Screen_Setup_EEPROM_Code (TRANSITION_UP, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES); break;
|
||||
case 5: Screen_Setup_Settings_About (TRANSITION_UP, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES); break;
|
||||
case 6: Screen_Setup_Menu_Main (TRANSITION_DOWN, TRANSITION_DOWN, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, false, 1); break;
|
||||
}
|
||||
|
||||
Display_Select_Object();
|
||||
|
||||
@@ -244,16 +244,101 @@ void Handle_Item_Selection(void)
|
||||
switch(Selected_Item->Type)
|
||||
{
|
||||
case BOOL:
|
||||
Screen_Setup_Select_Bool(TRANSITION_LEFT, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, (char*)Selected_Item->Variable_Title, strlen(Selected_Item->Variable_Title), (uint8_t*)Selected_Item->Variable, _Menu, Selected_Item->Containing_List, _Selected_Item);
|
||||
Screen_Setup_Select_Bool(TRANSITION_LEFT, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES,
|
||||
(char*)Selected_Item->Variable_Title,
|
||||
strlen(Selected_Item->Variable_Title),
|
||||
(uint8_t*)Selected_Item->Variable,
|
||||
_Menu,
|
||||
Selected_Item->Containing_List,
|
||||
_Selected_Item
|
||||
);
|
||||
break;
|
||||
|
||||
case RGB:
|
||||
Screen_Setup_Select_RGB(TRANSITION_LEFT, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, (char*)Selected_Item->Variable_Title, strlen(Selected_Item->Variable_Title), (LED_Data_t*)Selected_Item->Variable, _Menu, Selected_Item->Containing_List, _Selected_Item);
|
||||
Screen_Setup_Select_RGB(TRANSITION_LEFT, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES,
|
||||
(char*)Selected_Item->Variable_Title,
|
||||
strlen(Selected_Item->Variable_Title),
|
||||
(LED_Data_t*)Selected_Item->Variable,
|
||||
_Menu,
|
||||
Selected_Item->Containing_List,
|
||||
_Selected_Item
|
||||
);
|
||||
break;
|
||||
|
||||
case VALUE:
|
||||
if(Selected_Item->Configuration == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
Screen_Setup_Select_Value(TRANSITION_LEFT, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES,
|
||||
(char*)Selected_Item->Variable_Title,
|
||||
strlen(Selected_Item->Variable_Title),
|
||||
(int32_t*)Selected_Item->Variable,
|
||||
(const Menu_Configuration_Select_Value*)(Selected_Item->Configuration),
|
||||
_Menu,
|
||||
Selected_Item->Containing_List,
|
||||
_Selected_Item
|
||||
);
|
||||
break;
|
||||
|
||||
case LIST:
|
||||
if(Selected_Item->Configuration == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
Screen_Setup_Select_List(TRANSITION_LEFT, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES,
|
||||
(char*)Selected_Item->Variable_Title,
|
||||
strlen(Selected_Item->Variable_Title),
|
||||
(int32_t*)Selected_Item->Variable,
|
||||
(const Menu_Configuration_Select_List*)(Selected_Item->Configuration),
|
||||
_Menu,
|
||||
Selected_Item->Containing_List,
|
||||
_Selected_Item
|
||||
);
|
||||
break;
|
||||
|
||||
case DEFAULT_NOTES:
|
||||
Screen_Setup_Default_Notes(TRANSITION_LEFT, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES,
|
||||
(char*)Selected_Item->Variable_Title,
|
||||
strlen(Selected_Item->Variable_Title),
|
||||
_Menu,
|
||||
Selected_Item->Containing_List,
|
||||
_Selected_Item
|
||||
);
|
||||
break;
|
||||
|
||||
case REBOOT:
|
||||
Screen_Setup_Settings_Reboot(TRANSITION_LEFT, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES,
|
||||
_Menu,
|
||||
Selected_Item->Containing_List,
|
||||
_Selected_Item
|
||||
);
|
||||
break;
|
||||
|
||||
case HUE:
|
||||
Screen_Setup_Select_Hue(TRANSITION_LEFT, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES,
|
||||
(char*)Selected_Item->Variable_Title,
|
||||
strlen(Selected_Item->Variable_Title),
|
||||
(int32_t*)Selected_Item->Variable,
|
||||
(const Menu_Configuration_Select_Value*)(Selected_Item->Configuration),
|
||||
_Menu,
|
||||
Selected_Item->Containing_List,
|
||||
_Selected_Item
|
||||
);
|
||||
break;
|
||||
|
||||
case MINMAX:
|
||||
Screen_Setup_Select_MinMax(TRANSITION_LEFT, TRANSITION_UP, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES,
|
||||
(char*)Selected_Item->Variable_Title,
|
||||
strlen(Selected_Item->Variable_Title),
|
||||
(MinMax_t*)Selected_Item->Variable,
|
||||
(const Menu_Configuration_Select_MinMax*)(Selected_Item->Configuration),
|
||||
_Menu,
|
||||
Selected_Item->Containing_List,
|
||||
_Selected_Item
|
||||
);
|
||||
break;
|
||||
|
||||
case NONE:
|
||||
default:
|
||||
break;
|
||||
|
||||
206
Firmware/Screens_Display/Screen_Settings_Reboot.c
Normal file
206
Firmware/Screens_Display/Screen_Settings_Reboot.c
Normal file
@@ -0,0 +1,206 @@
|
||||
/*
|
||||
* File: Screen_Settings_Reboot.c
|
||||
*
|
||||
* Created: Created: Tuesday September 2025 20:36:48
|
||||
* Author: Chris
|
||||
*/
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Includes
|
||||
#include "../Screens.h"
|
||||
#include "../UI_Control.h"
|
||||
|
||||
#include "../Display.h"
|
||||
#include "../Display_Objects.h"
|
||||
#include "../Display_Render_Complex.h"
|
||||
#include "../Display_Default_Configurations.h"
|
||||
|
||||
#include "hardware/watchdog.h"
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Defines
|
||||
#define COLOR_DOT_ACTIVE 0xFFFF // Pure White #FFFFFF
|
||||
#define COLOR_DOT_INACTIVE 0x0842 // Dark Gray #404450
|
||||
|
||||
#define DOT_ANIMATION_SPEED 8
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Variables
|
||||
extern const uint8_t _Font_DejaVu_Sans_Mono_Bold_15x26[];
|
||||
|
||||
static Object_ID _Object_YesNo;
|
||||
static Object_ID _Object_Text;
|
||||
static Object_ID _Object_Dots[3];
|
||||
|
||||
static const Hierarchical_Menu* _Return_Menu = NULL;
|
||||
static const Menu_List* _Return_List = NULL;
|
||||
static int32_t _Return_Selected_Item;
|
||||
|
||||
static bool _Bool_Value;
|
||||
static bool _Decision_Made;
|
||||
static uint32_t _Counter;
|
||||
static int32_t _Dot_Animation_Phase;
|
||||
|
||||
|
||||
// ============================================================================================
|
||||
// Function Declarations
|
||||
void Screen_Setup_Settings_Reboot(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration, const Hierarchical_Menu* return_menu, const Menu_List* return_list, int32_t return_selected_item);
|
||||
|
||||
static void Update_Dot_Animation(void);
|
||||
|
||||
static void Screen_Init (Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration);
|
||||
static void Screen_Tick (void);
|
||||
static void Screen_Click (uint button_return_value);
|
||||
static void Screen_Touch_Event (int16_t x, int16_t y);
|
||||
static void Screen_Action_CW (Object_ID object_id);
|
||||
static void Screen_Action_CCW (Object_ID object_id);
|
||||
static void Screen_On_Object_Focused (Object_ID object_id);
|
||||
static void Screen_On_Object_Defocused (Object_ID object_id);
|
||||
static void Screen_On_Object_Select (Object_ID object_id);
|
||||
static void Screen_On_Object_Deselect (Object_ID object_id);
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
Functions
|
||||
*******************************************************************/
|
||||
void Screen_Setup_Settings_Reboot(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration, const Hierarchical_Menu* return_menu, const Menu_List* return_list, int32_t return_selected_item)
|
||||
{
|
||||
_Bool_Value = false;
|
||||
|
||||
Screen_Init(direction_out, direction_in, type, frame_duration);
|
||||
|
||||
_Return_Menu = return_menu;
|
||||
_Return_List = return_list;
|
||||
_Return_Selected_Item = return_selected_item;
|
||||
|
||||
_Counter = 0;
|
||||
_Dot_Animation_Phase = 0;
|
||||
_Decision_Made = false;
|
||||
}
|
||||
|
||||
void Screen_Init(Screen_Transition_Direction direction_out, Screen_Transition_Direction direction_in, Easing type, uint32_t frame_duration)
|
||||
{
|
||||
_Screen_Last = Screen_Init;
|
||||
_Screen_Tick = Screen_Tick;
|
||||
_Screen_Click = Screen_Click;
|
||||
_Screen_Touch_Event = Screen_Touch_Event;
|
||||
_Screen_Action_CW = Screen_Action_CW;
|
||||
_Screen_Action_CCW = Screen_Action_CCW;
|
||||
_Screen_On_Objects_Focused = Screen_On_Object_Focused;
|
||||
_Screen_On_Objects_Defocused = Screen_On_Object_Defocused;
|
||||
_Screen_On_Object_Select = Screen_On_Object_Select;
|
||||
_Screen_On_Object_Deselect = Screen_On_Object_Deselect;
|
||||
|
||||
Display_Objects_Clear();
|
||||
Display_Screen_Transition_Start(direction_out, direction_in, type, frame_duration);
|
||||
|
||||
|
||||
//////////////////////////////
|
||||
// Add Display Objects here //
|
||||
//////////////////////////////
|
||||
Font_ID Font_Text = Display_Objects_Add_Font(_Font_DejaVu_Sans_Mono_Bold_15x26, 0);
|
||||
|
||||
Display_Render_Complex_Select_YesNo_Set(_Bool_Value, &_Configuration_Default_Select_YesNo);
|
||||
_Object_YesNo = Display_Objects_Add_Select_YesNo("Reboot Device", 13, &_Bool_Value, &_Configuration_Default_Select_YesNo);
|
||||
|
||||
_Object_Text = Display_Objects_Add_Text(CENTER_BOTTOM, BOTH_IN_PERCENT, 50, 50, NOT_SELECTABLE, "Rebooting", Font_Text, DISPLAY_COLOR_LIGHTGREY, NO_STYLE, NO_ANIMATION);
|
||||
Display_Objects_Update_Enabled(_Object_Text, false);
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
_Object_Dots[i] = Display_Objects_Add_Circle_Frame(CENTER_MIDDLE, BOTH_IN_PERCENT, 50 + (i-1) * 6, 60, NOT_SELECTABLE, COLOR_DOT_INACTIVE, 4, 1, NO_STYLE, NO_ANIMATION);
|
||||
Display_Objects_Update_Enabled(_Object_Dots[i], false);
|
||||
}
|
||||
|
||||
Display_Select_Object();
|
||||
}
|
||||
|
||||
void Screen_Tick(void)
|
||||
{
|
||||
if(_Decision_Made && _Bool_Value) {
|
||||
Update_Dot_Animation();
|
||||
}
|
||||
}
|
||||
|
||||
void Screen_Click(uint button_return_value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_Touch_Event(int16_t x, int16_t y)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_Action_CW(Object_ID object_id)
|
||||
{
|
||||
if(_Decision_Made) {
|
||||
return;
|
||||
}
|
||||
|
||||
_Bool_Value = !_Bool_Value;
|
||||
}
|
||||
|
||||
void Screen_Action_CCW(Object_ID object_id)
|
||||
{
|
||||
Screen_Action_CW(object_id);
|
||||
}
|
||||
|
||||
void Screen_On_Object_Focused(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Defocused(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Select(Object_ID object_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Screen_On_Object_Deselect(Object_ID object_id)
|
||||
{
|
||||
if(!_Decision_Made) {
|
||||
_Decision_Made = true;
|
||||
|
||||
if(_Bool_Value == false) {
|
||||
Screen_Setup_Settings_Hierarchical_Menu(TRANSITION_DOWN, TRANSITION_RIGHT, SCREEN_TRANSITION_DEFAULT_EASING, SCREEN_TRANSITION_DEFAULT_FRAMES, _Return_Menu, _Return_List, _Return_Selected_Item);
|
||||
return;
|
||||
}
|
||||
|
||||
Display_Objects_Update_Enabled(_Object_YesNo, false);
|
||||
Display_Objects_Update_Enabled(_Object_Text, true);
|
||||
for(int i = 0; i < 3; i++) {
|
||||
Display_Objects_Update_Enabled(_Object_Dots[i], true);
|
||||
}
|
||||
|
||||
watchdog_reboot(0, 0, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
Internal Functions
|
||||
*******************************************************************/
|
||||
void Update_Dot_Animation(void)
|
||||
{
|
||||
_Dot_Animation_Phase++;
|
||||
|
||||
if(_Dot_Animation_Phase >= (DOT_ANIMATION_SPEED * 3)) {
|
||||
_Dot_Animation_Phase = 0;
|
||||
}
|
||||
|
||||
// Determine which dot should be active
|
||||
int Active_Dot = _Dot_Animation_Phase / DOT_ANIMATION_SPEED;
|
||||
|
||||
// Update dot colors
|
||||
for(int i = 0; i < 3; i++) {
|
||||
Display_Color Dot_Color = (i == Active_Dot) ? COLOR_DOT_ACTIVE : COLOR_DOT_INACTIVE;
|
||||
Display_Objects_Update_Color(_Object_Dots[i], Dot_Color);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user