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
a11623b7
Commit
a11623b7
authored
Oct 05, 2014
by
Theodor-Adrian Stana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Using USB debug only when DEBUG symbol is set
parent
df3d2847
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
8 deletions
+23
-8
gps.c
sw/common/drivers/gps.c
+7
-2
gps.h
sw/common/drivers/gps.h
+0
-2
compass.c
sw/freertos/src/apps/compass.c
+6
-0
game.c
sw/freertos/src/apps/game.c
+0
-1
gpsbkgnd_task.c
sw/freertos/src/gpsbkgnd_task.c
+4
-1
main.c
sw/freertos/src/main.c
+6
-2
No files found.
sw/common/drivers/gps.c
View file @
a11623b7
...
...
@@ -35,7 +35,6 @@
* TODO: -
*==============================================================================
*/
#include <stdio.h>
#include <string.h>
#include <em_device.h>
...
...
@@ -46,7 +45,9 @@
#include <drivers/gps.h>
#include <nmea/nmea.h>
#ifdef DEBUG
#include <usbdbg.h>
#endif
static
char
rxbuf
[
GPS_RXBUF_SIZE
];
static
volatile
int
idx
=
0
;
...
...
@@ -153,7 +154,11 @@ void gps_parse_nmea(const char *buf)
{
// TODO: check return of nmea_parse
nmea_parse
(
&
parser
,
buf
,
strlen
(
buf
),
&
info
);
#if defined(GPS_DBG)
#ifdef DEBUG
/*
* NOTE: usbdbg_init() should be called EXTERNALLY, BEFORE gps_init() is
* called
* */
usbdbg_puts
(
buf
);
#endif
}
...
...
sw/common/drivers/gps.h
View file @
a11623b7
...
...
@@ -43,8 +43,6 @@
/*=============*/
/* GPS defines */
/*=============*/
//#define GPS_DBG 1
#define GPS_OK_TO_SEND "$PSRF150,1*3E\r\n"
#define GPS_RXBUF_SIZE 128
...
...
sw/freertos/src/apps/compass.c
View file @
a11623b7
...
...
@@ -29,7 +29,10 @@
#include <drivers/lsm303c.h>
#include <bitmaps.h>
#include <sincos.h>
#ifdef DEBUG
#include <usbdbg.h>
#endif
#define COMP_R 50.0
#define COMP_X0 64
...
...
@@ -174,7 +177,10 @@ void compass_main(void *params)
pitch
=
-
small_atan
(
acc
.
x
,
small_sqrt
(
acc
.
y
*
acc
.
y
+
acc
.
z
*
acc
.
z
));
roll
=
small_atan
(
acc
.
y
,
small_sqrt
(
acc
.
x
*
acc
.
x
+
acc
.
z
*
acc
.
z
));
sprintf
(
buf
,
"p: %d, r: %d
\n\r
"
,
pitch
,
roll
);
#if defined(DEBUG)
// NOTE: usbdbg_init() called in main.c
usbdbg_puts
(
buf
);
#endif
/* work with compass readout, first revert it because magnetic south is north */
mag
.
x
*=
-
1
;
mag
.
y
*=
-
1
;
...
...
sw/freertos/src/apps/game.c
View file @
a11623b7
...
...
@@ -28,7 +28,6 @@
#include "widgets/status_bar.h"
#include <drivers/lsm303c.h>
#include <sincos.h>
#include <usbdbg.h>
#define S_WIN_X0 5
#define S_WIN_Y0 25
...
...
sw/freertos/src/gpsbkgnd_task.c
View file @
a11623b7
...
...
@@ -28,9 +28,12 @@
#include <drivers/gps.h>
#include <event.h>
#include <time.h>
#ifdef DEBUG
#include <usbdbg.h>
#include <stdio.h>
#
include <time.h>
#
endif
#include "application.h"
#include "clock.h"
...
...
sw/freertos/src/main.c
View file @
a11623b7
...
...
@@ -38,8 +38,6 @@
#include <drivers/vibra.h>
#include <drivers/gps.h>
#include <usbdbg.h>
#include <gfx/ui.h>
#include <apps/app_list.h>
#include "battery_task.h"
...
...
@@ -47,6 +45,10 @@
#include "state.h"
#include "gpsbkgnd_task.h"
#ifdef DEBUG
#include <usbdbg.h>
#endif
int
main
(
void
)
{
// Chip errata
...
...
@@ -60,7 +62,9 @@ int main(void)
I2C_Init_TypeDef
i2cInit
=
I2C_INIT_DEFAULT
;
I2CDRV_Init
(
&
i2cInit
);
#ifdef DEBUG
usbdbg_init
();
#endif
backlight_init
();
buttons_init
();
...
...
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