[PATCH 11/52] arm/gba/clock/clockdrv.c: Fix warnings and clean up

Joel Sherrill joel.sherrill at oarcorp.com
Wed Oct 8 19:16:02 UTC 2014


---
 c/src/lib/libbsp/arm/gba/clock/clockdrv.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/c/src/lib/libbsp/arm/gba/clock/clockdrv.c b/c/src/lib/libbsp/arm/gba/clock/clockdrv.c
index 8ba9c6d..72d0b81 100644
--- a/c/src/lib/libbsp/arm/gba/clock/clockdrv.c
+++ b/c/src/lib/libbsp/arm/gba/clock/clockdrv.c
@@ -20,8 +20,8 @@
 #include <gba.h>
 #include <assert.h>
 
-
 void Clock_isr(void * arg);
+void Clock_driver_support_initialize_hardware(void);
 
 #define Clock_driver_support_at_tick()
 
@@ -81,9 +81,12 @@ void Clock_isr(void * arg);
  */
 void Clock_driver_support_initialize_hardware(void)
 {
-  int tmreload = ((rtems_configuration_get_microseconds_per_tick()*1000)/__TimTickTime_ns);
+  int tmreload;
+
+  tmreload = rtems_configuration_get_nanoseconds_per_tick() / __TimTickTime_ns;
 
-  if (tmreload>0xFFFF) tmreload = 0xFFFF;
+  if (tmreload>0xFFFF)
+    tmreload = 0xFFFF;
   GBA_REG_TM3CNT = (GBA_TMCNT_PS);
   GBA_REG_TM3D   = (0x0000-tmreload);
   GBA_REG_TM3CNT = (0x00c0|GBA_TMCNT_PS);
-- 
1.9.3




More information about the devel mailing list