Skip to content
This repository was archived by the owner on Dec 4, 2020. It is now read-only.

Commit 8620db9

Browse files
authored
Merge pull request #53 from HamidSaffari/patch-2
Removed Hardware-Timer interrupt LV-Tick because of using (millis()) …
2 parents d8d1fe0 + f8d9359 commit 8620db9

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

examples/STM32_TFT_eSPI_Slider/STM32_TFT_eSPI_Slider.ino

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
*/
1010

1111
#define LED_PIN PB6
12-
#define LVGL_TICK_PERIOD 60
1312

14-
//Ticker tick; /* timer for interrupt handler */
1513
TFT_eSPI tft = TFT_eSPI(); /* TFT instance */
1614
static lv_disp_buf_t disp_buf;
1715
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)
8987
return false; /*Return `false` because we are not buffering and no more data to read*/
9088
}
9189

92-
/* Interrupt driven periodic handler */
93-
static void lv_tick_handler(void)
94-
{
95-
lv_tick_inc(LVGL_TICK_PERIOD);
96-
}
9790

9891
void slider_event_cb(lv_obj_t * slider, lv_event_t event)
9992
{
@@ -189,21 +182,9 @@ void setup() {
189182
indev_drv.read_cb = my_touchpad_read; /*Set your driver function*/
190183
lv_indev_drv_register(&indev_drv); /*Finally register the driver*/
191184

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-
204185
//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);
207188

208189
lv_obj_t * scr = lv_cont_create(NULL, NULL);
209190
lv_disp_load_scr(scr);

0 commit comments

Comments
 (0)