From 0bd84d9d5700738523ecc84756e522c4f249cfdb Mon Sep 17 00:00:00 2001 From: Ivan Zorin Date: Mon, 17 Feb 2025 18:37:28 +0300 Subject: [PATCH] Refactoring: REVERSE_BUTTON_MENU handling and unify comment/section style in configuration.h files for related changes --- source/Core/BSP/MHP30/configuration.h | 7 +++++-- source/Core/BSP/Miniware/configuration.h | 7 +++++-- source/Core/BSP/Pinecil/configuration.h | 7 +++++-- source/Core/BSP/Pinecilv2/configuration.h | 7 +++++-- source/Core/BSP/Sequre/configuration.h | 8 +++++--- source/Core/Src/Settings.cpp | 5 +++-- 6 files changed, 28 insertions(+), 13 deletions(-) diff --git a/source/Core/BSP/MHP30/configuration.h b/source/Core/BSP/MHP30/configuration.h index 855fdf22..35269f8a 100644 --- a/source/Core/BSP/MHP30/configuration.h +++ b/source/Core/BSP/MHP30/configuration.h @@ -53,15 +53,18 @@ /** * OLED Orientation - * */ #define ORIENTATION_MODE 0 // 0: Right 1:Left 2:Automatic - Default right #define MAX_ORIENTATION_MODE 1 // Unlikely to ever change + +/** + * Buttons handling + */ #define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assignment for temperature change +#define REVERSE_BUTTON_MENU 0 // 0:Default 1:Reverse - Reverse the A and B button assignment for Settings menu only /** * OLED Brightness - * */ #define MIN_BRIGHTNESS 0 // Min OLED brightness selectable #define MAX_BRIGHTNESS 100 // Max OLED brightness selectable diff --git a/source/Core/BSP/Miniware/configuration.h b/source/Core/BSP/Miniware/configuration.h index 17301efa..ab8ae203 100644 --- a/source/Core/BSP/Miniware/configuration.h +++ b/source/Core/BSP/Miniware/configuration.h @@ -53,15 +53,18 @@ /** * OLED Orientation - * */ #define ORIENTATION_MODE 2 // 0: Right 1:Left 2:Automatic - Default Automatic #define MAX_ORIENTATION_MODE 2 // Up to auto + +/** + * Buttons handling + */ #define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assignment for temperature change +#define REVERSE_BUTTON_MENU 0 // 0:Default 1:Reverse - Reverse the A and B button assignment for Settings menu only /** * OLED Brightness - * */ #if defined(MODEL_TS101) #define MIN_BRIGHTNESS 1 // Min OLED brightness selectable diff --git a/source/Core/BSP/Pinecil/configuration.h b/source/Core/BSP/Pinecil/configuration.h index 4ac4b689..1ae37944 100644 --- a/source/Core/BSP/Pinecil/configuration.h +++ b/source/Core/BSP/Pinecil/configuration.h @@ -53,15 +53,18 @@ /** * OLED Orientation - * */ #define ORIENTATION_MODE 2 // 0: Right 1:Left 2:Automatic - Default Automatic #define MAX_ORIENTATION_MODE 2 // Up to auto + +/** + * Buttons handling + */ #define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assignment for temperature change +#define REVERSE_BUTTON_MENU 0 // 0:Default 1:Reverse - Reverse the A and B button assignment for Settings menu only /** * OLED Brightness - * */ #define MIN_BRIGHTNESS 0 // Min OLED brightness selectable #define MAX_BRIGHTNESS 100 // Max OLED brightness selectable diff --git a/source/Core/BSP/Pinecilv2/configuration.h b/source/Core/BSP/Pinecilv2/configuration.h index d5307d9f..59703d83 100644 --- a/source/Core/BSP/Pinecilv2/configuration.h +++ b/source/Core/BSP/Pinecilv2/configuration.h @@ -53,15 +53,18 @@ /** * OLED Orientation - * */ #define ORIENTATION_MODE 2 // 0: Right 1:Left 2:Automatic - Default Automatic #define MAX_ORIENTATION_MODE 2 // Up to auto + +/** + * Buttons handling + */ #define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assignment for temperature change +#define REVERSE_BUTTON_MENU 0 // 0:Default 1:Reverse - Reverse the A and B button assignment for Settings menu only /** * OLED Brightness - * */ #define MIN_BRIGHTNESS 1 // Min OLED brightness selectable #define MAX_BRIGHTNESS 101 // Max OLED brightness selectable diff --git a/source/Core/BSP/Sequre/configuration.h b/source/Core/BSP/Sequre/configuration.h index 2e021f35..0addfc8f 100644 --- a/source/Core/BSP/Sequre/configuration.h +++ b/source/Core/BSP/Sequre/configuration.h @@ -4,7 +4,6 @@ /** * Configuration.h * Define here your default pre settings for S60 - * */ //=========================================================================== @@ -21,7 +20,6 @@ /** * OLED Brightness - * */ #define MIN_BRIGHTNESS 1 // Min OLED brightness selectable #define MAX_BRIGHTNESS 101 // Max OLED brightness selectable @@ -62,11 +60,15 @@ /** * OLED Orientation - * */ #define ORIENTATION_MODE 0 // 0: Right 1:Left (2:Automatic N/A) #define MAX_ORIENTATION_MODE 1 // Disable auto mode + +/** + * Buttons handling + */ #define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assignment for temperature change +#define REVERSE_BUTTON_MENU 0 // 0:Default 1:Reverse - Reverse the A and B button assignment for Settings menu only /** * Temp change settings diff --git a/source/Core/Src/Settings.cpp b/source/Core/Src/Settings.cpp index 5b0e17b9..0e44f4f6 100644 --- a/source/Core/Src/Settings.cpp +++ b/source/Core/Src/Settings.cpp @@ -54,7 +54,7 @@ typedef struct { } SettingConstants; static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOptionsLength] = { - //{ min, max, increment, default} +// MIN, MAX, INCREMENT, DEFAULT { MIN_TEMP_C, MAX_TEMP_F, 5, SOLDERING_TEMP}, // SolderingTemp { MIN_TEMP_C, MAX_TEMP_F, 5, 150}, // SleepTemp { 0, 15, 1, SLEEP_TIME}, // SleepTime @@ -110,7 +110,8 @@ static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOp { 1, 10, 1, 2}, // ProfileCooldownSpeed { 0, 12, 1, 0}, // HallEffectSleepTime { 0, (tipType_t::TIP_TYPE_MAX - 1) > 0 ? (tipType_t::TIP_TYPE_MAX - 1) : 0, 1, 0}, // SolderingTipType - { 0, 1, 1, REVERSE_BUTTON_MENU}, // ReverseButtonMenu + { 0, 1, 1, REVERSE_BUTTON_MENU}, // ReverseButtonMenu +// MIN, MAX, INCREMENT, DEFAULT }; static_assert((sizeof(settingsConstants) / sizeof(SettingConstants)) == ((int)SettingsOptions::SettingsOptionsLength));