mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Sync
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "cmsis_os.h"
|
||||
#include "configuration.h"
|
||||
#include <OLED.hpp>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -209,21 +210,18 @@ void OLED::drawChar(const uint16_t charCode, const FontStyle fontStyle, const ui
|
||||
* of the indicator in pixels (0..<16).
|
||||
*/
|
||||
void OLED::drawScrollIndicator(uint8_t y, uint8_t height) {
|
||||
union u_type {
|
||||
uint32_t whole;
|
||||
uint8_t strips[4];
|
||||
} column;
|
||||
|
||||
column.whole = (1 << height) - 1; // preload a set of set bits of height
|
||||
column.whole <<= y; // Shift down by the y value
|
||||
|
||||
const uint32_t whole = ((1 << height) - 1) << y; // preload a set of set bits of height
|
||||
// Shift down by the y value
|
||||
const uint8_t strips[4] = {static_cast<uint8_t>(whole & 0xff), static_cast<uint8_t>((whole & 0xff00) >> 8 * 1), static_cast<uint8_t>((whole & 0xff0000) >> 8 * 2),
|
||||
static_cast<uint8_t>((whole & 0xff000000) >> 8 * 3)};
|
||||
// Draw a one pixel wide bar to the left with a single pixel as
|
||||
// the scroll indicator.
|
||||
fillArea(OLED_WIDTH - 1, 0, 1, 8, column.strips[0]);
|
||||
fillArea(OLED_WIDTH - 1, 8, 1, 8, column.strips[1]);
|
||||
fillArea(OLED_WIDTH - 1, 0, 1, 8, strips[0]);
|
||||
fillArea(OLED_WIDTH - 1, 8, 1, 8, strips[1]);
|
||||
#if OLED_HEIGHT == 32
|
||||
fillArea(OLED_WIDTH - 1, 16, 1, 8, column.strips[2]);
|
||||
fillArea(OLED_WIDTH - 1, 24, 1, 8, column.strips[3]);
|
||||
fillArea(OLED_WIDTH - 1, 16, 1, 8, strips[2]);
|
||||
fillArea(OLED_WIDTH - 1, 24, 1, 8, strips[3]);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -582,7 +582,6 @@ static void setBoostTemp(void) {
|
||||
if (value >= MAX_TEMP_F) {
|
||||
value = 0; // jump to off
|
||||
}
|
||||
setSettingValue(SettingsOptions::BoostTemp, value);
|
||||
} else {
|
||||
if (value == 0) {
|
||||
value = MIN_BOOST_TEMP_C; // loop back at 250
|
||||
@@ -657,14 +656,13 @@ static void setProfileTemp(const enum SettingsOptions option) {
|
||||
if (temp > MAX_TEMP_F) {
|
||||
temp = MIN_TEMP_F;
|
||||
}
|
||||
setSettingValue(option, temp);
|
||||
} else {
|
||||
temp += 5;
|
||||
if (temp > MAX_TEMP_C) {
|
||||
temp = MIN_TEMP_C;
|
||||
}
|
||||
setSettingValue(option, temp);
|
||||
}
|
||||
setSettingValue(option, temp);
|
||||
}
|
||||
|
||||
static void setProfilePreheatTemp(void) { return setProfileTemp(SettingsOptions::ProfilePreheatTemp); }
|
||||
@@ -715,14 +713,13 @@ static void setSleepTemp(void) {
|
||||
if (temp > 580) {
|
||||
temp = 60;
|
||||
}
|
||||
setSettingValue(SettingsOptions::SleepTemp, temp);
|
||||
} else {
|
||||
temp += 10;
|
||||
if (temp > 300) {
|
||||
temp = 10;
|
||||
}
|
||||
setSettingValue(SettingsOptions::SleepTemp, temp);
|
||||
}
|
||||
setSettingValue(SettingsOptions::SleepTemp, temp);
|
||||
}
|
||||
|
||||
static void displaySleepTemp(void) { OLED::printNumber(getSettingValue(SettingsOptions::SleepTemp), 3, FontStyle::LARGE); }
|
||||
@@ -762,12 +759,11 @@ static bool showHallEffect(void) { return getHallSensorFitted(); }
|
||||
static void displayHallEffectSleepTime(void) {
|
||||
if (getSettingValue(SettingsOptions::HallEffectSleepTime)) {
|
||||
OLED::printNumber(getSettingValue(SettingsOptions::HallEffectSleepTime) * 5, 2, FontStyle::LARGE, false);
|
||||
OLED::print(LargeSymbolSeconds, FontStyle::LARGE);
|
||||
} else {
|
||||
// When sleep time is set to zero, we sleep for 1 second anyways. This is the default.
|
||||
OLED::printNumber(1, 2, FontStyle::LARGE, false);
|
||||
OLED::print(LargeSymbolSeconds, FontStyle::LARGE);
|
||||
}
|
||||
OLED::print(LargeSymbolSeconds, FontStyle::LARGE);
|
||||
}
|
||||
#endif /* HALL_SENSOR */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user