Index: c/src/lib/libcpu/arm/lpc22xx/clock/clockdrv.c
===================================================================
--- c/src/lib/libcpu/arm/lpc22xx/clock/clockdrv.c	(revision 14010768ed60af2d88c8c60ba6d11ada6e7b2ae2)
+++ c/src/lib/libcpu/arm/lpc22xx/clock/clockdrv.c	(revision 029ced28e2d6354f0b6e8296dbc8863d69a24622)
@@ -1,5 +1,5 @@
 /*
  *  LPC22XX/LPC21xx clock specific using the System Timer
- * Copyright (c) 2006 by Ray <rayx.cn@gmail.com>
+ *  Copyright (c) 2006 by Ray <rayx.cn@gmail.com>
  *  Set the Time0 to generate click for RTEMS
  *
@@ -9,10 +9,7 @@
  *  The license and distribution terms for this file may be
  *  found in the file LICENSE in this distribution or at
- *
  *  http://www.rtems.com/license/LICENSE.
- *
- *
- *  $Id$
-*/
+ */
+
 #include <rtems.h>
 #include <bsp.h>
@@ -21,6 +18,5 @@
 #include <rtems/bspIo.h>  /* for printk */
 
-/* this is defined in ../../../shared/clockdrv_shell.h */
-rtems_isr Clock_isr(rtems_vector_number vector);
+void Clock_isr(rtems_irq_hdl_param arg);
 static void clock_isr_on(const rtems_irq_connect_data *unused);
 static void clock_isr_off(const rtems_irq_connect_data *unused);
@@ -28,17 +24,12 @@
 
 /* Replace the first value with the clock's interrupt name. */
-rtems_irq_connect_data clock_isr_data = {LPC22xx_INTERRUPT_TIMER0,
-                                         (rtems_irq_hdl)Clock_isr,
-					 NULL,
-                                         clock_isr_on,
-                                         clock_isr_off,
-                                         clock_isr_is_on};
-
-/* If you follow the code, this is never used, so any value
- * should work
- */
-#define CLOCK_VECTOR 0
-
-
+rtems_irq_connect_data clock_isr_data = {
+  .name   = LPC22xx_INTERRUPT_TIMER0,
+  .hdl    = Clock_isr,
+  .handle = NULL,
+  .on     = clock_isr_on,
+  .off    = clock_isr_off,
+  .isOn   = clock_isr_is_on,
+};
 
 /* use the /shared/clockdrv_shell.h code template */
@@ -50,8 +41,9 @@
  */
 #define Clock_driver_support_at_tick() \
- do {							\
-	  if (!(T0IR & 0x01)) return; 	\
-	  T0IR = 0x01; 			\
-	  VICVectAddr = 0x00;\
+ do {                                  \
+   if (!(T0IR & 0x01))                 \
+     return;                           \
+   T0IR = 0x01;                        \
+   VICVectAddr = 0x00;                 \
  } while(0)
 
@@ -61,8 +53,7 @@
 #define Clock_driver_support_install_isr( _new, _old ) \
   do {                                                 \
-      (_old) = NULL;                                   \
-      BSP_install_rtems_irq_handler(&clock_isr_data);  \
+    (_old) = NULL;                                   \
+    BSP_install_rtems_irq_handler(&clock_isr_data);  \
   } while(0)
-
 
 /**
@@ -76,21 +67,27 @@
  * clock_isr_off(), and clock_isr_is_on() functions can be
  * NOPs.
+ * 
+ * set timer to generate interrupt every
+ * rtems_configuration_get_microseconds_per_tick()
+ *     MR0/(LPC22xx_Fpclk/(PR0+1)) = 10/1000 = 0.01s
  */
-
-  /* set timer to generate interrupt every rtems_configuration_get_microseconds_per_tick()
-   * MR0/(LPC22xx_Fpclk/(PR0+1)) = 10/1000 = 0.01s
-   */
-
 #define Clock_driver_support_initialize_hardware() \
   do { \
-	T0TCR &= 0; 	 /* disable and clear timer 0, set to  */ \
-	T0PC  = 0;            /* TC is incrementet on every pclk.*/ \
-	T0MR0 = ((LPC22xx_Fpclk/1000* rtems_configuration_get_microseconds_per_tick()) / 1000); /* initialize the timer period and prescaler */  \
-	/*T0PR = (((LPC22xx_Fpclk / 1000) * rtems_configuration_get_microseconds_per_tick()) / 1000-1); \ */ \
-	T0MCR |= 0x03;		  /* generate interrupt when T0MR0 match T0TC and Reset Timer Count*/ \
-	T0EMR = 0;  /*No external match*/ \
-	T0TCR = 1; /*enable timer0*/ \
-	T0IR|=0x01;/*enable interrupt, skyeye will check this*/\
-   } while (0)
+    /* disable and clear timer 0, set to  */ \
+    T0TCR &= 0;                              \
+    /* TC is incrementet on every pclk.*/    \
+    T0PC   = 0;                              \
+    /* initialize the timer period and prescaler */  \
+    T0MR0  = ((LPC22xx_Fpclk/1000 *          \
+             rtems_configuration_get_microseconds_per_tick()) / 1000); \
+    /* generate interrupt when T0MR0 match T0TC and Reset Timer Count*/ \
+    T0MCR |= 0x03;          \
+    /* No external match */ \
+    T0EMR = 0;              \
+    /* enable timer0 */     \
+    T0TCR = 1;              \
+    /* enable interrupt, skyeye will check this*/ \
+    T0IR |= 0x01; \
+  } while (0)
 
 /**
@@ -102,21 +99,22 @@
 #define Clock_driver_support_shutdown_hardware()                        \
   do {                                                                  \
-        /* Disable timer */ \
-       T0TCR&=~0x02; \
-	BSP_remove_rtems_irq_handler(&clock_isr_data);                  \
-     } while (0)
+    /* Disable timer */ \
+    T0TCR&=~0x02; \
+    BSP_remove_rtems_irq_handler(&clock_isr_data);                  \
+  } while (0)
 
 uint32_t bsp_clock_nanoseconds_since_last_tick(void)
 {
-	uint32_t clicks;
+  uint32_t clicks;
+  uint32_t microseconds;
 
-	clicks = T0TC;  /*T0TC is the 32bit time counter 0*/
+  clicks = T0TC;  /* T0TC is the 32bit time counter 0 */
 
-	return (uint32_t) (rtems_configuration_get_microseconds_per_tick() - clicks) * 1000;
+  microseconds = (rtems_configuration_get_microseconds_per_tick() - clicks);
+  return microseconds * 1000;
 }
 
-#define Clock_driver_nanoseconds_since_last_tick bsp_clock_nanoseconds_since_last_tick
-
-
+#define Clock_driver_nanoseconds_since_last_tick \
+        bsp_clock_nanoseconds_since_last_tick
 
 /**
@@ -127,6 +125,5 @@
 static void clock_isr_on(const rtems_irq_connect_data *unused)
 {
-	T0IR&=0x01;
-	//return;
+  T0IR&=0x01;
 }
 
@@ -138,6 +135,5 @@
 static void clock_isr_off(const rtems_irq_connect_data *unused)
 {
-	T0IR=0x00;
-	//return;
+  T0IR=0x00;
 }
 
@@ -150,7 +146,6 @@
 static int clock_isr_is_on(const rtems_irq_connect_data *irq)
 {
-    return T0IR & 0x01;  /*MR0 mask*/
+  return T0IR & 0x01;  /* MR0 mask */
 }
-
 
 /* Make sure to include this, and only at the end of the file */
