1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-22 07:04:03 +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:
Stefan Schmidt 2016-03-30 22:12:10 +02:00
parent 968721c335
commit dee10c1eb9
2 changed files with 7 additions and 7 deletions

View File

@ -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 -DAT86RF230
endif
HOST=jlime
BOOT_ADDR=0x7000

View File

@ -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