From: Nathael Pajani Date: Thu, 15 Sep 2016 03:15:07 +0000 (+0200) Subject: Display error number on error X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;h=a0ae6ab0a9c0f3dc9119957a4dad45ffaeab3f32;p=soft%2Flpc82x%2Fexamples Display error number on error --- diff --git a/i2c_temp/main.c b/i2c_temp/main.c index c1e0080..bff64df 100644 --- a/i2c_temp/main.c +++ b/i2c_temp/main.c @@ -76,7 +76,7 @@ void temp_config(int uart_num) /* Temp sensor */ ret = tmp101_sensor_config(&tmp101_sensor); if (ret != 0) { - uprintf(uart_num, "Temp config error\n"); + uprintf(uart_num, "Temp config error: %d\n", ret); } } @@ -90,7 +90,7 @@ void temp_display(int uart_num) msleep(250); /* Wait for the end of the conversion : 40ms */ len = tmp101_sensor_read(&tmp101_sensor, &raw, &deci_degrees); if (len != 0) { - uprintf(uart_num, "Temp read error\n"); + uprintf(uart_num, "Temp read error: %d\n", ret); } else { uprintf(uart_num, "Temp read: %d,%d - raw: 0x%04x.\n", (deci_degrees/10), (deci_degrees%10), raw);