Date:2011-07-12 22:45:00 (9 years 1 month ago)
Author:Werner Almesberger
Commit:da7803a7467417aebb8f28a3a012df45d71967c0
Message:atusb/fw/: some small "HardMAC" fixes

Files: atusb/fw/mac.c (5 diffs)

Change Details

atusb/fw/mac.c
1717
1818#include "at86rf230.h"
1919#include "spi.h"
20#include "board.h"
2021#include "mac.h"
2122
2223
...... 
5152}
5253
5354
55static void rx_done(void *user)
56{
57    led(0);
58}
59
60
5461static int handle_irq(void)
5562{
5663    uint8_t irq;
...... 
8188    for (i = 0; i != size+1; i++)
8289        rx_buf[i+1] = spi_recv();
8390    spi_end();
84    usb_send(&eps[1], rx_buf, size+2, NULL, NULL);
91    led(1);
92    usb_send(&eps[1], rx_buf, size+2, rx_done, NULL);
8593    return 1;
8694}
8795
...... 
120128
121129    spi_begin();
122130    spi_send(AT86RF230_BUF_WRITE);
123    spi_send(tx_size);
131    spi_send(tx_size+2); /* CRC */
124132    for (i = 0; i != tx_size; i++)
125133        spi_send(tx_buf[i]);
126134    spi_end();
...... 
146154    tx_size = len;
147155    usb_recv(&eps[0], tx_buf, len, do_tx, NULL);
148156    return 1;
149
150157}

Archive Download the corresponding diff file



interactive