Skip to content

Commit

Permalink
Fix some warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sec42 committed Jan 28, 2012
1 parent 63f5536 commit 2c84b74
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 16 deletions.
4 changes: 2 additions & 2 deletions firmware/basic/basic.h
Expand Up @@ -171,12 +171,12 @@ uint16_t crc16(uint8_t * buf, int len);
// menu.c

struct MENU_DEF {
char *text;
const char *text;
void (*callback)(void);
};

struct MENU {
char *title;
const char *title;
struct MENU_DEF entries[];
};

Expand Down
2 changes: 1 addition & 1 deletion firmware/l0dable/1boot.c
Expand Up @@ -117,7 +117,7 @@ static bool screen_overview() {
while (key != BTN_ENTER) {
lcdClear();
lcdPrintln("Privacy:");
lcdPrintln(levels[GLOBAL(privacy)]);
lcdPrintln(levels[(int)GLOBAL(privacy)]);
lcdPrintln("");
lcdPrintln("Nickname:");
lcdPrintln(GLOBAL(nickname));
Expand Down
4 changes: 3 additions & 1 deletion firmware/l0dable/jeopardy.c
Expand Up @@ -90,6 +90,8 @@ void setLeft();
void setRight();
struct packet a;

void setJeopardy();

void ram(void)
{
int priv = GLOBAL(privacy);
Expand All @@ -103,7 +105,7 @@ void ram(void)
nrf_config_set(&config);

nrf_set_strength(3);
int rnd;
// int rnd;

volatile uint16_t i;
while( 1 ){
Expand Down
2 changes: 1 addition & 1 deletion firmware/l0dable/jump.c
Expand Up @@ -221,7 +221,7 @@ static void draw_platforms() {
}

static void draw_player() {
bool* sprite;
const bool* sprite;
if(game.player_y_vel > 0) {
sprite = PLAYER_SPRITE_DOWN;
}
Expand Down
3 changes: 2 additions & 1 deletion firmware/l0dable/nick_work.c
Expand Up @@ -71,11 +71,12 @@ int melody_timeout;

static void init_lilakit(void);
static void tick_lilakit(void);
void melody_play(void);
static void mainloop();
void handler(void);

void ram(void) {
timer32Callback0 = handler;
timer32Callback0 = (uint32_t) handler;

/* Enable the clock for CT32B0 */
SCB_SYSAHBCLKCTRL |= (SCB_SYSAHBCLKCTRL_CT32B0);
Expand Down
2 changes: 1 addition & 1 deletion firmware/l0dable/people.c
Expand Up @@ -29,7 +29,7 @@ void ram(void) {
if( nrf_rcv_pkt_time(64,sizeof(buf),buf) == 16 ){
buf[14] = 0;
if( buf[1] == 0x23 || buf[1] == 0x24){
lcdPrintln(buf+6);
lcdPrintln((char*)(buf+6));
//lcdPrintln("foo");
}
lcdRefresh();
Expand Down
5 changes: 4 additions & 1 deletion firmware/l0dable/pongo.c
Expand Up @@ -113,6 +113,9 @@ void init();
** Code Section
*********************************************/

void init();
void ram();

void game(void)
{
init();
Expand All @@ -139,7 +142,7 @@ void game(void)
}
}

init()
void init()
{
// init ball
ball1.size = PONG_BALL_SIZE;
Expand Down
12 changes: 6 additions & 6 deletions firmware/l0dable/r_player.c
Expand Up @@ -34,11 +34,11 @@ struct packet{
uint8_t x;
uint8_t y;
uint8_t flags;
uint8_t text[16];
char text[16];
}__attribute__((packed)) text;
struct nick{
uint8_t flags;
uint8_t nick[18];
char nick[18];
}__attribute__((packed)) nick;
struct nickrequest{
uint8_t reserved[19];
Expand All @@ -55,7 +55,7 @@ struct packet{
uint8_t gameFlags;
uint8_t interval;
uint8_t jitter;
uint8_t gameTitle[8];
char gameTitle[8];
}__attribute__((packed)) announce;
struct join{
uint16_t gameId;
Expand Down Expand Up @@ -93,7 +93,7 @@ uint16_t gameId;
uint8_t interval;
uint8_t jitter;
uint8_t flags;
uint8_t *gameTitle;
char *gameTitle;

void sendButton(uint8_t button);
void sendJoin(uint32_t game);
Expand Down Expand Up @@ -321,7 +321,7 @@ void processNickRequest( struct nickrequest *nq)
p.id= id;
p.ctr= ++ctr;
p.c.nick.flags = 0;
uint8_t *nick = GLOBAL(nickname);
char *nick = GLOBAL(nickname);
strcpy(p.c.nick.nick, nick);
nrf_snd_pkt_crc(sizeof(p),(uint8_t*)&p);
}
Expand Down Expand Up @@ -374,7 +374,7 @@ void processText(struct text *t)
if( t->flags & FLAGS_CLS )
lcdClear() ;
lcdSetCrsr(t->x, t->y);
t->text[16] = 0;
t->text[16] = 0; // XXX:Actually ok, beause the CRC is there. But evil!
lcdPrint(t->text);
lcdRefresh();
}
Expand Down
2 changes: 1 addition & 1 deletion firmware/l0dable/scope.c
Expand Up @@ -116,7 +116,7 @@ void ram(void) {
case BTN_RIGHT: if (kok) { xs++; xs&=63; kok=0; } break;
case BTN_UP: if (kok) { ch++; ch&=7; kok=0; } break;
case BTN_DOWN: if (kok) { ch--; ch&=7; kok=0; } break;
case BTN_ENTER: return 0;
case BTN_ENTER: return;
default: kok=1;
}
}
Expand Down
5 changes: 4 additions & 1 deletion firmware/main.c
Expand Up @@ -4,7 +4,10 @@
#include "core/pmu/pmu.h"

#include "basic/basic.h"
#include "basic/config.h"
#include "lcd/render.h"
#include "lcd/print.h"
#include "usb/usbmsc.h"
#include "filesystem/ff.h"


Expand Down Expand Up @@ -34,7 +37,7 @@

void wrapper(void);

int main(void) {
void main(void) {
// Configure cpu and mandatory peripherals
cpuInit(); // Configure the CPU
// we do it later
Expand Down

0 comments on commit 2c84b74

Please sign in to comment.