CVS: libraries/include/mspgcc eventhandler.h,1.1,1.2

Chris Liechti <[email protected]>
Newsgroups gmane.comp.hardware.texas-instruments.msp430.gcc.cvs
Message-ID <[email protected]>
Update of /cvsroot/mspgcc/libraries/include/mspgcc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26635/libraries/include/mspgcc

Modified Files:
	eventhandler.h 
Log Message:
- typos
- assembler interface

Index: eventhandler.h
===================================================================
RCS file: /cvsroot/mspgcc/libraries/include/mspgcc/eventhandler.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- eventhandler.h	22 Aug 2005 11:24:00 -0000	1.1
+++ eventhandler.h	5 Apr 2006 18:39:48 -0000	1.2
@@ -9,7 +9,7 @@
 #ifndef _GNU_ASSEMBLER_
 
 /**
- * Simple event handler
+ * Simple event handler.
  * 
  * Each event is a function and has a corresponding bit in the variable
  * eventreg. EVENT00 has bit 0x8000 which is the highest priority,
@@ -18,7 +18,7 @@
  * This causes a risk of priority inversion when a low priority event
  * handler consumes too much time.
  * For devices with human interaction, a maximum time limit for each event of
- * 20ms is recmended.
+ * less than 30ms is recomended.
  * 
  * Each time am eventhandler exits, the eventhandler_bits are scanned from
  * left to right (starting at the higest prio). If no eventhandler_bits is
@@ -29,7 +29,7 @@
  * the eventhandler is reinitializing all its registers.
  *
  * If no events are pending, then "eventhandler_idle" is called. The library
- * provides a default implementation that enters the LPM0 powesaving mode.
+ * provides a default implementation that enters the LPM0 powersaving mode.
  * A different function may be provided that e.g. toggles a LED to show the
  * CPU activity or enters a different lowpower mode etc. Together with a
  * timer/getTime() function it is possible to implement a load monitor that
@@ -40,8 +40,8 @@
  *      mode of the CPU, thus starting events from interrupts also requires
  *      to wake it up. See below for more info and examples.
  *
- * @param eventreginit  initial value of eventhandler_bits. These events are
- *                      handled right after the start
+ * @param eventreginit  Initial value of eventhandler_bits. These events are
+ *                      handled right after the start of the eventhandler.
  */
 void __attribute__((noreturn)) eventhandler(unsigned short eventreginit);
 
@@ -51,7 +51,7 @@
 extern volatile unsigned short eventhandler_bits;  //priority/activation bits of event
 
 /**
- * This macro start an eventhandler.
+ * This macro starts an eventhandler.
  *
  * If used in an interrupt, do not forget to use a interrupt handler with
  * "wakeup" attribute or call "_BIC_SR_IRQ(LPM4_bits);"
@@ -91,6 +91,8 @@
  */
 typedef void (*EVENTHANDLER_TABLE)(void);
 
+
+
 /**
  * This is a special eventhandler: it starts additional events, based on the
  * "event_timetable".
@@ -128,10 +130,24 @@
 typedef struct {
     unsigned short modulo;              ///< divisor
     unsigned short shift;               ///< remainder
-    unsigned short eventbits;           ///< this bits are passed to EVENTHANDLER_LAUNCH
+    unsigned short eventbits;           ///< these bits are passed to EVENTHANDLER_LAUNCH
 } SCHEDULER_TABLE;
 
-#endif
+#else //_GNU_ASSEMBLER_
+// assembler interface
+
+/**
+ * This macro starts an eventhandler, assembler version.
+ *
+ * If used in an interrupt, do not forget to use a interrupt handler that
+ * disables LPM4_bits in SR."
+ *
+ * @param eventbit      One of the EVENTxx_bits defines or an alias.
+ *                      Must be a constant.
+ */
+#define EVENTHANDLER_LAUNCH(eventbit)  bis.w #eventbit, eventhandler_bits
+
+#endif //_GNU_ASSEMBLER_
 
 // Bit masks for taskbit register
 // It is recomended to define aliases and not using these directly



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.