mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Merge branch 'dev' into dev
This commit is contained in:
@@ -104,6 +104,7 @@ static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOp
|
||||
{ MIN_TEMP_C, MAX_TEMP_F, 5, 90}, // ProfilePhase5Temp
|
||||
{ 10, 180, 5, 30}, // ProfilePhase5Duration
|
||||
{ 1, 10, 1, 2}, // ProfileCooldownSpeed
|
||||
{ 0, 12, 1, 0}, // HallEffectSleepTime
|
||||
};
|
||||
static_assert((sizeof(settingsConstants) / sizeof(SettingConstants)) == ((int)SettingsOptions::SettingsOptionsLength));
|
||||
|
||||
|
||||
@@ -111,6 +111,7 @@ static void displayLogoTime(void);
|
||||
|
||||
#ifdef HALL_SENSOR
|
||||
static void displayHallEffect(void);
|
||||
static void displayHallEffectSleepTime(void);
|
||||
static bool showHallEffect(void);
|
||||
#endif /* HALL_SENSOR */
|
||||
|
||||
@@ -162,6 +163,7 @@ static void displayAdvancedMenu(void);
|
||||
* -Sleep Time
|
||||
* -Shutdown Time
|
||||
* Hall Sensor Sensitivity
|
||||
* Hall Sensor Sleep Time
|
||||
*
|
||||
* UI
|
||||
* Temperature Unit
|
||||
@@ -346,6 +348,8 @@ const menuitem PowerSavingMenu[] = {
|
||||
#ifdef HALL_SENSOR
|
||||
/* Hall Effect Sensitivity */
|
||||
{SETTINGS_DESC(SettingsItemIndex::HallEffSensitivity), nullptr, displayHallEffect, showHallEffect, SettingsOptions::HallEffectSensitivity, SettingsItemIndex::HallEffSensitivity, 7},
|
||||
/* Hall Effect Sleep Time */
|
||||
{SETTINGS_DESC(SettingsItemIndex::HallEffSleepTimeout), nullptr, displayHallEffectSleepTime, showHallEffect, SettingsOptions::HallEffectSleepTime, SettingsItemIndex::HallEffSleepTimeout, 5},
|
||||
#endif /* HALL_SENSOR */
|
||||
/* vvvv end of menu marker. DO NOT REMOVE vvvv */
|
||||
{0, nullptr, nullptr, nullptr, SettingsOptions::SettingsOptionsLength, SettingsItemIndex::NUM_ITEMS, 0}
|
||||
@@ -740,6 +744,16 @@ static void displayHallEffect(void) {
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
#endif /* HALL_SENSOR */
|
||||
|
||||
static void setTempF(const enum SettingsOptions option) {
|
||||
|
||||
@@ -11,4 +11,14 @@
|
||||
/* Functions */
|
||||
void initialise_monitor_handles() {}
|
||||
|
||||
/* Syscalls (stub implementations to avoid compile warnings and possibe future problems) */
|
||||
int _getpid(void) { return 1; }
|
||||
|
||||
#if defined(MODEL_Pinecil) || defined(MODEL_Pinecilv2)
|
||||
// do nothing here because some stubs and real implementations added for Pinecils already
|
||||
#else
|
||||
off_t _lseek(int fd, off_t ptr, int dir) { return -1; }
|
||||
ssize_t _read(int fd, void *ptr, size_t len) { return -1; }
|
||||
ssize_t _write(int fd, const void *ptr, size_t len) { return -1; }
|
||||
int _close(int fd) { return -1; }
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user