Browse Source

fix:名写错了...

Dozingfiretruck 3 years ago
parent
commit
558d7dbc02
2 changed files with 5 additions and 4 deletions
  1. 2 1
      bsp/linux/port/luat_mcu_linux.c
  2. 3 3
      bsp/win32/port/luat_spi_device.c

+ 2 - 1
bsp/linux/port/luat_mcu_linux.c

@@ -1,7 +1,8 @@
 #include "luat_base.h"
 #include "luat_mcu.h"
 #include "stdio.h"
+#include "time.h"
 
 long luat_mcu_ticks(void) {
-    return clock()*1000/CLOCKS_PRE_SEC;
+    return clock()*1000/CLOCKS_PER_SEC;
 }

+ 3 - 3
bsp/win32/port/luat_spi_device.c

@@ -22,9 +22,9 @@ int luat_spi_device_close(luat_spi_device_t* spi_dev) {
 int luat_spi_device_transfer(luat_spi_device_t* spi_dev, const char* send_buf, size_t send_length, char* recv_buf, size_t recv_length) {
     luat_spi_device_config(spi_dev);
     luat_gpio_set(spi_dev->spi_config.cs, LUAT_SPI_CS_SELECT);
-    // int ret = luat_spi_transfer(spi_dev->bus_id, send_buf, send_length, recv_buf, recv_length);
-    int ret = luat_spi_send(spi_dev->bus_id, send_buf, send_length);
-    ret = luat_spi_recv(spi_dev->bus_id, recv_buf, recv_length);
+    int ret = luat_spi_transfer(spi_dev->bus_id, send_buf, send_length, recv_buf, recv_length);
+    // int ret = luat_spi_send(spi_dev->bus_id, send_buf, send_length);
+    // ret = luat_spi_recv(spi_dev->bus_id, recv_buf, recv_length);
     luat_gpio_set(spi_dev->spi_config.cs, LUAT_SPI_CS_CLEAR);
     return ret;
 }