mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-24 22:13:52 +01:00
at86rf231: replace vtimer_usleep by hwtimer_wait
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.
This commit is contained in:
parent
42f96b0d60
commit
c27e250de4
@ -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"
|
||||
@ -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");
|
||||
@ -258,4 +258,3 @@ void at86rf231_reset(void)
|
||||
} while ((status & AT86RF231_TRX_STATUS_MASK__TRX_STATUS)
|
||||
!= AT86RF231_TRX_STATUS__TRX_OFF);
|
||||
}
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
#include "at86rf231.h"
|
||||
#include "at86rf231_spi.h"
|
||||
#include "vtimer.h"
|
||||
#include "hwtimer.h"
|
||||
|
||||
#define ENABLE_DEBUG (0)
|
||||
#include "debug.h"
|
||||
@ -95,7 +95,7 @@ static void at86rf231_xmit(uint8_t *data, radio_packet_length_t length)
|
||||
do {
|
||||
status = at86rf231_get_status();
|
||||
|
||||
vtimer_usleep(10);
|
||||
hwtimer_wait(HWTIMER_TICKS(10));
|
||||
|
||||
if (!--max_wait) {
|
||||
printf("at86rf231 : ERROR : could not enter PLL_ON mode");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user