mirror of
https://github.com/CovidBraceletPrj/CovidBracelet.git
synced 2025-01-08 04:14:25 +01:00
Add thread to handle lvgl events
This commit is contained in:
parent
6b58493305
commit
62f31a3282
@ -27,6 +27,15 @@ lv_style_t yellow_button_style;
|
||||
lv_style_t red_button_style;
|
||||
#endif
|
||||
|
||||
void display_thread(void* arg1, void* arg2, void* arg3) {
|
||||
#ifdef DISPLAY
|
||||
while (1) {
|
||||
lv_task_handler();
|
||||
k_msleep(10);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int get_battery_percentage() {
|
||||
return 74;
|
||||
}
|
||||
|
@ -5,6 +5,8 @@ int init_display();
|
||||
|
||||
int update_display();
|
||||
|
||||
void display_thread(void*, void*, void*);
|
||||
|
||||
int display_set_message(char* msg);
|
||||
|
||||
int display_set_time(int time);
|
||||
|
@ -19,6 +19,8 @@
|
||||
#include "io.h"
|
||||
#include "display.h"
|
||||
|
||||
K_THREAD_STACK_DEFINE(display_stack_area, 500);
|
||||
|
||||
void main(void) {
|
||||
int err = 0;
|
||||
printk("Starting Covid Contact Tracer\n");
|
||||
@ -73,7 +75,10 @@ void main(void) {
|
||||
if (err) {
|
||||
printk("init display failed (err %d)\n", err);
|
||||
}
|
||||
|
||||
|
||||
struct k_thread display_thread_data;
|
||||
k_tid_t display_tid = k_thread_create(&display_thread_data, display_stack_area, K_THREAD_STACK_SIZEOF(display_stack_area), display_thread, NULL, NULL, NULL, 0, 0, K_NO_WAIT);
|
||||
|
||||
do{
|
||||
do_covid();
|
||||
do_gatt();
|
||||
|
Loading…
x
Reference in New Issue
Block a user