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
4c180105
Commit
4c180105
authored
Sep 01, 2014
by
Theodor-Adrian Stana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Reset app
parent
81a14026
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
2 deletions
+84
-2
Makefile
sw/freertos/Makefile
+2
-1
app_list.h
sw/freertos/src/apps/app_list.h
+1
-0
menu_struct.c
sw/freertos/src/apps/menu_struct.c
+1
-1
reset.c
sw/freertos/src/apps/reset.c
+80
-0
No files found.
sw/freertos/Makefile
View file @
4c180105
...
...
@@ -105,7 +105,7 @@ override ASMFLAGS += -x assembler-with-cpp -D$(DEVICE) -Wall -Wextra -mcpu=corte
# NOTE: The -Wl,--gc-sections flag may interfere with debugging using gdb.
#
override
LDFLAGS
+=
-Xlinker -Map=
$(LST_DIR)
/
$(PROJECTNAME)
.map -mcpu=cortex-m3
\
-mthumb -T../common/Device/EnergyMicro/EFM32GG/Source/GCC/efm32gg
_bootld
.ld
\
-mthumb -T../common/Device/EnergyMicro/EFM32GG/Source/GCC/efm32gg.ld
\
-Wl,--gc-sections
LIBS
=
-Wl,--start-group -lgcc -lc -lnosys -Wl,--end-group
...
...
@@ -189,6 +189,7 @@ src/low_power_tick_management.c \
../common/drivers/gps/nmealib/src/tok.c
\
../common/drivers/gps/gps.c
\
src/apps/gpscoord.c
\
src/apps/reset.c
\
../common/drivers/usb/usbdbg.c
\
../common/drivers/usb/src/em_usbd.c
\
../common/drivers/usb/src/em_usbdch9.c
\
...
...
sw/freertos/src/apps/app_list.h
View file @
4c180105
...
...
@@ -33,6 +33,7 @@ extern application menu;
extern
application
clock
;
extern
application
example
;
extern
application
gpscoord
;
extern
application
reset
;
#endif
/* APP_LIST_H */
sw/freertos/src/apps/menu_struct.c
View file @
4c180105
...
...
@@ -54,7 +54,7 @@ menu_list main_menu = {
{
APP
,
&
gps_receiving
,
{
.
app
=
&
gpscoord
}
},
{
APP
,
&
battery_charging
,
{
.
app
=
&
clock
}
},
{
SUBMENU
,
NULL
,
{
.
submenu
=
&
sub_menu
}
},
{
APP
,
&
battery
,
{
.
app
=
&
clock
}
},
{
APP
,
NULL
,
{
.
app
=
&
reset
}
},
{
APP
,
NULL
,
{
.
app
=
&
clock
}
},
{
APP
,
&
gps_disconnected
,
{
.
app
=
&
clock
}
},
{
APP
,
NULL
,
{
.
app
=
&
clock
}
},
...
...
sw/freertos/src/apps/reset.c
0 → 100644
View file @
4c180105
/*
* Copyright (C) 2014 Julian Lewis
* @author Theodor Stana <theodor.stana@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 2
* 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/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <em_device.h>
#include <event.h>
#include <drivers/lcd.h>
#include <gfx/graphics.h>
#include <gfx/ui.h>
#include "widgets/status_bar.h"
#include "application.h"
static
void
reset_redraw
(
struct
ui_widget
*
w
)
{
gfx_text
(
&
w
->
dc
,
&
font_helv22b
,
10
,
50
,
"Bottom right"
,
0
);
gfx_text
(
&
w
->
dc
,
&
font_helv22b
,
20
,
70
,
"to reset"
,
0
);
}
static
struct
ui_widget
reset_screen
=
{
reset_redraw
,
NULL
,
{
0
,
0
,
127
,
127
},
0
,
WF_ACTIVE
|
WF_VISIBLE
};
void
reset_main
(
void
*
params
)
{
struct
event
evt
;
/* Init UI */
ui_clear
();
ui_init_widget
(
&
reset_screen
);
ui_add_widget
(
&
reset_screen
);
ui_init_widget
(
&
status_bar
);
ui_add_widget
(
&
status_bar
);
ui_update
(
NULL
);
while
(
1
)
{
if
(
xQueueReceive
(
appQueue
,
&
evt
,
0
))
{
switch
(
evt
.
type
)
{
case
BUTTON_PRESSED
:
if
(
evt
.
data
.
button
==
BUT_TR
)
return
;
/* Reset on bottom right and bottom left buttons
* pressed */
if
(
evt
.
data
.
button
==
BUT_BR
)
SCB
->
AIRCR
=
0x05FA0004
;
break
;
}
}
}
}
application
reset
=
{
.
name
=
"Reset"
,
.
main
=
reset_main
};
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