mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2025-04-21 12:27:27 +03:00
atusb/fw/: new request ATUSB_GPIO_CLEANUP to re-enable INT0
- board.h (gpio_cleanup), board_app.c (gpio_cleanup): restore INT0 when done manipulating GPIOs - board.c (gpio): updated comment explaining how to restore INT0 - include/atusb/ep0.h (enum atspi_requests), ep0.c (ATUSB_GPIO_CLEANUP): new request to return to normal operation after ATUSB_GPIO
This commit is contained in:
@@ -93,7 +93,7 @@ void timer_init(void)
|
||||
|
||||
int gpio(uint8_t port, uint8_t data, uint8_t dir, uint8_t mask, uint8_t *res)
|
||||
{
|
||||
EIMSK = 0; /* must reset to recover INT_RF */
|
||||
EIMSK = 0; /* recover INT_RF to ATUSB_GPIO_CLEANUP or an MCU reset */
|
||||
|
||||
switch (port) {
|
||||
case 1:
|
||||
@@ -138,6 +138,12 @@ int gpio(uint8_t port, uint8_t data, uint8_t dir, uint8_t mask, uint8_t *res)
|
||||
}
|
||||
|
||||
|
||||
void gpio_cleanup(void)
|
||||
{
|
||||
EIMSK = 1 << 0;
|
||||
}
|
||||
|
||||
|
||||
ISR(INT0_vect)
|
||||
{
|
||||
static uint8_t irq;
|
||||
|
||||
Reference in New Issue
Block a user