diff --git a/include/mongoose-touch.h b/include/mongoose-touch.h new file mode 100644 index 0000000..584bbe6 --- /dev/null +++ b/include/mongoose-touch.h @@ -0,0 +1,18 @@ +#ifndef __MONGOOSE_TOUCH_H +#define __MONGOOSE_TOUCH_H + +#include "widget.h" + +void widget_time_ev(int ev, struct widget_t *w, void *ev_data); + +void widget_wifi_ev(int ev, struct widget_t *w, void *ev_data); + +void widget_network_ev(int ev, struct widget_t *w, void *ev_data); +void widget_network_send(); +void widget_network_recv(); + +void widget_topbar_ev(int ev, struct widget_t *w, void *ev_data); + +void widget_name_ev(int ev, struct widget_t *w, void *ev_data); + +#endif // __MONGOOSE_TOUCH_H diff --git a/include/widget.h b/include/widget.h index 6a60356..9352e01 100644 --- a/include/widget.h +++ b/include/widget.h @@ -30,16 +30,4 @@ struct widget_t *widget_add_from_file(const char *fn, uint32_t timer_msec, widge struct widget_t *widget_find(uint16_t x, uint16_t y); void widget_remove(struct widget_t *widget); -void widget_time_ev(int ev, struct widget_t *w, void *ev_data); - -void widget_wifi_ev(int ev, struct widget_t *w, void *ev_data); - -void widget_network_ev(int ev, struct widget_t *w, void *ev_data); -void widget_network_send(); -void widget_network_recv(); - -void widget_topbar_ev(int ev, struct widget_t *w, void *ev_data); - -void widget_name_ev(int ev, struct widget_t *w, void *ev_data); - #endif // __WIDGET_H diff --git a/src/main.c b/src/main.c index fdceba3..0df7410 100644 --- a/src/main.c +++ b/src/main.c @@ -4,7 +4,7 @@ #include "mgos.h" #include "tft.h" #include "stmpe610.h" -#include "widget.h" +#include "mongoose-touch.h" static long map(long x, long in_min, long in_max, long out_min, long out_max) { return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; diff --git a/src/widget_name.c b/src/widget_name.c index 2e4c40d..b0fdc51 100644 --- a/src/widget_name.c +++ b/src/widget_name.c @@ -3,7 +3,7 @@ #include "mgos_wifi.h" #include "mgos_net.h" #include "tft.h" -#include "widget.h" +#include "mongoose-touch.h" #define WIDGET_NAME_NAME 0 #define WIDGET_NAME_IPADDR 1 diff --git a/src/widget_network.c b/src/widget_network.c index 5950147..bec51fb 100644 --- a/src/widget_network.c +++ b/src/widget_network.c @@ -1,7 +1,7 @@ #include "mgos.h" #include "mgos_timers.h" #include "tft.h" -#include "widget.h" +#include "mongoose-touch.h" static mgos_timer_id send_timer = 0; static mgos_timer_id recv_timer = 0; diff --git a/src/widget_time.c b/src/widget_time.c index 3be6737..695165a 100644 --- a/src/widget_time.c +++ b/src/widget_time.c @@ -1,6 +1,6 @@ #include "mgos.h" #include "tft.h" -#include "widget.h" +#include "mongoose-touch.h" static void widget_time_render(struct widget_t *w, void *ev_data) { char tmp_buff[32]; diff --git a/src/widget_topbar.c b/src/widget_topbar.c index 739a133..8458456 100644 --- a/src/widget_topbar.c +++ b/src/widget_topbar.c @@ -1,6 +1,6 @@ #include "mgos.h" #include "tft.h" -#include "widget.h" +#include "mongoose-touch.h" static void widget_topbar_render(struct widget_t *w, void *ev_data) { if (!w) diff --git a/src/widget_wifi.c b/src/widget_wifi.c index c86e667..891f339 100644 --- a/src/widget_wifi.c +++ b/src/widget_wifi.c @@ -1,6 +1,6 @@ #include "mgos.h" #include "tft.h" -#include "widget.h" +#include "mongoose-touch.h" #include static long map(long x, long in_min, long in_max, long out_min, long out_max)