Bugfix : did not use the right variable name
authorNathael Pajani <nathael.pajani@ed3l.fr>
Mon, 26 Sep 2016 15:57:56 +0000 (17:57 +0200)
committerNathael Pajani <nathael.pajani@ed3l.fr>
Sat, 11 Feb 2023 04:06:55 +0000 (05:06 +0100)
i2c_temp/main.c

index bff64df..e265fe3 100644 (file)
@@ -84,12 +84,12 @@ void temp_display(int uart_num)
 {
        uint16_t raw = 0;
        int deci_degrees = 0;
-       int len = 0;
+       int ret = 0;
 
        tmp101_sensor_start_conversion(&tmp101_sensor);
        msleep(250); /* Wait for the end of the conversion : 40ms */
-       len = tmp101_sensor_read(&tmp101_sensor, &raw, &deci_degrees);
-       if (len != 0) {
+       ret = tmp101_sensor_read(&tmp101_sensor, &raw, &deci_degrees);
+       if (ret != 0) {
                uprintf(uart_num, "Temp read error: %d\n", ret);
        } else {
                uprintf(uart_num, "Temp read: %d,%d - raw: 0x%04x.\n",