aboutsummaryrefslogtreecommitdiffstats
path: root/wirish/ext_interrupts.h
diff options
context:
space:
mode:
authorPerry Hung <iperry@gmail.com>2011-01-24 23:23:29 -0500
committerPerry Hung <iperry@gmail.com>2011-01-24 23:23:29 -0500
commitc48689d34809943a5907884bd287cea9ae275352 (patch)
treed49ff06b0d4b81f6ab0eac8060d178ce7542476c /wirish/ext_interrupts.h
parent64431fd4b59cb8656365f1fad5f679cd4d756239 (diff)
parenta9b2d70bc7799ca96c1673b18fe3012b1a4dd329 (diff)
downloadlibrambutan-c48689d34809943a5907884bd287cea9ae275352.tar.gz
librambutan-c48689d34809943a5907884bd287cea9ae275352.zip
Merge remote branch 'leaf/master'
Diffstat (limited to 'wirish/ext_interrupts.h')
-rw-r--r--wirish/ext_interrupts.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/wirish/ext_interrupts.h b/wirish/ext_interrupts.h
index e68d973..304e267 100644
--- a/wirish/ext_interrupts.h
+++ b/wirish/ext_interrupts.h
@@ -35,7 +35,7 @@
#define _EXT_INTERRUPTS_H_
/**
- * The kind transition on an external pin which should trigger an
+ * The kind of transition on an external pin which should trigger an
* interrupt.
*/
typedef enum ExtIntTriggerMode_ {
@@ -57,13 +57,16 @@ extern "C"{
*
* The interrupt will be triggered on a given transition on the pin,
* as specified by the mode parameter. The handler runs in interrupt
- * context.
+ * context. The new handler will replace whatever handler is
+ * currently registered for the pin, if any.
*
* @param pin Maple pin number
* @param handler Function to run upon external interrupt trigger.
+ * The handler should take no arguments, and have void return type.
* @param mode Type of transition to trigger on, e.g. falling, rising, etc.
*
* @sideeffect Registers a handler
+ * @see detachInterrupt()
*/
void attachInterrupt(uint8 pin, voidFuncPtr handler, ExtIntTriggerMode mode);
@@ -71,6 +74,7 @@ void attachInterrupt(uint8 pin, voidFuncPtr handler, ExtIntTriggerMode mode);
* @brief Disable any registered external interrupt.
* @param pin Maple pin number
* @sideeffect unregisters external interrupt handler
+ * @see attachInterrupt()
*/
void detachInterrupt(uint8 pin);
@@ -82,7 +86,7 @@ void detachInterrupt(uint8 pin);
*
* @see noInterrupts()
*/
-static inline __attribute__((always_inline)) void interrupts() {
+static ALWAYS_INLINE void interrupts() {
nvic_globalirq_enable();
}
@@ -96,7 +100,7 @@ static inline __attribute__((always_inline)) void interrupts() {
*
* @see interrupts()
*/
-static inline __attribute__((always_inline)) void noInterrupts() {
+static ALWAYS_INLINE void noInterrupts() {
nvic_globalirq_disable();
}