Commit 93e27ee5 authored by Federico Vaga's avatar Federico Vaga

freewatch: add dedicated library for common functions

Signed-off-by: 's avatarFederico Vaga <federico.vaga@gmail.com>
parent 3cd875e9
......@@ -112,6 +112,7 @@ LIBS = -Wl,--start-group -lgcc -lc -lnosys -Wl,--end-group
INCLUDEPATHS += \
-Isrc \
-Isrc/apps \
-Isrc/lib/ \
-IFreeRTOS/Source/include \
-I../bitmaps \
-I../common/CMSIS/Include \
......@@ -206,6 +207,7 @@ FreeRTOS/Source/list.c \
FreeRTOS/Source/croutine.c \
FreeRTOS/Source/portable/MemMang/heap_1.c \
FreeRTOS/Source/portable/GCC/ARM_CM3/port.c \
src/lib/libfwatch.c \
src/apps/settings/set_date.c \
src/apps/settings/set_time.c \
src/apps/settings/settings.c \
......
/*
* Copyright (C) 2014 Julian Lewis
* @author Federico Vaga <federico.vaga@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/gpl-3.0-standalone.html
* or you may search the http://www.gnu.org website for the version 3 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <libfwatch.h>
#if 0
uint8_t fwatch_event_input_handler(struct application *app, struct event *evt)
{
while () {
if (evt->type != cur->type)
continue;
if (cur->callback)
cur->callback(app);
}
}
void fwatch_register_event(application *app, enum event_type type,
uint8_t (*callbacks)(application *app))
{
}
#endif
/**
* It stops running applications by the clearing RUN flag
*/
void fwatch_application_stop(application *app)
{
app->flags &= ~APP_FLAGS_RUN;
}
/*
* Copyright (C) 2014 Julian Lewis
* @author Federico Vaga <federico.vaga@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/gpl-3.0-standalone.html
* or you may search the http://www.gnu.org website for the version 3 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <application.h>
/**
* Callback associated to all input buttons
*/
struct fwatch_events_buttons {
struct application *app;
void (*button1)(struct application *app);
void (*button2)(struct application *app);
void (*button3)(struct application *app);
void (*button4)(struct application *app);
};
struct fwatch_events {
void (*button1)(struct application *app);
};
extern void fwatch_application_register_event(application *app,
struct app_evt_callback *call);
extern void fwatch_application_stop(application *app);
static inline int fwatch_is_application_running(application *app)
{
return app->flags & APP_FLAGS_RUN;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment