From 458a2834834986bc13171439b2f6889ad14044b8 Mon Sep 17 00:00:00 2001
From: gdisirio
+ * Function-trashed registers (R0-R3,R12,LR,SR) are saved/restored by the
+ * system macros \p chSysIRQEnterI() and \p chSysIRQExitI().
+ * The easiest way to ensure this is to just invoke a function from within
+ * the interrupt handler, the function code will save all the required
+ * registers.
+ * Example:
+ * @code
+ * __attribute__((naked, weak))
+ * void irq_handler(void) {
+ * chSysIRQEnterI();
+ *
+ * serve_interrupt();
+ *
+ * VICVectAddr = 0; // This is LPC214x-specific.
+ * chSysIRQExitI();
+ * }
+ * @endcode
+ * This is not a bug but an implementation choice, this solution allows to
+ * have interrupt handlers compiled in thumb mode without have to use an
+ * interworking mode (the mode switch is hidden in the macros), this
+ * greatly improves code efficiency and size. You can look at the serial
+ * driver for real examples of interrupt handlers.
- * The ARM7 port is shared by multiple demos targeted to various implementations: - *
* @ingroup Ports */ /** @} */ -- cgit v1.2.3