Browse Source

add:这样应该好一些

Dozingfiretruck 3 years ago
parent
commit
e057760067
2 changed files with 2 additions and 3 deletions
  1. 1 0
      app/port/luat_conf_bsp.h
  2. 1 3
      app/port/luat_uart_air101.c

+ 1 - 0
app/port/luat_conf_bsp.h

@@ -71,6 +71,7 @@
 #define LUAT_USE_FDB 1
 #define LUAT_USE_OTA 1
 #define LUAT_USE_I2CTOOLS 1
+// #define LUAT_USE_LORA 1
 
 //---------------SDIO-FATFS特别配置
 // sdio库对接的是fatfs

+ 1 - 3
app/port/luat_uart_air101.c

@@ -62,10 +62,8 @@ static s16 uart_sent_cb(struct tls_uart_port *port)
     msg.ptr = NULL;
     luat_msgbus_put(&msg, 1);
     if (uart_port[port->uart_no].rs480.rs485_param_bit.is_485used){
-        luat_timer_mdelay(port->uart_cb_len);
+        luat_timer_us_delay((port->uart_cb_len-1)*1000+uart_port[port->uart_no].rs480.rs485_param_bit.wait_time);
         port->uart_cb_len = 0;
-        if (uart_port[port->uart_no].rs480.rs485_param_bit.wait_time)
-            luat_timer_us_delay(uart_port[port->uart_no].rs480.rs485_param_bit.wait_time);
         luat_gpio_set(uart_port[port->uart_no].rs480.rs485_pin, uart_port[port->uart_no].rs480.rs485_param_bit.rx_level);
     }
     return 0;