This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
m68k i2c driver fixes
- From: Bart Veer <bartv at ecoscentric dot com>
- To: ecos-patches at sourceware dot org
- Date: Mon, 09 Feb 2009 22:52:19 +0000
- Subject: m68k i2c driver fixes
This removes a spurious big of diagnostics code, and fixes a bug
reported quite some time ago.
Bart
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().
Index: src/i2c_mcf52xx.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/i2c/m68k/mcf52xx/current/src/i2c_mcf52xx.c,v
retrieving revision 1.2
diff -u -p -r1.2 i2c_mcf52xx.c
--- src/i2c_mcf52xx.c 29 Jan 2009 17:48:33 -0000 1.2
+++ src/i2c_mcf52xx.c 9 Feb 2009 22:49:01 -0000
@@ -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);