|
9 | 9 | */ |
10 | 10 |
|
11 | 11 | #define LED_PIN PB6 |
12 | | -#define LVGL_TICK_PERIOD 60 |
13 | 12 |
|
14 | | -//Ticker tick; /* timer for interrupt handler */ |
15 | 13 | TFT_eSPI tft = TFT_eSPI(); /* TFT instance */ |
16 | 14 | static lv_disp_buf_t disp_buf; |
17 | 15 | static lv_color_t buf[LV_HOR_RES_MAX * 10]; |
@@ -89,11 +87,6 @@ bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data) |
89 | 87 | return false; /*Return `false` because we are not buffering and no more data to read*/ |
90 | 88 | } |
91 | 89 |
|
92 | | -/* Interrupt driven periodic handler */ |
93 | | -static void lv_tick_handler(void) |
94 | | -{ |
95 | | - lv_tick_inc(LVGL_TICK_PERIOD); |
96 | | -} |
97 | 90 |
|
98 | 91 | void slider_event_cb(lv_obj_t * slider, lv_event_t event) |
99 | 92 | { |
@@ -189,21 +182,9 @@ void setup() { |
189 | 182 | indev_drv.read_cb = my_touchpad_read; /*Set your driver function*/ |
190 | 183 | lv_indev_drv_register(&indev_drv); /*Finally register the driver*/ |
191 | 184 |
|
192 | | - |
193 | | - /*Initialize the graphics library's tick*/ |
194 | | - ////tick.attach_ms(LVGL_TICK_PERIOD, lv_tick_handler); |
195 | | - |
196 | | - TIM_TypeDef *Instance = TIM2; |
197 | | - // Instantiate HardwareTimer object. Thanks to 'new' instanciation, HardwareTimer is not destructed when setup() function is finished. |
198 | | - HardwareTimer *MyTim = new HardwareTimer(Instance); |
199 | | - //MyTim->setMode(2, TIMER_OUTPUT_COMPARE); |
200 | | - MyTim->setOverflow(LVGL_TICK_PERIOD*1000, MICROSEC_FORMAT); |
201 | | - MyTim->attachInterrupt(lv_tick_handler); |
202 | | - MyTim->resume(); |
203 | | - |
204 | 185 | //Set the theme.. |
205 | | - lv_theme_t * th = lv_theme_night_init(210, NULL); //Set a HUE value and a Font for the Night Theme |
206 | | - lv_theme_set_current(th); |
| 186 | + //lv_theme_t * th = lv_theme_night_init(210, NULL); //Set a HUE value and a Font for the Night Theme |
| 187 | + //lv_theme_set_current(th); |
207 | 188 |
|
208 | 189 | lv_obj_t * scr = lv_cont_create(NULL, NULL); |
209 | 190 | lv_disp_load_scr(scr); |
|
0 commit comments