Implement timer_cleanup() function for SAM7.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 5 Jan 2012 17:25:54 +0000 (17:25 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 5 Jan 2012 17:25:54 +0000 (17:25 +0000)
This must be called to stop the system timer in the bootloader before
jumping into the application.

git-svn-id: https://src.develer.com/svnoss/bertos/trunk@5215 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/cpu/arm/drv/timer_at91.c
bertos/cpu/arm/drv/timer_at91.h
bertos/drv/timer.c

index beab00d60bf92fe7697033d75accdb3c9aa0947c..0e02d8b40356c17f37ded106e6544201e56d6964 100644 (file)
                IRQ_RESTORE(flags);
        }
 
+       void timer_hw_cleanup(void)
+       {
+               PIT_MR &= ~BV(PITEN);
+               sysirq_setEnable(SYSIRQ_PIT, false);
+       }
 #else
        #error Unimplemented value for CONFIG_TIMER
 #endif /* CONFIG_TIMER */
index 0628d3940330d3cbdd4f22bd735d1750d4815035..433c352c201d08515574a28c409529b257c73ca2 100644 (file)
 #endif /* CONFIG_TIMER */
 
 void timer_hw_init(void);
+void timer_hw_cleanup(void);
 
 
 #endif /* DRV_TIMER_AT91_H */
index a411dc4e8be29775aed3cc959f5af49b62f32c00..a59f2a77aaa258071ac0eade8095514d536dba10 100644 (file)
@@ -402,7 +402,7 @@ void timer_init(void)
 }
 
 
-#if (ARCH & ARCH_EMUL)
+#if (ARCH & ARCH_EMUL) || (CPU_ARM_AT91)
 /**
  * Stop timer (only used by emulator)
  */