bugfix powercyle and sleep mcu timing
This commit is contained in:
parent
a5b59e8cbb
commit
ae79061182
|
@ -502,10 +502,9 @@ powercycle(struct rtimer *t, void *ptr)
|
||||||
ensure an occasional wake cycle or foreground processing will
|
ensure an occasional wake cycle or foreground processing will
|
||||||
be blocked until a packet is detected */
|
be blocked until a packet is detected */
|
||||||
#if RDC_CONF_MCU_SLEEP
|
#if RDC_CONF_MCU_SLEEP
|
||||||
|
|
||||||
static uint8_t sleepcycle;
|
static uint8_t sleepcycle;
|
||||||
if((sleepcycle++ < mcusleepcycle) && !we_are_sending && !radio_is_on) {
|
if((sleepcycle++ < mcusleepcycle) && !we_are_sending && !radio_is_on && !(NETSTACK_RADIO.receiving_packet() || NETSTACK_RADIO.pending_packet())) {
|
||||||
rtimer_arch_sleep(RTIMER_NOW() - cycle_start);
|
rtimer_arch_sleep(cycle_start - RTIMER_NOW());
|
||||||
} else {
|
} else {
|
||||||
sleepcycle = 0;
|
sleepcycle = 0;
|
||||||
#ifndef RDC_CONF_PT_YIELD_OFF
|
#ifndef RDC_CONF_PT_YIELD_OFF
|
||||||
|
|
|
@ -1796,8 +1796,8 @@ rf230_cca(void)
|
||||||
// if (cca & 0x40) {/*DEBUGFLOW('3')*/;} else {rf230_pending=1;DEBUGFLOW('4');}
|
// if (cca & 0x40) {/*DEBUGFLOW('3')*/;} else {rf230_pending=1;DEBUGFLOW('4');}
|
||||||
if (cca & 0x40) {
|
if (cca & 0x40) {
|
||||||
// DEBUGFLOW('5');
|
// DEBUGFLOW('5');
|
||||||
// return 1;
|
return 1;
|
||||||
return 0;
|
// return 0;
|
||||||
} else {
|
} else {
|
||||||
// DEBUGFLOW('6');
|
// DEBUGFLOW('6');
|
||||||
busyexit:
|
busyexit:
|
||||||
|
|
Loading…
Reference in a new issue