Style: fix some lines and whitespace
parent
ff9c2a22f1
commit
d1ac219547
|
|
@ -181,8 +181,7 @@ static void control_event_handler(void* arg) {
|
||||||
uint8_t current_state = gpio_get_level(gpio_num);
|
uint8_t current_state = gpio_get_level(gpio_num);
|
||||||
if (xQueueReceive(control_event_queue, &gpio_num, portMAX_DELAY)) {
|
if (xQueueReceive(control_event_queue, &gpio_num, portMAX_DELAY)) {
|
||||||
/* Check if interrupt triggered stays the same for long enough */
|
/* Check if interrupt triggered stays the same for long enough */
|
||||||
if ((current_state == last_btn_state) &&
|
if ((current_state == last_btn_state) && (xTaskGetTickCount() - last_debounce_time > DEBOUNCE_TIMEOUT)) {
|
||||||
(xTaskGetTickCount() - last_debounce_time > DEBOUNCE_TIMEOUT)) {
|
|
||||||
ESP_LOGI(TAG, "Handling control from GPIO %" PRIu32, gpio_num);
|
ESP_LOGI(TAG, "Handling control from GPIO %" PRIu32, gpio_num);
|
||||||
switch (gpio_num) {
|
switch (gpio_num) {
|
||||||
case GPIO_MUTATE_BTN:
|
case GPIO_MUTATE_BTN:
|
||||||
|
|
@ -261,7 +260,9 @@ static void gpio_init(void) {
|
||||||
ESP_ERROR_CHECK(gptimer_set_alarm_action(gate_timer, &cv_off_alarm_config));
|
ESP_ERROR_CHECK(gptimer_set_alarm_action(gate_timer, &cv_off_alarm_config));
|
||||||
|
|
||||||
/* Register gate timer callback */
|
/* Register gate timer callback */
|
||||||
gptimer_event_callbacks_t clk_cbs = {.on_alarm = gate_off_alarm_cb};
|
gptimer_event_callbacks_t clk_cbs = {
|
||||||
|
.on_alarm = gate_off_alarm_cb
|
||||||
|
};
|
||||||
ESP_ERROR_CHECK(gptimer_register_event_callbacks(gate_timer, &clk_cbs, NULL));
|
ESP_ERROR_CHECK(gptimer_register_event_callbacks(gate_timer, &clk_cbs, NULL));
|
||||||
ESP_ERROR_CHECK(gptimer_enable(gate_timer));
|
ESP_ERROR_CHECK(gptimer_enable(gate_timer));
|
||||||
}
|
}
|
||||||
|
|
@ -386,10 +387,8 @@ static void display_init(void) {
|
||||||
lv_init();
|
lv_init();
|
||||||
|
|
||||||
/* Allocate draw buffers */
|
/* Allocate draw buffers */
|
||||||
lv_color_t *buf1 =
|
lv_color_t *buf1 = heap_caps_malloc(LCD_H_RES * 80 * sizeof(lv_color_t), MALLOC_CAP_DMA);
|
||||||
heap_caps_malloc(LCD_H_RES * 80 * sizeof(lv_color_t), MALLOC_CAP_DMA);
|
lv_color_t *buf2 = heap_caps_malloc(LCD_H_RES * 80 * sizeof(lv_color_t), MALLOC_CAP_DMA);
|
||||||
lv_color_t *buf2 =
|
|
||||||
heap_caps_malloc(LCD_H_RES * 80 * sizeof(lv_color_t), MALLOC_CAP_DMA);
|
|
||||||
/* Initialize draw buffers */
|
/* Initialize draw buffers */
|
||||||
static lv_disp_draw_buf_t disp_buf;
|
static lv_disp_draw_buf_t disp_buf;
|
||||||
lv_disp_draw_buf_init(&disp_buf, buf1, buf2, LCD_H_RES * 80);
|
lv_disp_draw_buf_init(&disp_buf, buf1, buf2, LCD_H_RES * 80);
|
||||||
|
|
@ -484,6 +483,7 @@ void app_main(void) {
|
||||||
/* Initialize GPIO */
|
/* Initialize GPIO */
|
||||||
gpio_init();
|
gpio_init();
|
||||||
controls_init();
|
controls_init();
|
||||||
|
|
||||||
/* Initialize LCD */
|
/* Initialize LCD */
|
||||||
display_init();
|
display_init();
|
||||||
gui_create();
|
gui_create();
|
||||||
|
|
|
||||||
Reference in New Issue