Performance tuning

This commit is contained in:
fvanroie 2021-05-23 22:55:54 +02:00
parent 3991647597
commit e85804b2cc
2 changed files with 5 additions and 5 deletions

View File

@ -104,14 +104,14 @@ lv_font_t* hasp_get_font(uint8_t fontid)
*/
HASP_ATTRIBUTE_FAST_MEM void hasp_update_sleep_state()
{
uint32_t idle = lv_disp_get_inactive_time(lv_disp_get_default());
uint32_t idle = lv_disp_get_inactive_time(lv_disp_get_default()) / 1000;
if(sleepTimeLong > 0 && idle >= (sleepTimeShort + sleepTimeLong) * 1000U) {
if(sleepTimeLong > 0 && idle >= (sleepTimeShort + sleepTimeLong)) {
if(hasp_sleep_state != HASP_SLEEP_LONG) {
hasp_sleep_state = HASP_SLEEP_LONG;
dispatch_idle(NULL, NULL);
}
} else if(sleepTimeShort > 0 && idle >= sleepTimeShort * 1000U) {
} else if(sleepTimeShort > 0 && idle >= sleepTimeShort) {
if(hasp_sleep_state != HASP_SLEEP_SHORT) {
hasp_sleep_state = HASP_SLEEP_SHORT;
dispatch_idle(NULL, NULL);

View File

@ -311,9 +311,9 @@ IRAM_ATTR void telnetLoop()
if(telnetClient.connected()) {
if(telnetConsole) {
while(telnetConsole->readKey()) {
if(!telnetConsole) return; // the telnetConsole was destroyed
if(!telnetConsole) return; // the telnetConsole was destroyed
if(bufferedTelnetClient.peek() < 0) bufferedTelnetClient.flush(); // flush pending updates
};
bufferedTelnetClient.flush(); // flush pending updates
} else {
telnetConsole = new ConsoleInput(&bufferedTelnetClient, HASP_CONSOLE_BUFFER);