mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-27 05:06:44 +00:00
Performance tuning
This commit is contained in:
parent
3991647597
commit
e85804b2cc
@ -104,14 +104,14 @@ lv_font_t* hasp_get_font(uint8_t fontid)
|
|||||||
*/
|
*/
|
||||||
HASP_ATTRIBUTE_FAST_MEM void hasp_update_sleep_state()
|
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) {
|
if(hasp_sleep_state != HASP_SLEEP_LONG) {
|
||||||
hasp_sleep_state = HASP_SLEEP_LONG;
|
hasp_sleep_state = HASP_SLEEP_LONG;
|
||||||
dispatch_idle(NULL, NULL);
|
dispatch_idle(NULL, NULL);
|
||||||
}
|
}
|
||||||
} else if(sleepTimeShort > 0 && idle >= sleepTimeShort * 1000U) {
|
} else if(sleepTimeShort > 0 && idle >= sleepTimeShort) {
|
||||||
if(hasp_sleep_state != HASP_SLEEP_SHORT) {
|
if(hasp_sleep_state != HASP_SLEEP_SHORT) {
|
||||||
hasp_sleep_state = HASP_SLEEP_SHORT;
|
hasp_sleep_state = HASP_SLEEP_SHORT;
|
||||||
dispatch_idle(NULL, NULL);
|
dispatch_idle(NULL, NULL);
|
||||||
|
@ -311,9 +311,9 @@ IRAM_ATTR void telnetLoop()
|
|||||||
if(telnetClient.connected()) {
|
if(telnetClient.connected()) {
|
||||||
if(telnetConsole) {
|
if(telnetConsole) {
|
||||||
while(telnetConsole->readKey()) {
|
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 {
|
} else {
|
||||||
telnetConsole = new ConsoleInput(&bufferedTelnetClient, HASP_CONSOLE_BUFFER);
|
telnetConsole = new ConsoleInput(&bufferedTelnetClient, HASP_CONSOLE_BUFFER);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user