mirror of
https://github.com/CovidBraceletPrj/CovidBracelet.git
synced 2025-01-09 12:44:24 +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;
|
lv_style_t red_button_style;
|
||||||
#endif
|
#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() {
|
int get_battery_percentage() {
|
||||||
return 74;
|
return 74;
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,8 @@ int init_display();
|
|||||||
|
|
||||||
int update_display();
|
int update_display();
|
||||||
|
|
||||||
|
void display_thread(void*, void*, void*);
|
||||||
|
|
||||||
int display_set_message(char* msg);
|
int display_set_message(char* msg);
|
||||||
|
|
||||||
int display_set_time(int time);
|
int display_set_time(int time);
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
#include "io.h"
|
#include "io.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
|
|
||||||
|
K_THREAD_STACK_DEFINE(display_stack_area, 500);
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
int err = 0;
|
int err = 0;
|
||||||
printk("Starting Covid Contact Tracer\n");
|
printk("Starting Covid Contact Tracer\n");
|
||||||
@ -74,6 +76,9 @@ void main(void) {
|
|||||||
printk("init display failed (err %d)\n", 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{
|
||||||
do_covid();
|
do_covid();
|
||||||
do_gatt();
|
do_gatt();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user