/*
* $Log$
+ * Revision 1.11 2004/07/30 14:34:10 rasky
+ * Vari fix per documentazione e commenti
+ * Aggiunte PP_CATn e STATIC_ASSERT
+ *
* Revision 1.10 2004/07/30 14:15:53 rasky
* Nuovo supporto unificato per detect della CPU
*
/* Simple macros */
-#define ABS(a) (((a) < 0) ? -(a) : (a))
-#define MIN(a,b) (((a) < (b)) ? (a) : (b))
-#define MAX(a,b) (((a) > (b)) ? (a) : (b))
+#define ABS(a) (((a) < 0) ? -(a) : (a))
+#define MIN(a,b) (((a) < (b)) ? (a) : (b))
+#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#ifndef BV
/*! Convert a bit value to a binary flag */
((x < 65536UL) ? UINT16_LOG2(x) : UINT16_LOG2((x) >> 16) + 16)
/*! Concatenate two different preprocessor tokens (allowing macros to expand) */
-#define PP_CAT(x,y) PP_CAT__(x,y)
-#define PP_CAT__(x,y) x ## y
-
+#define PP_CAT(x,y) PP_CAT__(x,y)
+#define PP_CAT__(x,y) x ## y
+#define PP_CAT3(x,y,z) PP_CAT(PP_CAT(x,y),z)
+#define PP_CAT4(x,y,z,w) PP_CAT(PP_CAT3(x,y,z),w)
+#define PP_CAT5(x,y,z,w,j) PP_CAT(PP_CAT4(x,y,z,w),j)
+
+/*! String-ize a token (allowing macros to expand) */
+#define PP_STRINGIZE(x) PP_STRINGIZE__(x)
+#define PP_STRINGIZE__(x) #x
+
+/*! Issue a compilation error if the \a condition is false */
+#define STATIC_ASSERT(condition) \
+ extern char CT_ASSERT___[(condition) ? 1 : -1]
/*
* Standard type definitions
/*
* $Log$
+ * Revision 1.12 2004/07/30 14:34:10 rasky
+ * Vari fix per documentazione e commenti
+ * Aggiunte PP_CATn e STATIC_ASSERT
+ *
* Revision 1.11 2004/07/29 22:40:12 bernie
* Spelling fix.
*
#include "cpu.h"
#include "compiler.h"
+#include <config.h>
#include <mware/list.h>
/*! Number of timer ticks per second. */
*
* The following code is safe:
*
- * \example
+ * \code
* time_t tea_start_time = get_tick();
*
* boil_water();
*
* if (get_tick() - tea_start_time > TEAPOT_DELAY)
* printf("Your tea, Sir.\n");
- * \endexample
+ * \endcode
*
* When the tick counter increments every millisecond and time_t
* is 32bit wide, the tick count will overflow every 49.7 days.
* PRINTF_REDUCED 924byte (0x39C)
* PRINTF_NOMODIFIERS 416byte (0x1A0)
*
+ * Code/data size in words on DSP56K with CodeWarrior 6.0:
+ * PRINTF_FULL 1493/45
+ * PRINTF_NOFLOAT 795/45
+ * PRINTF_REDUCED 482/0
+ * PRINTF_NOMODIFIERS 301/0
+ *
* The reduced version of formatter is suitable when program size is critical
* rather than formatting power. This routine uses less than 20 bytes of
* stack space which makes it practical even in systems with less than 256
/*
* $Log$
+ * Revision 1.6 2004/07/30 14:34:10 rasky
+ * Vari fix per documentazione e commenti
+ * Aggiunte PP_CATn e STATIC_ASSERT
+ *
* Revision 1.5 2004/07/29 22:57:09 bernie
* Switch to new-style config handling.
*
/*
* $Log$
+ * Revision 1.6 2004/07/30 14:34:10 rasky
+ * Vari fix per documentazione e commenti
+ * Aggiunte PP_CATn e STATIC_ASSERT
+ *
* Revision 1.5 2004/07/20 23:45:01 bernie
* Finally remove redundant protos.
*
#define ISLISTEMPTY(l) ( (l)->head == (Node *)(&(l)->null) )
/*!
- * \name Unlink a node from the head of the list \a l.
+ * Unlink a node from the head of the list \a l.
* \return Pointer to node, or NULL if the list was empty.
*/
INLINE Node *REMHEAD(List *l)
}
/*!
- * \name Unlink a node from the tail of the list \a l.
+ * Unlink a node from the tail of the list \a l.
* \return Pointer to node, or NULL if the list was empty.
*/
INLINE Node *REMTAIL(List *l)