Differences

This shows you the differences between two versions of the page.

Link to this comparison view

si:laboratoare:2025:05 [2025/11/02 14:03]
cosmin.chenaru [Exercitii]
si:laboratoare:2025:05 [2025/11/03 19:31] (current)
cosmin.chenaru cb_night_mode_event_handler
Line 118: Line 118:
 === 1. Rulati exemplul oferit ca suport pentru acest laborator pe ceas === === 1. Rulati exemplul oferit ca suport pentru acest laborator pe ceas ===
  
-Folositi config-ul hacktorwatch:​lvgl pentru acest laborator. In acest config aplicatia HacktorWatch (CONFIG_HACKTORWATCH_REV2) este activata in mod implicit. Compilati si incarcati noua imagine pe ceas, si deschideti aplicatia "​hacktorwatch"​ din linie de comanda.+Folositi config-ul hacktorwatch:​lvgl pentru acest laborator. In acest config aplicatia HacktorWatch (CONFIG_HACKTORWATCH_REV2) este activata in mod implicit. Compilati ​{{:​si:​laboratoare:​2025:​hacktorwatch_main.c.txt|suportul de laborator}} ​si incarcati noua imagine pe ceas, iar apoi deschideti aplicatia "​hacktorwatch"​ din linie de comanda. 
 + 
 +<​code>​ 
 +/​tools/​configure.sh -l hacktorwatch:​lvgl 
 +cp ~/​Downloads/​hacktorwatch_main.c.txt nuttx-apps/​hacktorwatch-rev2/​main/​hacktorwatch_main.c 
 +cd nuttx 
 +make flash ESPTOOL_PORT=/​dev/​ttyACM0 ESPTOOL_BAUD=115200 ESPTOOL_BINDIR=../​esp32s3-bins -j$(nproc) 
 +</​code>​
  
 === 2. Activati driver-ul de touchscreen CST816S === === 2. Activati driver-ul de touchscreen CST816S ===
Line 127: Line 134:
  
   * Activati LV_USE_NUTTX_TOUCHSCREEN pentru ca LVGL sa fie compilat cu suport de touchscreen   * Activati LV_USE_NUTTX_TOUCHSCREEN pentru ca LVGL sa fie compilat cu suport de touchscreen
 +
 +  * Din cauza unui bug, codul de touchscreen din LVGL citeste in continuu date de la driver-ul de touchscreen. Aplicati urmatoarea modificare in fisierul nuttx-apps/​graphics/​lvgl/​lvgl/​src/​drivers/​nuttx/​lv_nuttx_touchscreen.c. Prin aceasta modificare, vom lasa codul de LVGL sa opreasca procesarea in momentul cand degetul este luat de pe touchscreen. <​code>​
 +--- ./​graphics/​lvgl/​lvgl/​src/​drivers/​nuttx/​lv_nuttx_touchscreen.c ​   2024-10-24 21:​45:​11.000000000 +0300
 ++++ ./​graphics/​lvgl/​lvgl/​src/​drivers/​nuttx/​lv_nuttx_touchscreen.c ​      ​2025-08-10 20:​04:​58.486933763 +0300
 +@@ -146,7 +146,11 @@
 +         /* Save last sample and let lvgl continue reading */
 +         ​touchscreen->​last_sample = sample;
 +         ​touchscreen->​has_last_sample = true;
 +-        data->​continue_reading = true;
 ++
 ++        if (sample.point[0].flags & TOUCH_DOWN)
 ++            data->​continue_reading = true;
 ++        else
 ++            data->​continue_reading = false;
 +     }
 +     else {
 +         /* No more sample available, clear last sample flag */
 +</​code>​
 +
  
 === 3. Activati optiunea "Night Mode" === === 3. Activati optiunea "Night Mode" ===
Line 135: Line 161:
     lv_obj_add_state(cb_night_mode,​ 0);     lv_obj_add_state(cb_night_mode,​ 0);
     lv_obj_align(cb_night_mode,​ LV_ALIGN_LEFT_MID,​ 0, -30);     lv_obj_align(cb_night_mode,​ LV_ALIGN_LEFT_MID,​ 0, -30);
-+   ​lv_obj_add_event_cb(cb_night_mode, ​NULL, LV_EVENT_ALL,​ NULL);++   ​lv_obj_add_event_cb(cb_night_mode, ​cb_night_mode_event_handler, LV_EVENT_ALL,​ NULL);
 </​code>​ </​code>​
  
si/laboratoare/2025/05.1762085027.txt.gz · Last modified: 2025/11/02 14:03 by cosmin.chenaru
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0