changeset 2782:188914a57f30

Remove spurious diag_printf(). Fix handling of an error condition.
author bartv
date Mon, 09 Feb 2009 22:52:45 +0000
parents 0b208f1f4dd5
children d4c7c6b285b6
files packages/devs/i2c/m68k/mcf52xx/current/ChangeLog packages/devs/i2c/m68k/mcf52xx/current/src/i2c_mcf52xx.c
diffstat 2 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/packages/devs/i2c/m68k/mcf52xx/current/ChangeLog
+++ b/packages/devs/i2c/m68k/mcf52xx/current/ChangeLog
@@ -1,3 +1,11 @@
+2009-02-09  Bart Veer  <bartv@ecoscentric.com>
+
+	* src/i2c_mcf52xx.c (mcf52xx_i2c_isr): handle RXAK error
+	condition, reported by Rainer Arndt.
+
+	* src/i2c_mcf52xx.c (cyg_mcf52xx_i2c_tx): remove spurious
+        diag_printf(). 
+
 2008-12-30  John Dallaway  <john@dallaway.org.uk>
 
 	* cdl/i2c_mcf52xx.cdl: Reference per-package documentation.
@@ -16,7 +24,7 @@ 2005-10-23  Uwe Kindler  <uwe_kindler@we
 // ####GPLCOPYRIGHTBEGIN####                                                
 // -------------------------------------------                              
 // This file is part of eCos, the Embedded Configurable Operating System.   
-// Copyright (C) 2005, 2006 Free Software Foundation, Inc.                  
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.                  
 //
 // This program is free software; you can redistribute it and/or modify     
 // it under the terms of the GNU General Public License as published by     
--- a/packages/devs/i2c/m68k/mcf52xx/current/src/i2c_mcf52xx.c
+++ b/packages/devs/i2c/m68k/mcf52xx/current/src/i2c_mcf52xx.c
@@ -8,7 +8,7 @@
 // ####ECOSGPLCOPYRIGHTBEGIN####                                            
 // -------------------------------------------                              
 // This file is part of eCos, the Embedded Configurable Operating System.   
-// Copyright (C) 2005, 2006 Free Software Foundation, Inc.                  
+// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.                  
 //
 // eCos is free software; you can redistribute it and/or modify it under    
 // the terms of the GNU General Public License as published by the Free     
@@ -163,7 +163,7 @@ mcf52xx_i2c_isr(cyg_vector_t vec, cyg_ad
     } else if (CYG_MCF52xx_I2C_XFER_MODE_STARTRX == extra->i2c_mode) {
         // Start followed by RX. The address byte has been sent, we
         // need to switch to receiving.
-        if (sr & HAL_MCF52xx_I2C_SR_IAL) {
+        if (sr & (HAL_MCF52xx_I2C_SR_IAL | HAL_MCF52xx_I2C_SR_RXAK)) {
             // Looks like no device acknowledged the address.
             result = CYG_ISR_HANDLED | CYG_ISR_CALL_DSR;
         } else {
@@ -367,7 +367,6 @@ cyg_mcf52xx_i2c_tx(const cyg_i2c_device*
         if (send_start) {
             extra->i2c_data.i2c_tx_data = tx_data;
             if (! mcf52xx_i2c_send_start(extra, (dev->i2c_address << 1) | 0x00)) {
-                diag_printf("send_start failed\n");
                 return 0;
             }
             mcf52xx_i2c_doit(extra);