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
5e867565
Commit
5e867565
authored
Oct 01, 2014
by
Theodor-Adrian Stana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Debugging in progress on GPS optimization
parent
2b4e9a38
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
13 deletions
+30
-13
gps.c
sw/common/drivers/gps/gps.c
+2
-2
Makefile
sw/freertos/Makefile
+2
-2
application.h
sw/freertos/src/apps/application.h
+1
-1
gpsbkgrnd.c
sw/freertos/src/apps/gpsbkgrnd.c
+2
-1
irq_dispatcher.c
sw/freertos/src/irq_dispatcher.c
+20
-5
main.c
sw/freertos/src/main.c
+3
-2
No files found.
sw/common/drivers/gps/gps.c
View file @
5e867565
...
...
@@ -65,7 +65,7 @@ void LEUART0_IRQHandler()
rxbuf
[
idx
]
=
'\0'
;
idx
=
0
;
gps_set_framerdy
(
1
);
//
gps_parse_nmea(rxbuf);
gps_parse_nmea
(
rxbuf
);
}
}
}
...
...
@@ -160,7 +160,7 @@ void gps_parse_nmea(const char *buf)
{
// TODO: check return of nmea_parse
nmea_parse
(
&
parser
,
buf
,
strlen
(
buf
),
&
info
);
dbg
();
//
dbg();
usbdbg_puts
(
buf
);
}
...
...
sw/freertos/Makefile
View file @
5e867565
...
...
@@ -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
...
...
@@ -272,7 +272,7 @@ ifeq ($(filter $(MAKECMDGOALS),all debug release),)
endif
flash
:
$(EXE_DIR)/$(PROJECTNAME).bin
openocd
-s
../common/openocd
-f
interface/
$(OOCD_IFACE)
.cfg
-f
init.cfg
-c
"program
$(EXE_DIR)
/
$(PROJECTNAME)
.bin 0 verify reset
0x8000
"
openocd
-s
../common/openocd
-f
interface/
$(OOCD_IFACE)
.cfg
-f
init.cfg
-c
"program
$(EXE_DIR)
/
$(PROJECTNAME)
.bin 0 verify reset"
# include auto-generated dependency files (explicit rules)
ifneq
(clean,$(findstring
clean,
$(MAKECMDGOALS)))
...
...
sw/freertos/src/apps/application.h
View file @
5e867565
...
...
@@ -45,7 +45,7 @@ void debug();
///> Prioriuty of application task
#define APP_PRIORITY (tskIDLE_PRIORITY + 1)
#define BKG
R
ND_APP_PRIORITY (tskIDLE_PRIORITY + 2)
#define BKGND_APP_PRIORITY (tskIDLE_PRIORITY + 2)
///> Shared application task handle
...
...
sw/freertos/src/apps/gpsbkgrnd.c
View file @
5e867565
...
...
@@ -39,8 +39,9 @@ void gpsbkgrnd_main(void *params)
(
void
)
params
;
while
(
1
)
{
if
(
xSemaphoreTake
(
semGps
,
portMAX_DELAY
))
{
if
(
xSemaphoreTake
(
semGps
,
portMAX_DELAY
)
==
pdTRUE
)
{
gps_parse_nmea
(
gps_rxbuf
);
gps_set_framerdy
(
0
);
}
}
}
...
...
sw/freertos/src/irq_dispatcher.c
View file @
5e867565
...
...
@@ -113,19 +113,34 @@ void HardFault_Handler(void)
char
gps_rxbuf
[
GPS_RXBUF_SIZE
];
static
volatile
int
idx
=
0
;
static
volatile
int
store
=
0
;
extern
xSemaphoreHandle
semGps
;
void
LEUART0_IRQHandler
(
void
)
{
char
c
;
portBASE_TYPE
xHigherPriorityTaskWoken
=
pdFALSE
;
if
(
LEUART0
->
IF
&
LEUART_IF_RXDATAV
)
{
gps_rxbuf
[
idx
++
]
=
LEUART_Rx
(
LEUART0
);
if
((
gps_rxbuf
[
idx
-
2
]
==
'\r'
)
&&
(
gps_rxbuf
[
idx
-
1
]
==
'\n'
))
{
gps_rxbuf
[
idx
]
=
'\0'
;
idx
=
0
;
xSemaphoreGiveFromISR
(
semGps
,
&
xHigherPriorityTaskWoken
);
c
=
LEUART_Rx
(
LEUART0
);
/* Start storing on frame start char and if app allows it */
if
((
c
==
'$'
)
&&
!
gps_get_framerdy
())
store
=
1
;
if
(
store
)
{
gps_rxbuf
[
idx
++
]
=
c
;
/* Signal task that frame is ready */
if
((
idx
>
2
)
&&
(
gps_rxbuf
[
idx
-
2
]
==
'\r'
)
&&
(
gps_rxbuf
[
idx
-
1
]
==
'\n'
))
{
gps_rxbuf
[
idx
]
=
'\0'
;
idx
=
0
;
store
=
0
;
gps_set_framerdy
(
1
);
xSemaphoreGiveFromISR
(
semGps
,
&
xHigherPriorityTaskWoken
);
}
}
}
...
...
sw/freertos/src/main.c
View file @
5e867565
...
...
@@ -52,6 +52,8 @@ int main(void)
rtc_init
();
lcd_init
();
ui_init
();
vSemaphoreCreateBinary
(
semGps
);
gps_init
();
GPIO_PinModeSet
(
gpioPortE
,
11
,
gpioModePushPull
,
0
);
...
...
@@ -66,10 +68,9 @@ int main(void)
startMain
(
&
menu
);
vSemaphoreCreateBinary
(
semGps
);
/* Create background task for GPS */
if
(
xTaskCreate
(
gpsbkgrnd
.
main
,
(
const
signed
char
*
)
gpsbkgrnd
.
name
,
APP_STACK_SIZE
,
NULL
,
APP_PRIORITY
,
NULL
)
!=
pdPASS
)
{
APP_STACK_SIZE
,
NULL
,
BKGND_
APP_PRIORITY
,
NULL
)
!=
pdPASS
)
{
// TODO oops..
}
...
...
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