Print i2c error when send command to codec.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 16 Sep 2011 12:32:34 +0000 (12:32 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 16 Sep 2011 12:32:34 +0000 (12:32 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@5054 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/drv/wm8731.c

index 74a07c4f14ef66102d60df5d86d1cfbb3710e9fa..340ca817c4f353473ada885a0eb63b9d9341132d 100644 (file)
@@ -61,8 +61,9 @@ static void wm8731_write(Wm8731 *ctx, uint8_t reg, uint16_t value)
        i2c_putc(ctx->i2c, (uint8_t)((tmp & 0xFF00) >> 8));
        i2c_putc(ctx->i2c, (uint8_t)(tmp & 0xFF));
 
-       if (i2c_error(ctx->i2c))
-               LOG_ERR("Error while send command to codec.\n");
+       int err = i2c_error(ctx->i2c);
+       if (err)
+               LOG_ERR("Error[%d] while send command to codec.\n", err);
 
 }