Various fixes and improvements (#269)

- Bump version for next release
- Fix default gamma for CYD 2432S032C
- Remember gamma curve setting from Display settings app
- Add UART to Core2 (still has no voltage on Grove port, though)
- LVGL performance improvements: pin to second core and set task priority to "critical"
- Fix build warnings, including deprecations
- Removed deprecated `Thread` constructor
- Fix WaveShare S3 display: Some displays would show a white screen at 12MHz, so I'm putting it back to the
official config values.
This commit is contained in:
Ken Van Hoeylandt
2025-04-01 23:42:56 +02:00
committed by GitHub
parent eb4e9f9649
commit 08029a84dd
30 changed files with 203 additions and 145 deletions
@@ -6,19 +6,21 @@ namespace tt::app::display {
tt::Preferences preferences("display");
#define BACKLIGHT_DUTY_KEY "backlight_duty"
#define ROTATION_KEY "rotation"
constexpr const char* BACKLIGHT_DUTY_KEY = "backlight_duty";
constexpr const char* GAMMA_CURVE_KEY = "gamma";
constexpr const char* ROTATION_KEY = "rotation";
void setBacklightDuty(uint8_t value) {
preferences.putInt32(BACKLIGHT_DUTY_KEY, (int32_t)value);
}
uint8_t getBacklightDuty() {
bool getBacklightDuty(uint8_t& duty) {
int32_t result;
if (preferences.optInt32(BACKLIGHT_DUTY_KEY, result)) {
return (uint8_t)(result % 256);
duty = (uint8_t)(result % 256);
return true;
} else {
return 200;
return false;
}
}
@@ -35,4 +37,18 @@ lv_display_rotation_t getRotation() {
}
}
void setGammaCurve(uint8_t curveIndex) {
preferences.putInt32(GAMMA_CURVE_KEY, (int32_t)curveIndex);
}
bool getGammaCurve(uint8_t& curveIndex) {
int32_t result;
if (preferences.optInt32(GAMMA_CURVE_KEY, result)) {
curveIndex = (uint8_t)(result % 256);
return true;
} else {
return false;
}
}
} // namespace