only turn off if we are not in CC1020_OFF state. (patch by Jesper Karlsson)

This commit is contained in:
nvt-se 2009-09-04 11:00:48 +00:00
parent 4d21a3e203
commit cd96248306

View file

@ -364,6 +364,7 @@ cc1020_off(void)
{ {
int s; int s;
if(cc1020_state != CC1020_OFF) {
if(cc1020_state & CC1020_RX_SEARCHING) { if(cc1020_state & CC1020_RX_SEARCHING) {
/* Discard the current read buffer when the radio is shutting down. */ /* Discard the current read buffer when the radio is shutting down. */
cc1020_rxlen = 0; cc1020_rxlen = 0;
@ -379,6 +380,7 @@ cc1020_off(void)
} else { } else {
cc1020_state |= CC1020_TURN_OFF; cc1020_state |= CC1020_TURN_OFF;
} }
}
return 1; return 1;
} }
@ -720,7 +722,7 @@ static void
cc1020_setupPD(void) cc1020_setupPD(void)
{ {
/* /*
* Power down components an reset all registers except MAIN * Power down components and reset all registers except MAIN
* to their default values. * to their default values.
*/ */
cc1020_write_reg(CC1020_MAIN, cc1020_write_reg(CC1020_MAIN,
@ -776,3 +778,4 @@ cc1020_wakeupTX(int analog)
MS_DELAY(1); MS_DELAY(1);
cc1020_write_reg(CC1020_MAIN, 0xD1); cc1020_write_reg(CC1020_MAIN, 0xD1);
} }