From a0ae6ab0a9c0f3dc9119957a4dad45ffaeab3f32 Mon Sep 17 00:00:00 2001 From: Nathael Pajani Date: Thu, 15 Sep 2016 05:15:07 +0200 Subject: [PATCH] Display error number on error --- i2c_temp/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.43.0