Fix some warnings.
This commit is contained in:
parent
63f5536ccf
commit
2c84b74397
|
@ -171,12 +171,12 @@ uint16_t crc16(uint8_t * buf, int len);
|
||||||
// menu.c
|
// menu.c
|
||||||
|
|
||||||
struct MENU_DEF {
|
struct MENU_DEF {
|
||||||
char *text;
|
const char *text;
|
||||||
void (*callback)(void);
|
void (*callback)(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MENU {
|
struct MENU {
|
||||||
char *title;
|
const char *title;
|
||||||
struct MENU_DEF entries[];
|
struct MENU_DEF entries[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ static bool screen_overview() {
|
||||||
while (key != BTN_ENTER) {
|
while (key != BTN_ENTER) {
|
||||||
lcdClear();
|
lcdClear();
|
||||||
lcdPrintln("Privacy:");
|
lcdPrintln("Privacy:");
|
||||||
lcdPrintln(levels[GLOBAL(privacy)]);
|
lcdPrintln(levels[(int)GLOBAL(privacy)]);
|
||||||
lcdPrintln("");
|
lcdPrintln("");
|
||||||
lcdPrintln("Nickname:");
|
lcdPrintln("Nickname:");
|
||||||
lcdPrintln(GLOBAL(nickname));
|
lcdPrintln(GLOBAL(nickname));
|
||||||
|
|
|
@ -90,6 +90,8 @@ void setLeft();
|
||||||
void setRight();
|
void setRight();
|
||||||
struct packet a;
|
struct packet a;
|
||||||
|
|
||||||
|
void setJeopardy();
|
||||||
|
|
||||||
void ram(void)
|
void ram(void)
|
||||||
{
|
{
|
||||||
int priv = GLOBAL(privacy);
|
int priv = GLOBAL(privacy);
|
||||||
|
@ -103,7 +105,7 @@ void ram(void)
|
||||||
nrf_config_set(&config);
|
nrf_config_set(&config);
|
||||||
|
|
||||||
nrf_set_strength(3);
|
nrf_set_strength(3);
|
||||||
int rnd;
|
// int rnd;
|
||||||
|
|
||||||
volatile uint16_t i;
|
volatile uint16_t i;
|
||||||
while( 1 ){
|
while( 1 ){
|
||||||
|
|
|
@ -221,7 +221,7 @@ static void draw_platforms() {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void draw_player() {
|
static void draw_player() {
|
||||||
bool* sprite;
|
const bool* sprite;
|
||||||
if(game.player_y_vel > 0) {
|
if(game.player_y_vel > 0) {
|
||||||
sprite = PLAYER_SPRITE_DOWN;
|
sprite = PLAYER_SPRITE_DOWN;
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,11 +71,12 @@ int melody_timeout;
|
||||||
|
|
||||||
static void init_lilakit(void);
|
static void init_lilakit(void);
|
||||||
static void tick_lilakit(void);
|
static void tick_lilakit(void);
|
||||||
|
void melody_play(void);
|
||||||
static void mainloop();
|
static void mainloop();
|
||||||
void handler(void);
|
void handler(void);
|
||||||
|
|
||||||
void ram(void) {
|
void ram(void) {
|
||||||
timer32Callback0 = handler;
|
timer32Callback0 = (uint32_t) handler;
|
||||||
|
|
||||||
/* Enable the clock for CT32B0 */
|
/* Enable the clock for CT32B0 */
|
||||||
SCB_SYSAHBCLKCTRL |= (SCB_SYSAHBCLKCTRL_CT32B0);
|
SCB_SYSAHBCLKCTRL |= (SCB_SYSAHBCLKCTRL_CT32B0);
|
||||||
|
|
|
@ -29,7 +29,7 @@ void ram(void) {
|
||||||
if( nrf_rcv_pkt_time(64,sizeof(buf),buf) == 16 ){
|
if( nrf_rcv_pkt_time(64,sizeof(buf),buf) == 16 ){
|
||||||
buf[14] = 0;
|
buf[14] = 0;
|
||||||
if( buf[1] == 0x23 || buf[1] == 0x24){
|
if( buf[1] == 0x23 || buf[1] == 0x24){
|
||||||
lcdPrintln(buf+6);
|
lcdPrintln((char*)(buf+6));
|
||||||
//lcdPrintln("foo");
|
//lcdPrintln("foo");
|
||||||
}
|
}
|
||||||
lcdRefresh();
|
lcdRefresh();
|
||||||
|
|
|
@ -113,6 +113,9 @@ void init();
|
||||||
** Code Section
|
** Code Section
|
||||||
*********************************************/
|
*********************************************/
|
||||||
|
|
||||||
|
void init();
|
||||||
|
void ram();
|
||||||
|
|
||||||
void game(void)
|
void game(void)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
|
@ -139,7 +142,7 @@ void game(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
init()
|
void init()
|
||||||
{
|
{
|
||||||
// init ball
|
// init ball
|
||||||
ball1.size = PONG_BALL_SIZE;
|
ball1.size = PONG_BALL_SIZE;
|
||||||
|
|
|
@ -34,11 +34,11 @@ struct packet{
|
||||||
uint8_t x;
|
uint8_t x;
|
||||||
uint8_t y;
|
uint8_t y;
|
||||||
uint8_t flags;
|
uint8_t flags;
|
||||||
uint8_t text[16];
|
char text[16];
|
||||||
}__attribute__((packed)) text;
|
}__attribute__((packed)) text;
|
||||||
struct nick{
|
struct nick{
|
||||||
uint8_t flags;
|
uint8_t flags;
|
||||||
uint8_t nick[18];
|
char nick[18];
|
||||||
}__attribute__((packed)) nick;
|
}__attribute__((packed)) nick;
|
||||||
struct nickrequest{
|
struct nickrequest{
|
||||||
uint8_t reserved[19];
|
uint8_t reserved[19];
|
||||||
|
@ -55,7 +55,7 @@ struct packet{
|
||||||
uint8_t gameFlags;
|
uint8_t gameFlags;
|
||||||
uint8_t interval;
|
uint8_t interval;
|
||||||
uint8_t jitter;
|
uint8_t jitter;
|
||||||
uint8_t gameTitle[8];
|
char gameTitle[8];
|
||||||
}__attribute__((packed)) announce;
|
}__attribute__((packed)) announce;
|
||||||
struct join{
|
struct join{
|
||||||
uint16_t gameId;
|
uint16_t gameId;
|
||||||
|
@ -93,7 +93,7 @@ uint16_t gameId;
|
||||||
uint8_t interval;
|
uint8_t interval;
|
||||||
uint8_t jitter;
|
uint8_t jitter;
|
||||||
uint8_t flags;
|
uint8_t flags;
|
||||||
uint8_t *gameTitle;
|
char *gameTitle;
|
||||||
|
|
||||||
void sendButton(uint8_t button);
|
void sendButton(uint8_t button);
|
||||||
void sendJoin(uint32_t game);
|
void sendJoin(uint32_t game);
|
||||||
|
@ -321,7 +321,7 @@ void processNickRequest( struct nickrequest *nq)
|
||||||
p.id= id;
|
p.id= id;
|
||||||
p.ctr= ++ctr;
|
p.ctr= ++ctr;
|
||||||
p.c.nick.flags = 0;
|
p.c.nick.flags = 0;
|
||||||
uint8_t *nick = GLOBAL(nickname);
|
char *nick = GLOBAL(nickname);
|
||||||
strcpy(p.c.nick.nick, nick);
|
strcpy(p.c.nick.nick, nick);
|
||||||
nrf_snd_pkt_crc(sizeof(p),(uint8_t*)&p);
|
nrf_snd_pkt_crc(sizeof(p),(uint8_t*)&p);
|
||||||
}
|
}
|
||||||
|
@ -374,7 +374,7 @@ void processText(struct text *t)
|
||||||
if( t->flags & FLAGS_CLS )
|
if( t->flags & FLAGS_CLS )
|
||||||
lcdClear() ;
|
lcdClear() ;
|
||||||
lcdSetCrsr(t->x, t->y);
|
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);
|
lcdPrint(t->text);
|
||||||
lcdRefresh();
|
lcdRefresh();
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,7 +116,7 @@ void ram(void) {
|
||||||
case BTN_RIGHT: if (kok) { xs++; xs&=63; kok=0; } break;
|
case BTN_RIGHT: if (kok) { xs++; xs&=63; kok=0; } break;
|
||||||
case BTN_UP: if (kok) { ch++; ch&=7; 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_DOWN: if (kok) { ch--; ch&=7; kok=0; } break;
|
||||||
case BTN_ENTER: return 0;
|
case BTN_ENTER: return;
|
||||||
default: kok=1;
|
default: kok=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,10 @@
|
||||||
#include "core/pmu/pmu.h"
|
#include "core/pmu/pmu.h"
|
||||||
|
|
||||||
#include "basic/basic.h"
|
#include "basic/basic.h"
|
||||||
|
#include "basic/config.h"
|
||||||
#include "lcd/render.h"
|
#include "lcd/render.h"
|
||||||
|
#include "lcd/print.h"
|
||||||
|
#include "usb/usbmsc.h"
|
||||||
#include "filesystem/ff.h"
|
#include "filesystem/ff.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,7 +37,7 @@
|
||||||
|
|
||||||
void wrapper(void);
|
void wrapper(void);
|
||||||
|
|
||||||
int main(void) {
|
void main(void) {
|
||||||
// Configure cpu and mandatory peripherals
|
// Configure cpu and mandatory peripherals
|
||||||
cpuInit(); // Configure the CPU
|
cpuInit(); // Configure the CPU
|
||||||
// we do it later
|
// we do it later
|
||||||
|
|
Loading…
Reference in New Issue