public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Christophe Coutand" <ccoutand@stmi.com>
To: <ecos-patches@ecos.sourceware.org>
Subject: Update to CYGPKG_IO_ADC
Date: Sat, 22 May 2010 09:43:00 -0000	[thread overview]
Message-ID: <D6050C555CC56940A7AF32652283027611DAD4@mail2.STMIRV01.COM> (raw)

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

Added option to flush the ADC sample buffer.

Christophe

[-- Attachment #2: adc_buf_flush --]
[-- Type: application/octet-stream, Size: 2113 bytes --]

# HG changeset patch
# Parent fc4749a6a0dd02e585fc84a875f8f39f7a4c00f7
# User ccoutand
# Date 1274519827 -7200

diff --git a/packages/io/adc/current/ChangeLog b/packages/io/adc/current/ChangeLog
--- a/packages/io/adc/current/ChangeLog
+++ b/packages/io/adc/current/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-25  ccoutand  <ccoutand@stmi.com>
+
+	* src/adc.c: Add CYG_IO_SET_CONFIG_ADC_FLUSH_DATABUF 
+	key for ADC devices.
+
 2009-03-02  Simon Kallweit  <simon.kallweit@intefo.ch>
 
 	* cdl/io_adc.cdl:
diff --git a/packages/io/adc/current/src/adc.c b/packages/io/adc/current/src/adc.c
--- a/packages/io/adc/current/src/adc.c
+++ b/packages/io/adc/current/src/adc.c
@@ -298,6 +298,13 @@
         chan->device->funs->disable( chan );
         break;        
 
+    case CYG_IO_SET_CONFIG_ADC_FLUSH_DATABUF:
+        cyg_drv_isr_lock();
+        chan->put = 0;
+        chan->get = 0;
+        cyg_drv_isr_unlock();
+        break;      
+
     case CYG_IO_SET_CONFIG_READ_BLOCKING:
         if (*len < sizeof(cyg_uint32))
             return -EINVAL;
diff --git a/packages/io/common/current/ChangeLog b/packages/io/common/current/ChangeLog
--- a/packages/io/common/current/ChangeLog
+++ b/packages/io/common/current/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-25  ccoutand  <ccoutand@stmi.com>
+
+	* include/config_keys.h: Add CYG_IO_SET_CONFIG_ADC_FLUSH_DATABUF 
+	key for ADC devices.
+
 2008-08-08  Nick Garnett  <nickg@ecoscentric.com>
 
 	* include/config_keys.h: Add keys for ADC devices.
diff --git a/packages/io/common/current/include/config_keys.h b/packages/io/common/current/include/config_keys.h
--- a/packages/io/common/current/include/config_keys.h
+++ b/packages/io/common/current/include/config_keys.h
@@ -159,6 +159,7 @@
 #define CYG_IO_SET_CONFIG_ADC_RATE                  0x0981
 #define CYG_IO_SET_CONFIG_ADC_ENABLE                0x0982
 #define CYG_IO_SET_CONFIG_ADC_DISABLE               0x0983
+#define CYG_IO_SET_CONFIG_ADC_FLUSH_DATABUF         0x0984
 
 // ======== 0x1000 Generic ===================================================
 // Get/Set configuration 'key' values that can apply to more than one

             reply	other threads:[~2010-05-22  9:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-22  9:43 Christophe Coutand [this message]
2010-05-25 10:51 ` Sergei Gavrikov
2010-05-25 19:06   ` Christophe Coutand
2010-05-25 20:21     ` Sergei Gavrikov
2010-05-25 21:32       ` Christophe Coutand
2010-05-26  7:20         ` Sergei Gavrikov
2010-05-26  6:53       ` Sergei Gavrikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D6050C555CC56940A7AF32652283027611DAD4@mail2.STMIRV01.COM \
    --to=ccoutand@stmi.com \
    --cc=ecos-patches@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).