This shows you the differences between two versions of the page.
|
si:laboratoare:2025:05 [2025/11/02 14:11] 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 154: | 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> | ||