Bladeren bron

fix:uart5使用485翻转异常的问题

Dozingfiretruck 3 jaren geleden
bovenliggende
commit
6b82f0b5c1
2 gewijzigde bestanden met toevoegingen van 4 en 6 verwijderingen
  1. 1 3
      app/port/luat_uart_air101.c
  2. 3 3
      platform/drivers/timer/wm_timer.c

+ 1 - 3
app/port/luat_uart_air101.c

@@ -23,7 +23,7 @@ typedef struct serials_timer_info {
 	uint16_t timeout;
 }serials_timer_info_t;
 
-static serials_timer_info_t serials_timer_table[5] ={0};
+static serials_timer_info_t serials_timer_table[TLS_UART_MAX] ={0};
 
 int luat_uart_exist(int uartid)
 {
@@ -121,12 +121,10 @@ int luat_uart_setup(luat_uart_t *uart)
         wm_uart4_rx_config(WM_IO_PB_05);
         wm_uart4_tx_config(WM_IO_PB_04);
         break;
-#ifdef AIR103
     case TLS_UART_5:
         wm_uart5_rx_config(WM_IO_PA_13);
         wm_uart5_tx_config(WM_IO_PA_12);
         break;
-#endif
     default:
         break;
     }

+ 3 - 3
platform/drivers/timer/wm_timer.c

@@ -33,7 +33,7 @@ struct timer_irq_context {
 
 static struct timer_irq_context timer_context[TLS_TIMER_ID_MAX] = {{0,0}};
 static u8 wm_timer_bitmap = 0;
-
+#if 0
 static void timer_clear_irq(int timer_id)
 {
     volatile u8 i;
@@ -47,7 +47,7 @@ static void timer_clear_irq(int timer_id)
 
     tls_reg_write32(HR_TIMER0_5_CSR, value | TLS_TIMER_INT_CLR(timer_id));
 }
-
+#endif
 static void timer_irq_callback(void *p)
 {
     u8 timer_id;
@@ -136,7 +136,7 @@ u8 tls_timer_create(struct tls_timer_cfg *cfg)
 
     wm_timer_bitmap  |= BIT(i);
     timer_context[i].callback = cfg->callback;
-    timer_context[i].arg = cfg->arg == NULL ? (void*)i : cfg->arg;
+    timer_context[i].arg = cfg->arg;
 
 	tls_sys_clk sysclk;