IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Commit Details
Date: | 2016-03-30 22:12:10 (7 years 8 months ago) |
---|---|
Author: | Stefan Schmidt |
Commit: | c6e776e714b6cb8c7a5ea1f2767ee6bab682298e |
Message: | 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. |
Files: |
atusb/fw/Makefile (1 diff) atusb/fw/mac.c (4 diffs) |
Change Details
atusb/fw/Makefile | ||
---|---|---|
20 | 20 | |
21 | 21 | ifeq ($(NAME),rzusb) |
22 | 22 | CHIP=at90usb1287 |
23 | CFLAGS += -DRZUSB | |
23 | CFLAGS += -DRZUSB -DAT86RF230 | |
24 | 24 | else |
25 | 25 | CHIP=atmega32u2 |
26 | CFLAGS += -DATUSB | |
26 | CFLAGS += -DATUSB -DAT86RF231 | |
27 | 27 | endif |
28 | 28 | HOST=jlime |
29 | 29 | BOOT_ADDR=0x7000 |
atusb/fw/mac.c | ||
---|---|---|
113 | 113 | led(0); |
114 | 114 | next_buf(&rx_out); |
115 | 115 | usb_next(); |
116 | #ifdef RZUSB | |
116 | #ifdef AT86RF230 | |
117 | 117 | /* slap at86rf230 - reduce fragmentation issue */ |
118 | 118 | change_state(TRX_STATUS_RX_AACK_ON); |
119 | 119 | #endif |
... | ... | |
126 | 126 | uint8_t *buf; |
127 | 127 | |
128 | 128 | spi_begin(); |
129 | #ifdef ATUSB | |
129 | #ifdef AT86RF231 | |
130 | 130 | if (!(spi_io(AT86RF230_BUF_READ) & RX_CRC_VALID)) { |
131 | 131 | spi_end(); |
132 | 132 | return; |
133 | 133 | } |
134 | 134 | #endif |
135 | #ifdef RZUSB | |
135 | #ifdef AT86RF230 | |
136 | 136 | spi_io(AT86RF230_BUF_READ); |
137 | 137 | #endif |
138 | 138 | |
... | ... | |
216 | 216 | } |
217 | 217 | while (status != TRX_STATUS_RX_ON && status != TRX_STATUS_RX_AACK_ON); |
218 | 218 | |
219 | #ifdef ATUSB | |
219 | #ifdef AT86RF231 | |
220 | 220 | /* |
221 | 221 | * We use TRX_CMD_FORCE_PLL_ON instead of TRX_CMD_PLL_ON because a new |
222 | 222 | * reception may have begun while we were still working on the previous |
... | ... | |
224 | 224 | */ |
225 | 225 | reg_write(REG_TRX_STATE, TRX_CMD_FORCE_PLL_ON); |
226 | 226 | #endif |
227 | #ifdef RZUSB | |
227 | #ifdef AT86RF230 | |
228 | 228 | /* |
229 | 229 | * at86rf230 doesn't support force change, nevetherless this works |
230 | 230 | * somehow |