Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions lv_tc_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
#include "lv_tc_screen.h"

#include "math.h"
#include <string.h>

#include "lv_tc.h"
#include "lv_tc_config.h"

#ifdef ESP_PLATFORM
#include "esp_log.h"
#endif

/*********************
* DEFINES
Expand Down Expand Up @@ -53,6 +57,7 @@ const lv_obj_class_t lv_tc_screen_class = {
.base_class = &lv_obj_class
};

static const char *TAG = "lv_tc_screen";

/**********************
* GLOBAL FUNCTIONS
Expand All @@ -78,7 +83,7 @@ void lv_tc_screen_start_with_config(lv_obj_t* screenObj, lv_tc_start_delay_t sta
lv_tc_screen_t *tCScreenObj = (lv_tc_screen_t*)screenObj;

if(tCScreenObj->recalibrateTimer) {
lv_timer_del(tCScreenObj->recalibrateTimer);
lv_timer_delete(tCScreenObj->recalibrateTimer);
tCScreenObj->recalibrateTimer = NULL;
}

Expand Down Expand Up @@ -118,6 +123,7 @@ static void lv_tc_screen_constructor(const lv_obj_class_t *class_p, lv_obj_t *ob
LV_UNUSED(class_p);
lv_tc_screen_t *tCScreenObj = (lv_tc_screen_t*)obj;

tCScreenObj->screenObj = *obj;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the issue is fixed with this line

tCScreenObj->inputEnabled = true;
tCScreenObj->startDelayTimer = NULL;
tCScreenObj->recalibrateTimer = NULL;
Expand Down Expand Up @@ -157,7 +163,7 @@ static void lv_tc_screen_constructor(const lv_obj_class_t *class_p, lv_obj_t *ob
lv_obj_center(recalibrateBtnLabelObj);


tCScreenObj->acceptBtnObj = lv_btn_create(obj);
tCScreenObj->acceptBtnObj = lv_button_create(obj);
lv_obj_set_size(tCScreenObj->acceptBtnObj, lv_pct(35), LV_SIZE_CONTENT);
lv_obj_add_event_cb(tCScreenObj->acceptBtnObj, lv_tc_screen_accept_btn_click_cb, LV_EVENT_CLICKED, obj);

Expand Down Expand Up @@ -251,8 +257,8 @@ static void lv_tc_screen_finish(lv_obj_t *screenObj) {

//Update the UI
lv_label_set_text_static(tCScreenObj->msgLabelObj, LV_TC_READY_MSG);
lv_obj_clear_flag(tCScreenObj->recalibrateBtnObj, LV_OBJ_FLAG_HIDDEN);
lv_obj_clear_flag(tCScreenObj->acceptBtnObj, LV_OBJ_FLAG_HIDDEN);
lv_obj_remove_flag(tCScreenObj->recalibrateBtnObj, LV_OBJ_FLAG_HIDDEN);
lv_obj_remove_flag(tCScreenObj->acceptBtnObj, LV_OBJ_FLAG_HIDDEN);

lv_obj_align(tCScreenObj->msgLabelObj, LV_ALIGN_CENTER, 0, -50);
lv_obj_align_to(tCScreenObj->recalibrateBtnObj, tCScreenObj->msgLabelObj, LV_ALIGN_OUT_BOTTOM_MID, 0, 20);
Expand All @@ -277,7 +283,7 @@ static void lv_tc_screen_ready(lv_obj_t *screenObj) {
lv_tc_save_coeff();

if(tCScreenObj->recalibrateTimer) {
lv_timer_del(tCScreenObj->recalibrateTimer);
lv_timer_delete(tCScreenObj->recalibrateTimer);
tCScreenObj->recalibrateTimer = NULL;
}

Expand Down
5 changes: 4 additions & 1 deletion lv_tc_screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ extern "C" {
#include "stdbool.h"

#include "lvgl.h"
#if LVGL_VERSION_MAJOR == 9 && LVGL_VERSION_MINOR >= 2
#include "lvgl_private.h" // include needed due breaking changes describe on release notes of LVGL 9.2.0
#endif


/**********************
Expand Down Expand Up @@ -77,4 +80,4 @@ void lv_tc_screen_start_with_config(lv_obj_t *screenObj, lv_tc_start_delay_t sta

#ifdef __cplusplus
}
#endif
#endif