Fix compile issue (#88)
This commit is contained in:
@ -15,8 +15,8 @@ if (NOT ("$ENV{VALGRIND}" STREQUAL "YES"))
|
||||
add_definitions(-DNVALGRIND)
|
||||
endif ()
|
||||
|
||||
# Currently build as 32-bit by default.
|
||||
set (BUILD_AS_64BIT_SUPPORT "NO")
|
||||
# Currently build as 64-bit by default.
|
||||
set (BUILD_AS_64BIT_SUPPORT "YES")
|
||||
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
if (${BUILD_AS_64BIT_SUPPORT} STREQUAL "YES")
|
||||
|
||||
@ -29,7 +29,7 @@ lv_obj_t *hello_world_label;
|
||||
lv_obj_t *count_label;
|
||||
lv_obj_t *btn1;
|
||||
lv_obj_t *label_count1;
|
||||
int label_count1_value = 0;
|
||||
int label_count1_value = 100;
|
||||
char label_count1_str[11] = { 0 };
|
||||
|
||||
void timer1_update(user_timer_t timer1)
|
||||
@ -60,10 +60,10 @@ void on_init()
|
||||
|
||||
/*Create a label on the button*/
|
||||
lv_obj_t *btn_label = lv_label_create(btn1, NULL);
|
||||
lv_label_set_text(btn_label, "Click ++");
|
||||
lv_label_set_text(btn_label, "Click --");
|
||||
|
||||
label_count1 = lv_label_create(NULL, NULL);
|
||||
lv_label_set_text(label_count1, "0");
|
||||
lv_label_set_text(label_count1, "100");
|
||||
lv_obj_align(label_count1, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
|
||||
|
||||
/* set up a timer */
|
||||
@ -75,8 +75,10 @@ void on_init()
|
||||
static void btn_event_cb(lv_obj_t *btn, lv_event_t event)
|
||||
{
|
||||
if(event == LV_EVENT_RELEASED) {
|
||||
label_count1_value++;
|
||||
label_count1_value--;
|
||||
sprintf(label_count1_str, "%d", label_count1_value);
|
||||
lv_label_set_text(label_count1, label_count1_str);
|
||||
if (label_count1_value == 0)
|
||||
label_count1_value = 100;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user