From: asterix Date: Fri, 16 Sep 2011 12:32:34 +0000 (+0000) Subject: Print i2c error when send command to codec. X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=c01929ab02ef29823d9d161f2236db4658ecd8e8;p=bertos.git Print i2c error when send command to codec. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@5054 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/drv/wm8731.c b/bertos/drv/wm8731.c index 74a07c4f..340ca817 100644 --- a/bertos/drv/wm8731.c +++ b/bertos/drv/wm8731.c @@ -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); }