mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
Several other interrupt button implementations had the same problem as did the sam4s-xplained
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* configs/sure-pic32mx/src/pic32mx_buttons.c
|
||||
*
|
||||
* Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011, 2013-2014 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -211,12 +211,14 @@ xcpt_t board_button_irq(int id, xcpt_t irqhandler)
|
||||
|
||||
if (id < NUM_BUTTONS)
|
||||
{
|
||||
pic32mx_gpioirqdisable(g_buttoncn[id]);
|
||||
oldhandler = pic32mx_gpioattach(g_buttonset[id], g_buttoncn[id], irqhandler);
|
||||
if (irqbuttron)
|
||||
if (irqhandler != NULL)
|
||||
{
|
||||
pic32mx_gpioirqenable(g_buttoncn[id]);
|
||||
}
|
||||
}
|
||||
|
||||
return oldhandler;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user