1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-22 08:48:26 +02:00

atusb/fw/: reset MAC state on ATUSB_RF_RESET

This commit is contained in:
Werner Almesberger 2013-02-13 09:30:21 -03:00
parent 276613da51
commit 852aaf1b66
3 changed files with 13 additions and 3 deletions

View File

@ -96,6 +96,7 @@ static int my_setup(const struct setup_request *setup)
case ATUSB_TO_DEV(ATUSB_RF_RESET):
debug("ATUSB_RF_RESET\n");
reset_rf();
mac_reset();
//ep_send_zlp(EP_CTRL);
return 1;

View File

@ -37,7 +37,7 @@ static uint8_t reg_read(uint8_t reg)
spi_begin();
spi_send(AT86RF230_REG_READ | reg);
value= spi_recv();
value = spi_recv();
spi_end();
return value;
@ -167,3 +167,11 @@ int mac_tx(uint16_t flags, uint16_t len)
usb_recv(&eps[0], tx_buf, len, do_tx, NULL);
return 1;
}
void mac_reset(void)
{
mac_irq = NULL;
txing = 0;
queued_tx_ack = 0;
}

View File

@ -1,8 +1,8 @@
/*
* fw/mac.h - HardMAC functions
*
* Written 2011 by Werner Almesberger
* Copyright 2011 Werner Almesberger
* Written 2011, 2013 by Werner Almesberger
* Copyright 2011, 2013 Werner Almesberger
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -20,5 +20,6 @@ extern int (*mac_irq)(void);
int mac_rx(int on);
int mac_tx(uint16_t flags, uint16_t len);
void mac_reset(void);
#endif /* !MAC_H */