public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* Re: [ECOS] at91_misc.c patch proposal
       [not found] <E1Dclxr-000180-00@londo.lunn.ch>
@ 2005-06-12 13:34 ` Andrew Lunn
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2005-06-12 13:34 UTC (permalink / raw)
  To: Ezequiel Augusto Cach?o Conde; +Cc: ecos-discuss

On Mon, May 30, 2005 at 04:13:31PM +0100, Ezequiel Augusto Cach?o Conde wrote:
> Hi, 
> 
> 
> I found a small bug in hal_delay_us. Once the timer is started it continues
> running beyond the first counting. If hal_delay is called again, after a
> complete counting, CPC flag is already set.
> 
> My patch simply clears the status flags before initiate a new delay.

Thanks
        Committed
                Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ECOS] at91_misc.c patch proposal
@ 2005-05-31 11:33 Ezequiel Augusto Cachão Conde
  0 siblings, 0 replies; 2+ messages in thread
From: Ezequiel Augusto Cachão Conde @ 2005-05-31 11:33 UTC (permalink / raw)
  To: ecos-discuss

[-- Attachment #1: Type: text/plain, Size: 290 bytes --]

Hi, 


I found a small bug in hal_delay_us. Once the timer is started it continues
running beyond the first counting. If hal_delay is called again, after a
complete counting, CPC flag is already set.

My patch simply clears the status flags before initiate a new delay.
 

Thanks

Ezequiel

[-- Attachment #2: at91_misc.patch --]
[-- Type: application/octet-stream, Size: 1431 bytes --]

Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/at91/var/current/ChangeLog,v
retrieving revision 1.27
diff -u -5 -p -r1.27 ChangeLog
--- ChangeLog	12 Nov 2004 09:45:15 -0000	1.27
+++ ChangeLog	30 May 2005 14:58:19 -0000
@@ -1,5 +1,10 @@
+
+2005-05-30  Ezequiel Conde <ezeq@cc.isel.ipl.pt>
+
+	* src/at91_misc.c ( hal_delay_us ): Clear status before running delay
+	
 2004-11-12  Jani Monoses <jani@iv.ro>
 
 	* include/var_io.h: Added defines for some missing UART bits,
 	corrected a few timer capture mode register bits.
 
Index: src/at91_misc.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/at91/var/current/src/at91_misc.c,v
retrieving revision 1.10
diff -u -5 -p -r1.10 at91_misc.c
--- src/at91_misc.c	25 Sep 2004 09:44:10 -0000	1.10
+++ src/at91_misc.c	30 May 2005 14:58:21 -0000
@@ -146,10 +146,13 @@ void hal_delay_us(cyg_int32 usecs)
     // Set registers
     HAL_WRITE_UINT32(timer+AT91_TC_CMR, AT91_TC_CMR_CLKS_MCK32);  // 1MHz
     HAL_WRITE_UINT32(timer+AT91_TC_RA, 0);
     HAL_WRITE_UINT32(timer+AT91_TC_RC, ticks);
 
+	// Clear status flags
+    HAL_READ_UINT32(timer+AT91_TC_SR, stat);
+
     // Start timer
     HAL_WRITE_UINT32(timer+AT91_TC_CCR, AT91_TC_CCR_TRIG | AT91_TC_CCR_CLKEN);
 
     // Wait for the compare
     do {


[-- Attachment #3: Type: text/plain, Size: 148 bytes --]

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-06-12 13:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <E1Dclxr-000180-00@londo.lunn.ch>
2005-06-12 13:34 ` [ECOS] at91_misc.c patch proposal Andrew Lunn
2005-05-31 11:33 Ezequiel Augusto Cachão Conde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).