* Switch to channel 15.

* We are powered via USB and there is really no need to put the CPU to
  sleep when CPU is idle.
This commit is contained in:
bg- 2006-12-01 14:58:58 +00:00
parent b9f81cf915
commit 7b1dd9627a

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* @(#)$Id: gateway.c,v 1.3 2006/08/17 15:42:42 bg- Exp $ * @(#)$Id: gateway.c,v 1.4 2006/12/01 14:58:58 bg- Exp $
*/ */
/* /*
@ -109,7 +109,9 @@ static struct uip_fw_netif slipif =
/* Radio stuff in network byte order. */ /* Radio stuff in network byte order. */
static u16_t panId = HTONS(0x2024); static u16_t panId = HTONS(0x2024);
#define RF_CHANNEL 26 #ifndef RF_CHANNEL
#define RF_CHANNEL 15
#endif
int int
main(int argc, char **argv) main(int argc, char **argv)
@ -123,7 +125,7 @@ main(int argc, char **argv)
leds_toggle(LEDS_RED | LEDS_GREEN | LEDS_BLUE); leds_toggle(LEDS_RED | LEDS_GREEN | LEDS_BLUE);
slip_arch_init(); /* Must come before first printf */ slip_arch_init(); /* Must come before first printf */
printf("Starting %s " printf("Starting %s "
"($Id: gateway.c,v 1.3 2006/08/17 15:42:42 bg- Exp $)\n", __FILE__); "($Id: gateway.c,v 1.4 2006/12/01 14:58:58 bg- Exp $)\n", __FILE__);
ds2411_init(); ds2411_init();
sensors_light_init(); sensors_light_init();
cc2420_init(); cc2420_init();
@ -173,17 +175,7 @@ main(int argc, char **argv)
do { do {
/* Reset watchdog. */ /* Reset watchdog. */
} while(process_run() > 0); } while(process_run() > 0);
/* Idle! */
/*
* Idle processing.
*/
int s = splhigh(); /* Disable interrupts. */
if(process_nevents() != 0) {
splx(s); /* Re-enable interrupts. */
} else {
/* Re-enable interrupts and go to sleep atomically. */
_BIS_SR(GIE | SCG0 | CPUOFF); /* LPM1 sleep. */
}
} }
return 0; return 0;