diff --git a/src/lvgl_win_sim/lv_port_win_codeblocks/LittlevGL.layout b/src/lvgl_win_sim/lv_port_win_codeblocks/LittlevGL.layout index 15b6f74..60bf636 100644 --- a/src/lvgl_win_sim/lv_port_win_codeblocks/LittlevGL.layout +++ b/src/lvgl_win_sim/lv_port_win_codeblocks/LittlevGL.layout @@ -2,152 +2,9 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -155,14 +12,9 @@ - + - - - - - - + @@ -170,115 +22,44 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -286,54 +67,30 @@ - + - + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -341,29 +98,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -375,9 +242,55 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -385,19 +298,9 @@ - + - - - - - - - - - - - + @@ -405,9 +308,59 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -415,14 +368,84 @@ - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/lvgl_win_sim/lv_port_win_codeblocks/altimeter_screen.h b/src/lvgl_win_sim/lv_port_win_codeblocks/altimeter_screen.h index c560192..ce6e373 100644 --- a/src/lvgl_win_sim/lv_port_win_codeblocks/altimeter_screen.h +++ b/src/lvgl_win_sim/lv_port_win_codeblocks/altimeter_screen.h @@ -23,9 +23,14 @@ typedef struct MinMaxValue char value_unit_text[20]; } MinMaxValue_t; +typedef void(*MeasurementCb_t)(float * const temperature, float * const pressure, float * const altitude); + typedef struct AltimeterScreen { + MeasurementCb_t measurementCb; + lv_obj_t *display; + lv_timer_t *measurementUpdateTimer; MainValue_t mainValue; MinMaxValue_t minValue; MinMaxValue_t maxValue; @@ -37,6 +42,8 @@ void altimeter_screen_init(AltimeterScreen_t * const altimeterScreen); void altimeter_screen_create(AltimeterScreen_t * const altimeterScreen); +void altimeter_screen_register_measurement_cb(AltimeterScreen_t * const altimeterScreen, MeasurementCb_t MeasurementCb); + void altimeter_screen_destroy(AltimeterScreen_t * const altimeterScreen); #endif //ALTIMETER_SCREEN_H diff --git a/src/lvgl_win_sim/lv_port_win_codeblocks/main.c b/src/lvgl_win_sim/lv_port_win_codeblocks/main.c index 4f1613b..17826ea 100644 --- a/src/lvgl_win_sim/lv_port_win_codeblocks/main.c +++ b/src/lvgl_win_sim/lv_port_win_codeblocks/main.c @@ -88,7 +88,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLi compass_screen_init(&compassScreen); settings_screen_init(&settingsScreen); - watch_face_register_cb(&watchFace, &(date_time_cb)); + watch_face_register_date_time_cb(&watchFace, &(date_time_cb)); watch_face_create(&watchFace); lv_scr_load(watchFace.display); diff --git a/src/lvgl_win_sim/lv_port_win_codeblocks/watch_face.c b/src/lvgl_win_sim/lv_port_win_codeblocks/watch_face.c index be57ba4..99ccb08 100644 --- a/src/lvgl_win_sim/lv_port_win_codeblocks/watch_face.c +++ b/src/lvgl_win_sim/lv_port_win_codeblocks/watch_face.c @@ -106,7 +106,7 @@ void watch_face_init(WatchFace_t * const watchFace) memset(watchFace, 0, sizeof(WatchFace_t)); } -void watch_face_register_cb(WatchFace_t * const watchFace, DateTimeCb_t dateTimeCb) +void watch_face_register_date_time_cb(WatchFace_t * const watchFace, DateTimeCb_t dateTimeCb) { if(!watchFace) { diff --git a/src/lvgl_win_sim/lv_port_win_codeblocks/watch_face.h b/src/lvgl_win_sim/lv_port_win_codeblocks/watch_face.h index ea1c599..8693a7d 100644 --- a/src/lvgl_win_sim/lv_port_win_codeblocks/watch_face.h +++ b/src/lvgl_win_sim/lv_port_win_codeblocks/watch_face.h @@ -47,7 +47,7 @@ typedef struct WatchFace void watch_face_init(WatchFace_t * const watchFace); /* Registers a call back function to retrieve the time and date */ -void watch_face_register_cb(WatchFace_t * const watchFace, DateTimeCb_t DateTimeCb); +void watch_face_register_date_time_cb(WatchFace_t * const watchFace, DateTimeCb_t DateTimeCb); /* Builds the watch face graphically */ void watch_face_create(WatchFace_t * const watchFace);