Fix comments and use uprintf instead of serial_write
authorNathael Pajani <nathael.pajani@ed3l.fr>
Mon, 8 Aug 2016 20:20:18 +0000 (22:20 +0200)
committerNathael Pajani <nathael.pajani@ed3l.fr>
Sat, 11 Feb 2023 04:06:55 +0000 (05:06 +0100)
i2c_temp/main.c

index 7a6b9d4..3db7519 100644 (file)
@@ -77,7 +77,7 @@ void temp_config(int uart_num)
        /* Temp sensor */
        ret = tmp101_sensor_config(&tmp101_sensor);
        if (ret != 0) {
-               serial_write(uart_num, "Temp config error\r\n", 19);
+               uprintf(uart_num, "Temp config error\n");
        }
 }
 
@@ -91,9 +91,9 @@ 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) {
-               serial_write(uart_num, "Temp read error\r\n", 19);
+               uprintf(uart_num, "Temp read error\n");
        } else {
-               uprintf(uart_num, "Temp read: %d,%d - raw: 0x%04x.\r\n",
+               uprintf(uart_num, "Temp read: %d,%d - raw: 0x%04x.\n",
                                (deci_degrees/10), (deci_degrees%10), raw);
        }
 }