Fiddled with the timing
This commit is contained in:
parent
c21ff48788
commit
877eb2fbe9
2 changed files with 10 additions and 8 deletions
|
@ -28,7 +28,7 @@
|
|||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* $Id: phase.c,v 1.5 2010/03/29 21:50:01 adamdunkels Exp $
|
||||
* $Id: phase.c,v 1.6 2010/03/31 11:54:38 adamdunkels Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -73,7 +73,7 @@ MEMB(phase_memb, struct phase_queueitem, PHASE_QUEUESIZE);
|
|||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
phase_update(const struct phase_list *list,
|
||||
const rimeaddr_t * neighbor, rtimer_clock_t time,
|
||||
const rimeaddr_t *neighbor, rtimer_clock_t time,
|
||||
int mac_status)
|
||||
{
|
||||
struct phase *e;
|
||||
|
@ -89,7 +89,7 @@ phase_update(const struct phase_list *list,
|
|||
phase (rebooted). We try a number of transmissions to it
|
||||
before we drop it from the phase list. */
|
||||
if(mac_status == MAC_TX_NOACK) {
|
||||
printf("phase noacks %d\n", e->noacks);
|
||||
printf("phase noacks %d to %d.%d\n", e->noacks, neighbor->u8[0], neighbor->u8[1]);
|
||||
e->noacks++;
|
||||
if(e->noacks >= MAX_NOACKS) {
|
||||
list_remove(*list->list, e);
|
||||
|
@ -162,7 +162,8 @@ phase_wait(struct phase_list *list,
|
|||
/* printf("neighbor phase 0x%02x (cycle 0x%02x)\n", e->time & (cycle_time - 1),
|
||||
cycle_time);*/
|
||||
now = RTIMER_NOW();
|
||||
wait = (rtimer_clock_t)((e->time - now - e->noacks * cycle_time) & (cycle_time - 1));
|
||||
wait = (rtimer_clock_t)((e->time - now - e->noacks * wait_before) &
|
||||
(cycle_time - 1));
|
||||
if(wait < wait_before) {
|
||||
wait += cycle_time;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue