game: added fallback to channel 81

This commit is contained in:
schneider 2011-12-23 21:08:45 +01:00
parent e2b7287256
commit 4af4cfdf38
1 changed files with 17 additions and 0 deletions

View File

@ -252,6 +252,23 @@ uint8_t selectGame()
processPacket(&p);
}
}
if( gamecount == 0){
config.channel = 81;
nrf_config_set(&config);
lcdClear();
lcdPrintln("Searching for");
lcdPrintln("games on");
lcdPrintln("channel 81");
lcdRefresh();
for(i=0;i<60;i++){
len= nrf_rcv_pkt_time(30, sizeof(p), (uint8_t*)&p);
if (len==sizeof(p)){
if( a ) a = 0; else a = 1;
gpioSetValue (RB_LED2, a);
processPacket(&p);
}
}
}
selected = 0;
while(1){
showGames(selected);