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
12b40d8e
Commit
12b40d8e
authored
Jan 14, 2015
by
Theodor-Adrian Stana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Debugging track storage to SD card
parent
da60f63a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
8 deletions
+33
-8
gpsbkgnd_task.c
sw/freewatch/src/gpsbkgnd_task.c
+33
-8
No files found.
sw/freewatch/src/gpsbkgnd_task.c
View file @
12b40d8e
...
...
@@ -83,6 +83,8 @@ void gpsbkgnd_init()
xTimerStart
(
timerGps
,
0
);
}
static
int
nr
=
0
;
static
void
gpsbkgnd_task
(
void
*
params
)
{
(
void
)
params
;
...
...
@@ -120,13 +122,35 @@ static void gpsbkgnd_task(void *params)
// xQueueSendToBack(appQueue, &e, 0);
}
/* Set time and track according to setting */
if
(
gps_fixed
())
{
if
(
setting_get
(
&
setting_gps_sets_time
))
update_time
();
if
(
track
)
store_track
();
}
// /* Set time and track according to setting */
// if (gps_fixed()) {
// if (setting_get(&setting_gps_sets_time))
// update_time();
// if (track)
// store_track();
// }
//UINT dummy;
//char buf[16];
//char fname[64];
//if (nr == 0) {
// track_on();
//}
//if (nr < 10) {
// if (!mutexours) track_on();
// sprintf(buf, "%d\n", nr);
// usbdbg_puts(buf);
// if (open) {
// sprintf(fname, "track");
// open = f_open(&f, fname, FA_CREATE_ALWAYS | FA_WRITE);
// } else {
// f_write(&f, buf, strlen(buf), &dummy);
// }
//}
//if (nr == 10){
// track_off();
//}
//nr++;
if
(
firstrun
)
firstrun
=
0
;
...
...
@@ -196,7 +220,6 @@ static void store_track()
*/
gps_get_coord
(
&
gpscoord
,
2
);
sprintf
(
buf
,
"%3.7f,%3.7f
\n
"
,
gpscoord
.
lat
,
gpscoord
.
lon
);
usbdbg_puts
(
buf
);
f_write
(
&
f
,
buf
,
strlen
(
buf
),
&
dummy
);
}
}
...
...
@@ -205,6 +228,7 @@ static void store_track()
static
void
track_on
()
{
if
(
xSemaphoreTake
(
mutexSdCardAccess
,
0
))
{
usbdbg_puts
(
"take
\r\n
"
);
mutexours
=
1
;
MICROSD_Init
();
disk_initialize
(
0
);
...
...
@@ -215,6 +239,7 @@ static void track_on()
static
void
track_off
()
{
usbdbg_puts
(
"give
\r\n
"
);
f_close
(
&
f
);
MICROSD_Deinit
();
xSemaphoreGive
(
mutexSdCardAccess
);
...
...
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