Skip to content

Commit

Permalink
at86rf231: replace vtimer_usleep by hwtimer_wait
Browse files Browse the repository at this point in the history
This fixes a bug where the callback to unlock the thread, put to sleep by
`vtimer_usleep` wouldn't be woken up due to overhead. Using hwtimer_wait
works for now, but this section will be replaced a driver refactor anyway.
  • Loading branch information
thomaseichinger committed Oct 1, 2014
1 parent ec24fbd commit 76fc75b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/at86rf231/at86rf231.c
Expand Up @@ -26,7 +26,7 @@
#include "periph/spi.h"
#include "kernel_types.h"
#include "transceiver.h"
#include "vtimer.h"
#include "hwtimer.h"

#define ENABLE_DEBUG (0)
#include "debug.h"
Expand Down Expand Up @@ -101,7 +101,7 @@ void at86rf231_switch_to_rx(void)
do {
status = at86rf231_get_status();

vtimer_usleep(10);
hwtimer_wait(HWTIMER_TICKS(10));

if (!--max_wait) {
printf("at86rf231 : ERROR : could not enter RX_ON mode\n");
Expand Down Expand Up @@ -258,4 +258,3 @@ void at86rf231_reset(void)
} while ((status & AT86RF231_TRX_STATUS_MASK__TRX_STATUS)
!= AT86RF231_TRX_STATUS__TRX_OFF);
}

0 comments on commit 76fc75b

Please sign in to comment.