changeset 2954:1edd8eb593c9

* src/adc.c: Add new key to ADC driver to flush data buffer: CYG_IO_SET_CONFIG_ADC_DATA_FLUSH
author sergeig
date Sat, 29 May 2010 14:33:15 +0000
parents 2651da7b1e83
children f3e242061dd3
files packages/io/adc/current/ChangeLog packages/io/adc/current/src/adc.c
diffstat 2 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/packages/io/adc/current/ChangeLog
+++ b/packages/io/adc/current/ChangeLog
@@ -1,3 +1,8 @@
+20010-05-25 ccoutand <ccoutand@stmi.com>
+	* src/adc.c: 
+	Add new key to ADC driver to flush data buffer:
+	CYG_IO_SET_CONFIG_ADC_DATA_FLUSH
+
 2009-03-02  Simon Kallweit  <simon.kallweit@intefo.ch>
 
 	* cdl/io_adc.cdl:
--- a/packages/io/adc/current/src/adc.c
+++ b/packages/io/adc/current/src/adc.c
@@ -298,6 +298,13 @@ static Cyg_ErrNo adc_set_config(cyg_io_h
         chan->device->funs->disable( chan );
         break;        
 
+    case CYG_IO_SET_CONFIG_ADC_DATA_FLUSH:
+        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;