@@ -70,15 +70,14 @@ lv_indev_t *lvgl_port_add_encoder(const lvgl_port_encoder_cfg_t *encoder_cfg)
7070 ESP_GOTO_ON_FALSE (encoder_cfg -> encoder_enter , ESP_ERR_INVALID_ARG , err , TAG , "Invalid button handler!" );
7171 encoder_ctx -> btn_handle = encoder_cfg -> encoder_enter ;
7272#endif
73- }
74-
7573#if BUTTON_VER_MAJOR < 4
76- ESP_ERROR_CHECK (iot_button_register_cb (encoder_ctx -> btn_handle , BUTTON_PRESS_DOWN , lvgl_port_encoder_btn_down_handler , encoder_ctx ));
77- ESP_ERROR_CHECK (iot_button_register_cb (encoder_ctx -> btn_handle , BUTTON_PRESS_UP , lvgl_port_encoder_btn_up_handler , encoder_ctx ));
74+ ESP_ERROR_CHECK (iot_button_register_cb (encoder_ctx -> btn_handle , BUTTON_PRESS_DOWN , lvgl_port_encoder_btn_down_handler , encoder_ctx ));
75+ ESP_ERROR_CHECK (iot_button_register_cb (encoder_ctx -> btn_handle , BUTTON_PRESS_UP , lvgl_port_encoder_btn_up_handler , encoder_ctx ));
7876#else
79- ESP_ERROR_CHECK (iot_button_register_cb (encoder_ctx -> btn_handle , BUTTON_PRESS_DOWN , NULL , lvgl_port_encoder_btn_down_handler , encoder_ctx ));
80- ESP_ERROR_CHECK (iot_button_register_cb (encoder_ctx -> btn_handle , BUTTON_PRESS_UP , NULL , lvgl_port_encoder_btn_up_handler , encoder_ctx ));
77+ ESP_ERROR_CHECK (iot_button_register_cb (encoder_ctx -> btn_handle , BUTTON_PRESS_DOWN , NULL , lvgl_port_encoder_btn_down_handler , encoder_ctx ));
78+ ESP_ERROR_CHECK (iot_button_register_cb (encoder_ctx -> btn_handle , BUTTON_PRESS_UP , NULL , lvgl_port_encoder_btn_up_handler , encoder_ctx ));
8179#endif
80+ }
8281
8382 encoder_ctx -> btn_enter = false;
8483 encoder_ctx -> diff = 0 ;
0 commit comments