This commit is contained in:
j3d1 2022-05-30 00:04:54 +02:00
parent be54d8b8f7
commit 4fcdd35c41

View file

@ -4,6 +4,7 @@
#include "lux.h" #include "lux.h"
#include <stdio.h>
#include <string.h> #include <string.h>
#include <FreeRTOS.h> #include <FreeRTOS.h>
#include <task.h> #include <task.h>
@ -44,7 +45,7 @@ extern "C" void lux_task(void *pvParameters) {
for(volatile int i = 0; i < 100; i++); for(volatile int i = 0; i < 100; i++);
spi_read(1, 0x00, buf, 2, SPI_8BIT); spi_read(1, 0x00, buf, 2, SPI_8BIT);
char hex[5]; char hex[5] = {0};
int_to_hex(buf[0], hex); int_to_hex(buf[0], hex);
int_to_hex(buf[1], hex + 2); int_to_hex(buf[1], hex + 2);
hex[4] = '\0'; hex[4] = '\0';