This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Conditional define of HAL_DELAY_US in Cortex-M architecture HAL
- From: Ilija Kocho <ilijak at siva dot com dot mk>
- To: ecos-patches at ecos dot sourceware dot org
- Date: Wed, 15 Dec 2010 14:09:29 +0100
- Subject: Conditional define of HAL_DELAY_US in Cortex-M architecture HAL
Hello
This is a small patch that enables redefinition of HAL_DELAY_US at
variant or platform level.
An example use case is substitution of hal_delay_us() with "equivalent"
that provides sub microsecond polling (for devices that require low
latency response).
Best regards
Ilija
Index: hal/cortexm/arch/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/cortexm/arch/current/ChangeLog,v
retrieving revision 1.11
diff -u -5 -r1.11 ChangeLog
--- hal/cortexm/arch/current/ChangeLog 17 May 2010 11:38:29 -0000 1.11
+++ hal/cortexm/arch/current/ChangeLog 13 Dec 2010 12:25:48 -0000
@@ -1,5 +1,9 @@
+2010-12-12 Ilija Kocho <ilijak@siva.com.mk>
+
+ * include/hal_intr.h: Conditional define of HAL_DELAY_US().
+
2010-05-17 Spencer Oliver <spen@spen-soft.co.uk>
* include/hal_intr.h (HAL_INTERRUPT_STACK_CALL_PENDING_DSRS):
* src/hal_misc.c (hal_reset_vsr): Add 0 argument to SWI.
Index: hal/cortexm/arch/current/include/hal_intr.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/cortexm/arch/current/include/hal_intr.h,v
retrieving revision 1.5
diff -u -5 -r1.5 hal_intr.h
--- hal/cortexm/arch/current/include/hal_intr.h 17 May 2010 11:38:30 -0000 1.5
+++ hal/cortexm/arch/current/include/hal_intr.h 13 Dec 2010 12:25:48 -0000
@@ -357,12 +357,13 @@
//==========================================================================
// HAL_DELAY_US().
//
__externC void hal_delay_us( cyg_int32 us );
+#if !defined HAL_DELAY_US
#define HAL_DELAY_US( __us ) hal_delay_us( __us )
-
+#endif
//==========================================================================
// Reset.
//
// This uses the SYSRESETREQ bit in the Cortex-M3 NVIC.