feat: change display refresh rate to 60
This commit is contained in:
+4
-3
@@ -1,4 +1,4 @@
|
||||
#include <stdio.h>
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
@@ -25,7 +25,7 @@ static const char *TAG = "MICRO_OS";
|
||||
|
||||
#define PIN_LED_USER GPIO_NUM_8
|
||||
#define PIN_BUTTON_BOOT GPIO_NUM_9
|
||||
#define UI_REFRESH_HZ 20
|
||||
#define UI_REFRESH_HZ 60
|
||||
#define UI_FRAME_MS (1000 / UI_REFRESH_HZ)
|
||||
|
||||
/* Task: Onboard LED Heartbeat */
|
||||
@@ -62,6 +62,7 @@ static void on_input_event(input_action_t action, void *user_arg)
|
||||
static void os_ui_task(void *pvParameters)
|
||||
{
|
||||
ESP_LOGI(TAG, "Starting UI compositor loop @ %d FPS", UI_REFRESH_HZ);
|
||||
TickType_t last_wake_time = xTaskGetTickCount();
|
||||
uint32_t last_time_ms = (uint32_t)(esp_timer_get_time() / 1000ULL);
|
||||
|
||||
while (1) {
|
||||
@@ -75,7 +76,7 @@ static void os_ui_task(void *pvParameters)
|
||||
sys_gfx_render_toast_if_active();
|
||||
sys_gfx_flush();
|
||||
|
||||
vTaskDelay(pdMS_TO_TICKS(UI_FRAME_MS));
|
||||
vTaskDelayUntil(&last_wake_time, pdMS_TO_TICKS(UI_FRAME_MS));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user