Ver código fonte

修改地址高低位

xuxinyi 2 meses atrás
pai
commit
7ba2012dd2
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      Core/Src/stm32f1xx_it.c

+ 2 - 2
Core/Src/stm32f1xx_it.c

@@ -308,8 +308,8 @@ void USART2_IRQHandler(void)
         long addr = strtol(hexStr, NULL, 16);
 
         // 拆分为两个字节:高8位和低8位
-        deviceInfo.loraDeviceAddress_H = (addr >> 8) & 0xFF;  // 0xe1
-        deviceInfo.loraDeviceAddress_L = addr & 0xFF;         // 0x16
+        deviceInfo.loraDeviceAddress_L = (addr >> 8) & 0xFF;  // 0xe1
+        deviceInfo.loraDeviceAddress_H = addr & 0xFF;         // 0x16
       }
       memset(rx_buf_uart2, 0, sizeof(rx_buf_uart2));
       // // 清空缓冲区并重新开启DMA接收