From 79089d6352e01e1e7c6c3f0a88266abbc9af6abb Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 19 Jan 2009 15:10:41 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@644 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/src/interrupts.dox | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 docs/src/interrupts.dox (limited to 'docs/src/interrupts.dox') diff --git a/docs/src/interrupts.dox b/docs/src/interrupts.dox new file mode 100644 index 000000000..8c61eaa6e --- /dev/null +++ b/docs/src/interrupts.dox @@ -0,0 +1,34 @@ +/** + * @page article_interrupts Writing interrupt handlers under ChibiOS/RT + * @{ + * Since version 1.1.0 ChbiOS/RT offers a cross-platform system for writing + * interrupt handlers. Port-related and compiler-related details are + * encapsulated within standard system macros.
+ * An interrupt handler assumes the following general form: + * @code +CH_IRQ_HANDLER(myIRQ) { + CH_IRQ_PROLOGUE(); + + // IRQ handling code, preemptable if the architecture supports it. + + chSysLockI(); + // Invocation of some I-Class system API, never preemptable. + chSysUnlockI(). + + // More IRQ handling code, again preemptable. + + CH_IRQ_EPILOGUE(); +} + * @endcode + * Note that only interrupt handlers that have to invoke system I-Class APIs + * must be written in this form, handlers unrelated to the OS activity can + * omit the macros. + * Another note about the handler name "myIRQ", in some ports it must be a + * vector number rather than a function name, it could also be a name from + * within a predefined set, see the notes about the various ports. + *

Important Notes

+ * - There is an important application note about ARM7 interrupt handlers, + * please read about it in the ARM7 port section: @ref ARM7_IH + */ +/** @} */ + \ No newline at end of file -- cgit v1.2.3