mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-22 07:25:19 +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
dee10c1eb9
@ -20,10 +20,10 @@ CFLAGS = -g -mmcu=$(CHIP) -DBOOT_ADDR=$(BOOT_ADDR) \
|
|||||||
|
|
||||||
ifeq ($(NAME),rzusb)
|
ifeq ($(NAME),rzusb)
|
||||||
CHIP=at90usb1287
|
CHIP=at90usb1287
|
||||||
CFLAGS += -DRZUSB
|
CFLAGS += -DRZUSB -DAT86RF230
|
||||||
else
|
else
|
||||||
CHIP=atmega32u2
|
CHIP=atmega32u2
|
||||||
CFLAGS += -DATUSB
|
CFLAGS += -DATUSB -DAT86RF230
|
||||||
endif
|
endif
|
||||||
HOST=jlime
|
HOST=jlime
|
||||||
BOOT_ADDR=0x7000
|
BOOT_ADDR=0x7000
|
||||||
|
@ -113,7 +113,7 @@ static void rx_done(void *user)
|
|||||||
led(0);
|
led(0);
|
||||||
next_buf(&rx_out);
|
next_buf(&rx_out);
|
||||||
usb_next();
|
usb_next();
|
||||||
#ifdef RZUSB
|
#ifdef AT86RF230
|
||||||
/* slap at86rf230 - reduce fragmentation issue */
|
/* slap at86rf230 - reduce fragmentation issue */
|
||||||
change_state(TRX_STATUS_RX_AACK_ON);
|
change_state(TRX_STATUS_RX_AACK_ON);
|
||||||
#endif
|
#endif
|
||||||
@ -126,13 +126,13 @@ static void receive_frame(void)
|
|||||||
uint8_t *buf;
|
uint8_t *buf;
|
||||||
|
|
||||||
spi_begin();
|
spi_begin();
|
||||||
#ifdef ATUSB
|
#ifdef AT86RF231
|
||||||
if (!(spi_io(AT86RF230_BUF_READ) & RX_CRC_VALID)) {
|
if (!(spi_io(AT86RF230_BUF_READ) & RX_CRC_VALID)) {
|
||||||
spi_end();
|
spi_end();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef RZUSB
|
#ifdef AT86RF230
|
||||||
spi_io(AT86RF230_BUF_READ);
|
spi_io(AT86RF230_BUF_READ);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -216,7 +216,7 @@ static void do_tx(void *user)
|
|||||||
}
|
}
|
||||||
while (status != TRX_STATUS_RX_ON && status != TRX_STATUS_RX_AACK_ON);
|
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
|
* 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
|
* 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);
|
reg_write(REG_TRX_STATE, TRX_CMD_FORCE_PLL_ON);
|
||||||
#endif
|
#endif
|
||||||
#ifdef RZUSB
|
#ifdef AT86RF230
|
||||||
/*
|
/*
|
||||||
* at86rf230 doesn't support force change, nevetherless this works
|
* at86rf230 doesn't support force change, nevetherless this works
|
||||||
* somehow
|
* somehow
|
||||||
|
Loading…
Reference in New Issue
Block a user