Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
fwatch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
fwatch
Commits
93e27ee5
Commit
93e27ee5
authored
May 23, 2015
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
freewatch: add dedicated library for common functions
Signed-off-by:
Federico Vaga
<
federico.vaga@gmail.com
>
parent
3cd875e9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
0 deletions
+99
-0
Makefile
sw/freewatch/Makefile
+2
-0
libfwatch.c
sw/freewatch/src/lib/libfwatch.c
+50
-0
libfwatch.h
sw/freewatch/src/lib/libfwatch.h
+47
-0
No files found.
sw/freewatch/Makefile
View file @
93e27ee5
...
...
@@ -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
\
...
...
sw/freewatch/src/lib/libfwatch.c
0 → 100644
View file @
93e27ee5
/*
* 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
;
}
sw/freewatch/src/lib/libfwatch.h
0 → 100644
View file @
93e27ee5
/*
* 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
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment