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
da611744
Commit
da611744
authored
Oct 07, 2014
by
Projects
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some warnings.
parent
5f40efa3
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
26 additions
and
20 deletions
+26
-20
gps.c
sw/common/drivers/gps.c
+1
-1
lsm303c.c
sw/common/drivers/lsm303c.c
+1
-1
lsm303c.h
sw/common/drivers/lsm303c.h
+3
-3
gfx.c
sw/common/gfx/gfx.c
+1
-1
Makefile
sw/freertos/Makefile
+2
-2
compass.c
sw/freertos/src/apps/compass.c
+7
-5
example_app.c
sw/freertos/src/apps/example_app.c
+1
-0
game.c
sw/freertos/src/apps/game.c
+6
-3
gpscoord.c
sw/freertos/src/apps/gpscoord.c
+0
-1
reset.c
sw/freertos/src/apps/reset.c
+1
-0
status_bar.c
sw/freertos/src/apps/widgets/status_bar.c
+3
-3
No files found.
sw/common/drivers/gps.c
View file @
da611744
...
...
@@ -215,7 +215,7 @@ void gps_get_direction(double *dir)
int
gps_puts
(
const
char
*
s
)
{
while
(
*
s
++
)
{
if
(
*
s
==
EOF
)
if
(
*
s
==
0
)
return
EOF
;
LEUART_Tx
(
LEUART0
,
*
s
);
}
...
...
sw/common/drivers/lsm303c.c
View file @
da611744
...
...
@@ -439,7 +439,7 @@ lsm303_smpl lsm303_calib_iron(lsm303_smpl *max, lsm303_smpl *min)
#define LCD_W 100
#define LCD_0 60
int
compass_xy
(
lsm303_smpl
*
max
,
lsm303_smpl
*
min
,
int
*
x
,
int
*
y
)
void
compass_xy
(
lsm303_smpl
*
max
,
lsm303_smpl
*
min
,
int
*
x
,
int
*
y
)
{
lsm303_smpl
val
;
...
...
sw/common/drivers/lsm303c.h
View file @
da611744
...
...
@@ -91,7 +91,7 @@
#define LSM303_ZREF_H 0x3F
/* ACC only */
typedef
struct
{
int16_t
x
,
y
,
z
int16_t
x
,
y
,
z
;
}
lsm303_smpl
;
/* Accelerometer config */
...
...
@@ -100,7 +100,7 @@ typedef struct {
#define LSM303_ACC_ST_NEG 0x08
#define LSM303_ACC_REBOOT 0x80
#define LSM303_FIFO_EN 0x80
typedef
enum
{
typedef
enum
{
LSM303_ACC_ODR_PDOWN
=
0x00
,
LSM303_ACC_ODR_10_Hz
=
0x10
,
LSM303_ACC_ODR_50_Hz
=
0x20
,
...
...
@@ -198,7 +198,7 @@ int lsm303_enableaxis(int dev, int mask);
int
lsm303_fifo_mode
(
int
dev
,
LSM303_FMODE_t
mode
,
int
en
);
int
lsm303_get_sample
(
int
dev
,
lsm303_smpl
*
smpl
);
lsm303_smpl
lsm303_calib_iron
(
lsm303_smpl
*
max
,
lsm303_smpl
*
min
);
int
compass_xy
(
lsm303_smpl
*
max
,
lsm303_smpl
*
min
,
int
*
x
,
int
*
y
);
void
compass_xy
(
lsm303_smpl
*
max
,
lsm303_smpl
*
min
,
int
*
x
,
int
*
y
);
int
spi_read
(
uint8_t
dev
,
uint8_t
adr
,
uint8_t
*
dat
);
...
...
sw/common/gfx/gfx.c
View file @
da611744
...
...
@@ -279,7 +279,7 @@ void gfx_draw_bitmap_rotate(struct surface *surf, int x0, int y0,
const
struct
rle_bitmap
*
b
,
int
xr
,
int
yr
,
int
angle
,
float
sina
,
float
cosa
)
{
int
x
=
0
,
y
=
0
,
xt
,
yt
;
uint8_t
*
d
=
b
->
data
;
const
uint8_t
*
d
=
b
->
data
;
/*calculate sin/cos of angle only once*/
if
(
sina
>
1
||
sina
<-
1
)
sina
=
small_sin
(
angle
);
...
...
sw/freertos/Makefile
View file @
da611744
...
...
@@ -95,8 +95,8 @@ DEPFLAGS = -MMD -MP -MF $(@:.o=.d)
#
override
CFLAGS
+=
-D
$(DEVICE)
-Wall -Wextra -mcpu=cortex-m3 -mthumb
\
-mfix-cortex-m3-ldrd -ffunction-sections
\
-fdata-sections -fomit-frame-pointer -DGCC_ARMCM3
\
-
DFREERTOS
$(DEPFLAGS)
-fdata-sections -fomit-frame-pointer -DGCC_ARMCM3
-DFREERTOS
$(DEPFLAGS)
\
-
Wno-missing-field-initializers -Wno-unused-function -Wno-switch
override
ASMFLAGS
+=
-x assembler-with-cpp -D
$(DEVICE)
-Wall -Wextra -mcpu=cortex-m3 -mthumb
...
...
sw/freertos/src/apps/compass.c
View file @
da611744
...
...
@@ -29,6 +29,7 @@
#include <gfx/ui.h>
#include <bitmaps.h>
#include <sincos.h>
#include <stdio.h>
#ifdef DEBUG
#include <usbdbg.h>
...
...
@@ -45,7 +46,7 @@ lsm303_smpl iron;
static
void
compass_redraw
(
struct
ui_widget
*
w
)
{
static
int
angle
,
ff
;
static
int
angle
;
int
arr_h
,
arr_w
,
cir_h
,
cir_w
;
char
buf
[
20
];
...
...
@@ -85,6 +86,7 @@ static void compass_redraw(struct ui_widget *w)
static
void
compass_event
(
struct
ui_widget
*
w
,
const
struct
event
*
evt
)
{
(
void
)
evt
;
// suppress warnings
w
->
flags
|=
WF_DIRTY
;
}
...
...
@@ -111,7 +113,7 @@ void compass_main(void *params)
lsm303_smpl
acc
,
mag
;
lsm303_smpl
c_max
,
c_min
;
int
pitch
,
roll
,
xh
,
yh
,
th
,
x_comp
,
y_comp
;
unsigned
int
x2
,
y2
,
z2
;
/*unsigned int x2, y2, z2;*/
float
xy_mean
;
char
buf
[
50
];
...
...
@@ -168,9 +170,9 @@ void compass_main(void *params)
}
if
(
!
calib
)
{
/* calculate pitch and roll from accelerometer */
x2
=
acc
.
x
*
acc
.
x
;
y2
=
acc
.
y
*
acc
.
y
;
z2
=
acc
.
z
*
acc
.
z
;
/*x2 = acc.x * acc.x;*/
/*y2 = acc.y * acc.y;*/
/*z2 = acc.z * acc.z;*/
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
);
...
...
sw/freertos/src/apps/example_app.c
View file @
da611744
...
...
@@ -31,6 +31,7 @@
#include "drivers/vibra.h"
#include <string.h> // for strcpy
#include <stdio.h> // for sprintf
static
char
message
[
32
]
=
"hello world"
;
...
...
sw/freertos/src/apps/game.c
View file @
da611744
...
...
@@ -27,7 +27,10 @@
#include "application.h"
#include "widgets/status_bar.h"
#include <drivers/lsm303c.h>
#include <drivers/buzzer.h>
#include <drivers/vibra.h>
#include <sincos.h>
#include <stdio.h>
#define S_WIN_X0 5
#define S_WIN_Y0 25
...
...
@@ -44,7 +47,7 @@
unsigned
int
win_x0
,
win_y0
,
win_x1
,
win_y1
;
unsigned
int
score
,
highscore
;
int
mode
;
int
ball_x
,
ball_y
;
unsigned
int
ball_x
,
ball_y
;
static
void
game_redraw
(
struct
ui_widget
*
w
)
{
...
...
@@ -69,6 +72,7 @@ static void game_redraw(struct ui_widget *w)
static
void
game_event
(
struct
ui_widget
*
w
,
const
struct
event
*
evt
)
{
(
void
)
evt
;
// suppress warnings
w
->
flags
|=
WF_DIRTY
;
}
...
...
@@ -94,9 +98,8 @@ void game_main(void *params)
struct
event
evt
;
lsm303_smpl
acc
;
int
fakap
=
0
;
char
buf
[
30
];
int
old_x
,
old_y
;
int
dir
=
0
,
fact
;
int
fact
;
lsm303_init
();
buzzer_set_freq
(
4000
);
...
...
sw/freertos/src/apps/gpscoord.c
View file @
da611744
...
...
@@ -136,7 +136,6 @@ void gpscoord_main(void *params)
(
void
)
params
;
struct
event
evt
;
int
i
=
0
;
/* Init UI */
ui_clear
();
...
...
sw/freertos/src/apps/reset.c
View file @
da611744
...
...
@@ -48,6 +48,7 @@ static struct ui_widget reset_screen = {
void
reset_main
(
void
*
params
)
{
(
void
)
params
;
// suppress warnings
struct
event
evt
;
/* Init UI */
...
...
sw/freertos/src/apps/widgets/status_bar.c
View file @
da611744
...
...
@@ -30,7 +30,7 @@
#include <bitmaps.h>
#include <event.h>
#include <
math
.h>
#include <
stdlib
.h>
#include <string.h>
#include <drivers/gps.h>
...
...
@@ -59,14 +59,14 @@ static void status_bar_event(struct ui_widget *w, const struct event *evt)
memcpy
(
&
gps_ico
,
&
gps_searching
,
sizeof
(
struct
rle_bitmap
));
}
else
{
mem
cpy
(
&
gps_ico
,
0
,
sizeof
(
struct
rle_bitmap
));
mem
set
(
&
gps_ico
,
0
,
sizeof
(
struct
rle_bitmap
));
}
}
w
->
flags
|=
WF_DIRTY
;
break
;
case
GPS_OFF
:
mem
cpy
(
&
gps_ico
,
0
,
sizeof
(
struct
rle_bitmap
));
mem
set
(
&
gps_ico
,
0
,
sizeof
(
struct
rle_bitmap
));
w
->
flags
|=
WF_DIRTY
;
break
;
...
...
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