mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-12-25 15:39:52 +02:00
atusb: fw: make the ifdefs in mac handling transceiver specific and not board specific
There could be different combinations here. E.g. there is a rzusb like board with the transceiver replaced with an at86rf233.
This commit is contained in:
parent
968721c335
commit
c6e776e714
@ -20,10 +20,10 @@ CFLAGS = -g -mmcu=$(CHIP) -DBOOT_ADDR=$(BOOT_ADDR) \
|
||||
|
||||
ifeq ($(NAME),rzusb)
|
||||
CHIP=at90usb1287
|
||||
CFLAGS += -DRZUSB
|
||||
CFLAGS += -DRZUSB -DAT86RF230
|
||||
else
|
||||
CHIP=atmega32u2
|
||||
CFLAGS += -DATUSB
|
||||
CFLAGS += -DATUSB -DAT86RF231
|
||||
endif
|
||||
HOST=jlime
|
||||
BOOT_ADDR=0x7000
|
||||
|
@ -113,7 +113,7 @@ static void rx_done(void *user)
|
||||
led(0);
|
||||
next_buf(&rx_out);
|
||||
usb_next();
|
||||
#ifdef RZUSB
|
||||
#ifdef AT86RF230
|
||||
/* slap at86rf230 - reduce fragmentation issue */
|
||||
change_state(TRX_STATUS_RX_AACK_ON);
|
||||
#endif
|
||||
@ -126,13 +126,13 @@ static void receive_frame(void)
|
||||
uint8_t *buf;
|
||||
|
||||
spi_begin();
|
||||
#ifdef ATUSB
|
||||
#ifdef AT86RF231
|
||||
if (!(spi_io(AT86RF230_BUF_READ) & RX_CRC_VALID)) {
|
||||
spi_end();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef RZUSB
|
||||
#ifdef AT86RF230
|
||||
spi_io(AT86RF230_BUF_READ);
|
||||
#endif
|
||||
|
||||
@ -216,7 +216,7 @@ static void do_tx(void *user)
|
||||
}
|
||||
while (status != TRX_STATUS_RX_ON && status != TRX_STATUS_RX_AACK_ON);
|
||||
|
||||
#ifdef ATUSB
|
||||
#ifdef AT86RF231
|
||||
/*
|
||||
* We use TRX_CMD_FORCE_PLL_ON instead of TRX_CMD_PLL_ON because a new
|
||||
* reception may have begun while we were still working on the previous
|
||||
@ -224,7 +224,7 @@ static void do_tx(void *user)
|
||||
*/
|
||||
reg_write(REG_TRX_STATE, TRX_CMD_FORCE_PLL_ON);
|
||||
#endif
|
||||
#ifdef RZUSB
|
||||
#ifdef AT86RF230
|
||||
/*
|
||||
* at86rf230 doesn't support force change, nevetherless this works
|
||||
* somehow
|
||||
|
Loading…
Reference in New Issue
Block a user