Skip to content

Commit

Permalink
-style
Browse files Browse the repository at this point in the history
  • Loading branch information
resistancelion committed Jan 30, 2025
1 parent e346a77 commit 157769b
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion source/Core/BSP/Miniware/Vendor/CMSIS/Include/arm_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ static __INLINE q63_t mult32x64(q63_t x, q31_t y) { return ((((q63_t)(x & 0x0000
/*
#if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM )
#define __CLZ __clz
#endif
#endif
*/
/* note: function can be removed when all toolchain support __CLZ for Cortex-M0 */
#if defined(ARM_MATH_CM0_FAMILY) && ((defined(__ICCARM__)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
* \code
* #if defined(__NMSIS_VERSION) && (__NMSIS_VERSION >= 0x00010105)
* #warning "Yes, we have NMSIS 1.1.5 or later"
* #else
* #else
* #error "We need NMSIS 1.1.5 or later!"
* #endif
* #endif
* \endcode
*
* @{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ typedef enum IRQn {
#ifdef NMSIS_ECLIC_VIRTUAL
#ifndef NMSIS_ECLIC_VIRTUAL_HEADER_FILE
#define NMSIS_ECLIC_VIRTUAL_HEADER_FILE "nmsis_eclic_virtual.h"
#endif
#endif
#include NMSIS_ECLIC_VIRTUAL_HEADER_FILE
#else
#define ECLIC_SetCfgNlbits __ECLIC_SetCfgNlbits
Expand Down Expand Up @@ -238,7 +238,7 @@ typedef enum IRQn {
#ifdef NMSIS_VECTAB_VIRTUAL
#ifndef NMSIS_VECTAB_VIRTUAL_HEADER_FILE
#define NMSIS_VECTAB_VIRTUAL_HEADER_FILE "nmsis_vectab_virtual.h"
#endif
#endif
#include NMSIS_VECTAB_VIRTUAL_HEADER_FILE
#else
#define ECLIC_SetVector __ECLIC_SetVector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
* \code
* #if defined(__NMSIS_VERSION) && (__NMSIS_VERSION >= 0x00010105)
* #warning "Yes, we have NMSIS 1.1.5 or later"
* #else
* #else
* #error "We need NMSIS 1.1.5 or later!"
* #endif
* #endif
* \endcode
*
* @{
Expand Down
2 changes: 1 addition & 1 deletion source/Core/BSP/Sequre/Vendor/CMSIS/Include/arm_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ static __INLINE q63_t mult32x64(q63_t x, q31_t y) { return ((((q63_t)(x & 0x0000
/*
#if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM )
#define __CLZ __clz
#endif
#endif
*/
/* note: function can be removed when all toolchain support __CLZ for Cortex-M0 */
#if defined(ARM_MATH_CM0_FAMILY) && ((defined(__ICCARM__)))
Expand Down
10 changes: 5 additions & 5 deletions source/Core/Drivers/Font.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
0x03, 0x07, 0x0e, 0x1c, 0x38, 0x70, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
#endif
#endif

const uint8_t buttonB[] = {
// width = 56
Expand Down Expand Up @@ -356,7 +356,7 @@
0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x07, 0x0f, 0x2b, 0x09, 0x07, 0x00, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x02, 0x01,
}
};
#else
#else
#if defined(MODEL_TS100) || defined(MODEL_Pinecil) || defined(MODEL_Pinecilv2)
const uint8_t buttonA[] = {
// width = 42
Expand Down Expand Up @@ -401,7 +401,7 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, 0x40, 0x40, 0x40, 0x20, 0x20, 0x20, 0x20, 0x10, 0x10, 0xd0, 0xc8, 0x08, 0x10, 0x10, 0x10, 0x10,
0x20, 0x20, 0x20, 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x38, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
#endif
#endif

const uint8_t buttonB[] = {
// width = 42
Expand Down Expand Up @@ -578,8 +578,8 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xE8, 0x70, 0x7A, 0x5E, 0x8E, 0x1C, 0x30, 0x00, //
0x00, 0x10, 0x38, 0x1C, 0x0E, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //

#endif
};
#endif
};
#endif
// clang-format on
#endif /* FONT_H_ */
18 changes: 9 additions & 9 deletions source/Core/Threads/GUIThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ OperatingMode guiHandleDraw(void) {
OLED::clearScreen(); // Clear ready for render pass
bool d = getSettingValue(SettingsOptions::ReverseButtonNavEnabled);
bool e = getSettingValue(SettingsOptions::ReverseButtonTempChangeEnabled);
#ifdef REVERSE_NAV_EVERYWHERE
#ifdef REVERSE_NAV_EVERYWHERE
bool f = currentOperatingMode == OperatingMode::TemperatureAdjust;
// Read button state
ButtonState buttons = getButtonState((e && f) || (d && !e && !f) || (d && e && !f));
#else
#else
ButtonState buttons = getButtonState();
#endif
#endif
// Enforce screen on if buttons pressed, movement, hot tip etc
if (buttons != BUTTON_NONE) {
OLED::setDisplayState(OLED::DisplayState::ON);
Expand Down Expand Up @@ -117,11 +117,11 @@ OperatingMode guiHandleDraw(void) {
newMode = gui_SolderingSleepingMode(buttons, &context);
break;
case OperatingMode::TemperatureAdjust:
#ifdef REVERSE_NAV_EVERYWHERE
#ifdef REVERSE_NAV_EVERYWHERE
newMode = gui_solderingTempAdjust(getButtonState(), &context);
#else
#else
newMode = gui_solderingTempAdjust(getButtonState(e), &context);
#endif
#endif
break;
case OperatingMode::DebugMenuReadout:
newMode = showDebugMenu(buttons, &context);
Expand All @@ -130,11 +130,11 @@ OperatingMode guiHandleDraw(void) {
newMode = performCJCC(buttons, &context);
break;
case OperatingMode::SettingsMenu:
#ifdef REVERSE_NAV_EVERYWHERE
#ifdef REVERSE_NAV_EVERYWHERE
newMode = gui_SettingsMenu(getButtonState(), &context);
#else
#else
newMode = gui_SettingsMenu(getButtonState(d), &context);
#endif
#endif
break;
case OperatingMode::InitialisationDone:
newMode = handle_post_init_state();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,43 @@ extern uint8_t disconnectedTipF[sizeof(disconnectedTip)];

void ui_draw_homescreen_simplified(TemperatureType_t tipTemp) {
bool isFlipped = OLED::getRotation();
#ifdef REVERSE_NAV_EVERYWHERE
#ifdef REVERSE_NAV_EVERYWHERE
bool isReverse = getSettingValue(SettingsOptions::ReverseButtonNavEnabled);
#endif
#endif
bool tipDisconnected = isTipDisconnected();

// Flip and switch buttons accordingly
#ifdef REVERSE_NAV_EVERYWHERE
#ifdef REVERSE_NAV_EVERYWHERE
OLED::drawArea(isFlipped ? 68 : 0, 0, 56, 32, isFlipped ? (isReverse ? buttonBF : buttonAF) : (isReverse ? buttonB : buttonA));
OLED::drawArea(isFlipped ? 12 : 58, 0, 56, 32, isFlipped ? (isReverse ? buttonAF : buttonBF) : (isReverse ? buttonA : buttonB));
#else
#else
OLED::drawArea(isFlipped ? 68 : 0, 0, 56, 32, isFlipped ? buttonAF : buttonA);
OLED::drawArea(isFlipped ? 12 : 58, 0, 56, 32, isFlipped ? buttonBF : buttonB);
#endif
#endif

if ((tipTemp > 55) || tipDisconnected) {
// draw temp over the start soldering button
// Location changes on screen rotation and due to button swapping
// in right handed mode we want to draw over the first part
#ifdef REVERSE_NAV_EVERYWHERE
#ifdef REVERSE_NAV_EVERYWHERE
OLED::fillArea(isReverse ? (isFlipped ? 26 : 58) : (isFlipped ? 68 : 0), 0, 56, 32, 0); // clear the area
OLED::setCursor(isReverse ? (isFlipped ? 27 : 59) : (isFlipped ? 56 : 0), 0);
#else
#else
OLED::fillArea(isFlipped ? 68 : 0, 0, 56, 32, 0); // clear the area
OLED::setCursor(isFlipped ? 56 : 0, 0);
#endif
#endif
// If tip is disconnected draw the notification, otherwise - the temp
if (tipDisconnected) {
// Draw-in the missing tip symbol
#ifdef REVERSE_NAV_EVERYWHERE
#ifdef REVERSE_NAV_EVERYWHERE
if (isReverse) {
OLED::drawArea(isFlipped ? 20 : 54, 0, 56, 32, isFlipped ? disconnectedTipF : disconnectedTip);
} else {
#endif
#endif
OLED::drawArea(isFlipped ? 54 : 0, 0, 56, 32, isFlipped ? disconnectedTipF : disconnectedTip);
#ifdef REVERSE_NAV_EVERYWHERE
#ifdef REVERSE_NAV_EVERYWHERE
}
#endif
#endif
} else if (!(getSettingValue(SettingsOptions::CoolingTempBlink) && (xTaskGetTickCount() % 1000 < 300))) {
ui_draw_tip_temperature(false, FontStyle::LARGE); // Draw-in the temp
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,43 @@ extern uint8_t disconnectedTipF[sizeof(disconnectedTip)];

void ui_draw_homescreen_simplified(TemperatureType_t tipTemp) {
bool isFlipped = OLED::getRotation();
#ifdef REVERSE_NAV_EVERYWHERE
#ifdef REVERSE_NAV_EVERYWHERE
bool isReverse = getSettingValue(SettingsOptions::ReverseButtonNavEnabled);
#endif
#endif
bool tipDisconnected = isTipDisconnected();

// Flip and switch buttons accordingly
#ifdef REVERSE_NAV_EVERYWHERE
#ifdef REVERSE_NAV_EVERYWHERE
OLED::drawArea(isFlipped ? 54 : 0, 0, 42, 16, isFlipped ? (isReverse ? buttonBF : buttonAF) : (isReverse ? buttonB : buttonA));
OLED::drawArea(isFlipped ? 12 : 42, 0, 42, 16, isFlipped ? (isReverse ? buttonAF : buttonBF) : (isReverse ? buttonA : buttonB));
#else
#else
OLED::drawArea(isFlipped ? 54 : 0, 0, 42, 16, isFlipped ? buttonAF : buttonA);
OLED::drawArea(isFlipped ? 12 : 42, 0, 42, 16, isFlipped ? buttonBF : buttonB);
#endif
#endif

if ((tipTemp > 55) || tipDisconnected) {
// draw temp over the start soldering button
// Location changes on screen rotation and due to button swapping
// in right handed mode we want to draw over the first part
#ifdef REVERSE_NAV_EVERYWHERE
#ifdef REVERSE_NAV_EVERYWHERE
OLED::fillArea(isReverse ? (isFlipped ? 14 : 42) : (isFlipped ? 55 : 0), 0, 41, 16, 0); // clear the area
OLED::setCursor(isReverse ? (isFlipped ? 15 : 43) : (isFlipped ? 56 : 0), 0);
#else
#else
OLED::fillArea(isFlipped ? 55 : 0, 0, 41, 16, 0); // clear the area
OLED::setCursor(isFlipped ? 56 : 0, 0);
#endif
#endif
// If tip is disconnected draw the notification, otherwise - the temp
if (tipDisconnected) {
// Draw-in the missing tip symbol
#ifdef REVERSE_NAV_EVERYWHERE
#ifdef REVERSE_NAV_EVERYWHERE
if (isReverse) {
OLED::drawArea(isFlipped ? 12 : 42, 0, 42, 16, isFlipped ? disconnectedTipF : disconnectedTip);
} else {
#endif
#endif
OLED::drawArea(isFlipped ? 54 : 0, 0, 42, 16, isFlipped ? disconnectedTipF : disconnectedTip);
#ifdef REVERSE_NAV_EVERYWHERE
#ifdef REVERSE_NAV_EVERYWHERE
}
#endif
#endif
} else if (!(getSettingValue(SettingsOptions::CoolingTempBlink) && (xTaskGetTickCount() % 1000 < 300))) {
ui_draw_tip_temperature(false, FontStyle::LARGE); // Draw-in the temp
}
Expand Down
6 changes: 3 additions & 3 deletions source/Core/Threads/UI/logic/utils/shouldDeviceShutdown.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ bool shouldShutdown(void) {
}
}
}
#ifdef REVERSE_NAV_EVERYWHERE
#ifdef REVERSE_NAV_EVERYWHERE
if (getButtonState(getSettingValue(SettingsOptions::ReverseButtonNavEnabled) == BUTTON_B_LONG) { // allow also if back button is pressed long
#else
#else
if (getButtonState() == BUTTON_B_LONG) { // allow also if back button is pressed long
#endif
#endif
return true;
}
return false;
Expand Down

0 comments on commit 157769b

Please sign in to comment.