咕咕嘎嘎?
This commit is contained in:
parent
d2eaae39e3
commit
8eb03031ea
@ -49,8 +49,8 @@ void MX_USART1_UART_Init(void)
|
||||
huart1.Instance = USART1;
|
||||
huart1.Init.BaudRate = 100000;
|
||||
huart1.Init.WordLength = UART_WORDLENGTH_8B;
|
||||
huart1.Init.StopBits = UART_STOPBITS_1;
|
||||
huart1.Init.Parity = UART_PARITY_NONE;
|
||||
huart1.Init.StopBits = UART_STOPBITS_2;
|
||||
huart1.Init.Parity = UART_PARITY_EVEN;
|
||||
huart1.Init.Mode = UART_MODE_TX_RX;
|
||||
huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
|
||||
huart1.Init.OverSampling = UART_OVERSAMPLING_16;
|
||||
|
||||
@ -330,7 +330,9 @@ TIM1.Channel-PWM\ Generation4\ CH4=TIM_CHANNEL_4
|
||||
TIM1.IPParameters=Channel-PWM Generation4 CH4,Period
|
||||
TIM1.Period=90-1
|
||||
USART1.BaudRate=100000
|
||||
USART1.IPParameters=VirtualMode,BaudRate
|
||||
USART1.IPParameters=VirtualMode,BaudRate,Parity,StopBits
|
||||
USART1.Parity=PARITY_EVEN
|
||||
USART1.StopBits=STOPBITS_2
|
||||
USART1.VirtualMode=VM_ASYNC
|
||||
USART2.IPParameters=VirtualMode
|
||||
USART2.VirtualMode=VM_ASYNC
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -163,7 +163,7 @@
|
||||
<BreakIfRCount>1</BreakIfRCount>
|
||||
<Filename>..\User\module\mr16.c</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression>\\DevCBT6\../User/module/mr16.c\283</Expression>
|
||||
<Expression>\\\../User/module/mr16.c\283</Expression>
|
||||
</Bp>
|
||||
</Breakpoint>
|
||||
<WatchWindow1>
|
||||
@ -720,7 +720,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>User/bsp</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
||||
Binary file not shown.
@ -22,143 +22,14 @@ Dialog DLL: TCM.DLL V1.48.0.0
|
||||
|
||||
<h2>Project:</h2>
|
||||
D:\CUBEMX\MR16\DevCBT6\MDK-ARM\DevCBT6.uvprojx
|
||||
Project File Date: 12/13/2025
|
||||
Project File Date: 12/16/2025
|
||||
|
||||
<h2>Output:</h2>
|
||||
*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\cangming\ARM\ARMCC\Bin'
|
||||
Build target 'DevCBT6'
|
||||
Note: source file '..\User\bsp\gpio.c' - object file renamed from 'DevCBT6\gpio.o' to 'DevCBT6\gpio_1.o'.
|
||||
Note: source file '..\User\bsp\spi.c' - object file renamed from 'DevCBT6\spi.o' to 'DevCBT6\spi_1.o'.
|
||||
compiling ws2812.c...
|
||||
../User/bsp/pwm.h(48): warning: #1-D: last line of file ends without a newline
|
||||
#endif
|
||||
..\User\device\ws2812.c(348): warning: #550-D: variable "statusChanged" was set but never used
|
||||
uint8_t statusChanged = 0;
|
||||
..\User\device\ws2812.c: 2 warnings, 0 errors
|
||||
compiling mr16.c...
|
||||
../User/module/mr16.h(137): warning: #1-D: last line of file ends without a newline
|
||||
#endif
|
||||
../User/bsp/time.h(24): warning: #1295-D: Deprecated declaration BSP_TIME_Get_ms - give arg types
|
||||
uint32_t BSP_TIME_Get_ms();
|
||||
../User/bsp/time.h(26): warning: #1295-D: Deprecated declaration BSP_TIME_Get_us - give arg types
|
||||
uint64_t BSP_TIME_Get_us();
|
||||
../User/bsp/time.h(28): warning: #1295-D: Deprecated declaration BSP_TIME_Get - give arg types
|
||||
uint64_t BSP_TIME_Get();
|
||||
../User/bsp/gpio.h(59): warning: #1-D: last line of file ends without a newline
|
||||
#endif
|
||||
..\User\module\mr16.c(214): warning: #188-D: enumerated type mixed with another type
|
||||
LCD_Init(1);
|
||||
..\User\module\mr16.c(427): warning: #546-D: transfer of control bypasses initialization of:
|
||||
variable "RXheader" (declared at line 441)
|
||||
switch (source) {
|
||||
^
|
||||
..\User\module\mr16.c(761): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? SX1281 Radio Command Reference â•‘\r\n"
|
||||
..\User\module\mr16.c(763): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? â•‘\r\n"
|
||||
..\User\module\mr16.c(764): warning: #870-D: invalid multibyte character sequence
|
||||
"� 📡 MODE CONFIGURATION ║\r\n"
|
||||
..\User\module\mr16.c(765): warning: #870-D: invalid multibyte character sequence
|
||||
"� ───────────────────────────────────────────────────────────────────── ║\r\n"
|
||||
..\User\module\mr16.c(766): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? radio mode <BLE|LORA|GFSK|FLRC> â•‘\r\n"
|
||||
..\User\module\mr16.c(767): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? Switch radio working mode â•‘\r\n"
|
||||
..\User\module\mr16.c(768): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? Example: radio mode LORA â•‘\r\n"
|
||||
..\User\module\mr16.c(769): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? â•‘\r\n"
|
||||
..\User\module\mr16.c(770): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? radio rffreq <Hz> â•‘\r\n"
|
||||
..\User\module\mr16.c(771): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? Set RF frequency in Hz â•‘\r\n"
|
||||
..\User\module\mr16.c(772): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? Example: radio rffreq 2450000000 (2.45GHz) â•‘\r\n"
|
||||
..\User\module\mr16.c(773): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? â•‘\r\n"
|
||||
..\User\module\mr16.c(774): warning: #870-D: invalid multibyte character sequence
|
||||
"� ────────────────────────────────────────────────────────────────────────║\r\n"
|
||||
..\User\module\mr16.c(775): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? âš™ï¸<C3AF> PARAMETER CONFIGURATION â•‘\r\n"
|
||||
..\User\module\mr16.c(776): warning: #870-D: invalid multibyte character sequence
|
||||
"� ───────────────────────────────────────────────────────────────────── ║\r\n"
|
||||
..\User\module\mr16.c(777): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? radio modulation <field> <value> â•‘\r\n"
|
||||
..\User\module\mr16.c(778): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? Configure modulation parameters (mode specific) â•‘\r\n"
|
||||
..\User\module\mr16.c(779): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? Use: radio modulation help for detailed field list â•‘\r\n"
|
||||
..\User\module\mr16.c(780): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? â•‘\r\n"
|
||||
..\User\module\mr16.c(781): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? radio packet <field> <value> â•‘\r\n"
|
||||
..\User\module\mr16.c(782): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? Configure packet parameters (mode specific) â•‘\r\n"
|
||||
..\User\module\mr16.c(783): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? Use: radio packet help for detailed field list â•‘\r\n"
|
||||
..\User\module\mr16.c(784): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? â•‘\r\n"
|
||||
..\User\module\mr16.c(785): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? radio baudrate [index] â•‘\r\n"
|
||||
..\User\module\mr16.c(786): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? Set baudrate for current mode (auto-detect) â•‘\r\n"
|
||||
..\User\module\mr16.c(787): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? No argument: show current baudrates â•‘\r\n"
|
||||
..\User\module\mr16.c(788): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? Use: radio baudrate help for mode-specific values â•‘\r\n"
|
||||
..\User\module\mr16.c(789): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? â•‘\r\n"
|
||||
..\User\module\mr16.c(790): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? radio power <dBm> â•‘\r\n"
|
||||
..\User\module\mr16.c(791): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? Set TX output power â•‘\r\n"
|
||||
..\User\module\mr16.c(792): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? Range: -18 to +13 dBm â•‘\r\n"
|
||||
..\User\module\mr16.c(793): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? Example: radio power 10 â•‘\r\n"
|
||||
..\User\module\mr16.c(794): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? â•‘\r\n"
|
||||
..\User\module\mr16.c(795): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? radio ramptime <us> â•‘\r\n"
|
||||
..\User\module\mr16.c(796): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? Set TX ramp time in microseconds â•‘\r\n"
|
||||
..\User\module\mr16.c(797): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? Values: 2, 4, 6, 8, 10, 12, 16, 20 â•‘\r\n"
|
||||
..\User\module\mr16.c(798): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? Example: radio ramptime 10 â•‘\r\n"
|
||||
..\User\module\mr16.c(799): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? â•‘\r\n"
|
||||
..\User\module\mr16.c(800): warning: #870-D: invalid multibyte character sequence
|
||||
"� ────────────────────────────────────────────────────────────────────────║\r\n"
|
||||
..\User\module\mr16.c(801): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? ℹï¸<C3AF> INFORMATION COMMANDS â•‘\r\n"
|
||||
..\User\module\mr16.c(802): warning: #870-D: invalid multibyte character sequence
|
||||
"� ───────────────────────────────────────────────────────────────────── ║\r\n"
|
||||
..\User\module\mr16.c(803): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? radio modulation â•‘\r\n"
|
||||
..\User\module\mr16.c(804): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? Display current modulation parameters â•‘\r\n"
|
||||
..\User\module\mr16.c(805): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? â•‘\r\n"
|
||||
..\User\module\mr16.c(806): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? radio packet â•‘\r\n"
|
||||
..\User\module\mr16.c(807): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? Display current packet parameters â•‘\r\n"
|
||||
..\User\module\mr16.c(808): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? â•‘\r\n"
|
||||
..\User\module\mr16.c(809): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? radio power / baudrate / ramptime / rffreq â•‘\r\n"
|
||||
..\User\module\mr16.c(810): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? Display current value (omit argument) â•‘\r\n"
|
||||
..\User\module\mr16.c(811): warning: #870-D: invalid multibyte character sequence
|
||||
"â•? â•‘\r\n"
|
||||
..\User\module\mr16.c(1640): warning: #186-D: pointless comparison of unsigned integer with zero
|
||||
if (val < 0 || val > 255) { snprintf(pcWriteBuffer, xWriteBufferLen, "Invalid LoRa Preamble (0-255)\r\n"); return pdFALSE; }
|
||||
..\User\module\mr16.c: 58 warnings, 0 errors
|
||||
linking...
|
||||
Program Size: Code=66228 RO-data=20808 RW-data=304 ZI-data=13544
|
||||
FromELF: creating hex file...
|
||||
"DevCBT6\DevCBT6.axf" - 0 Error(s), 60 Warning(s).
|
||||
"DevCBT6\DevCBT6.axf" - 0 Error(s), 0 Warning(s).
|
||||
|
||||
<h2>Software Packages used:</h2>
|
||||
|
||||
@ -182,7 +53,7 @@ Package Vendor: Keil
|
||||
|
||||
* Component: ARM::CMSIS:CORE:5.4.0
|
||||
Include file: CMSIS\Core\Include\tz_context.h
|
||||
Build Time Elapsed: 00:00:02
|
||||
Build Time Elapsed: 00:00:01
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
Dependencies for Project 'DevCBT6', Target 'DevCBT6': (DO NOT MODIFY !)
|
||||
CompilerVersion: 5060960::V5.06 update 7 (build 960)::.\ARMCC
|
||||
F (startup_stm32f103xb.s)(0x693D296C)(--cpu Cortex-M3 -g --apcs=interwork --pd "__MICROLIB SETA 1" -I ../Drivers/CMSIS/Include
-I.\RTE\_DevCBT6
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
--pd "__UVISION_VERSION SETA 534" --pd "_RTE_ SETA 1" --pd "STM32F10X_MD SETA 1" --pd "_RTE_ SETA 1"
--list startup_stm32f103xb.lst --xref -o devcbt6\startup_stm32f103xb.o --depend devcbt6\startup_stm32f103xb.d)
|
||||
F (startup_stm32f103xb.s)(0x694060AD)(--cpu Cortex-M3 -g --apcs=interwork --pd "__MICROLIB SETA 1" -I ../Drivers/CMSIS/Include
-I.\RTE\_DevCBT6
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
--pd "__UVISION_VERSION SETA 534" --pd "_RTE_ SETA 1" --pd "STM32F10X_MD SETA 1" --pd "_RTE_ SETA 1"
--list startup_stm32f103xb.lst --xref -o devcbt6\startup_stm32f103xb.o --depend devcbt6\startup_stm32f103xb.d)
|
||||
F (../Core/Src/main.c)(0x693C26B5)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM3 -I ../User
-I.\RTE\_DevCBT6
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o devcbt6\main.o --omf_browse devcbt6\main.crf --depend devcbt6\main.d)
|
||||
I (../Core/Inc/main.h)(0x693C26B5)
|
||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x6933D5F1)
|
||||
@ -213,7 +213,7 @@ I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_spi.h)(0x6933D5F1)
|
||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h)(0x6933D5F1)
|
||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x6933D5F1)
|
||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x6933D5F1)
|
||||
F (../Core/Src/usart.c)(0x693C28A0)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM3 -I ../User
-I.\RTE\_DevCBT6
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o devcbt6\usart.o --omf_browse devcbt6\usart.crf --depend devcbt6\usart.d)
|
||||
F (../Core/Src/usart.c)(0x6940320B)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM3 -I ../User
-I.\RTE\_DevCBT6
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o devcbt6\usart.o --omf_browse devcbt6\usart.crf --depend devcbt6\usart.d)
|
||||
I (../Core/Inc/usart.h)(0x693C26B4)
|
||||
I (../Core/Inc/main.h)(0x693C26B5)
|
||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h)(0x6933D5F1)
|
||||
@ -1577,7 +1577,7 @@ I (D:\cangming\ARM\ARMCC\include\stdint.h)(0x5E8E3CC2)
|
||||
I (D:\cangming\ARM\ARMCC\include\stddef.h)(0x5E8E3CC2)
|
||||
I (D:\cangming\ARM\ARMCC\include\string.h)(0x5E8E3CC2)
|
||||
F (..\User\component\user_math.h)(0x693C0DC0)()
|
||||
F (..\User\module\config.c)(0x693C0DC0)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM3 -I ../User
-I.\RTE\_DevCBT6
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o devcbt6\config.o --omf_browse devcbt6\config.crf --depend devcbt6\config.d)
|
||||
F (..\User\module\config.c)(0x69405EC8)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM3 -I ../User
-I.\RTE\_DevCBT6
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o devcbt6\config.o --omf_browse devcbt6\config.crf --depend devcbt6\config.d)
|
||||
I (..\User\module/config.h)(0x693C0DC0)
|
||||
I (D:\cangming\ARM\ARMCC\include\stdint.h)(0x5E8E3CC2)
|
||||
I (..\User\device/sx1281_driver/sx1281.h)(0x693C0DC0)
|
||||
@ -1618,7 +1618,7 @@ I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h)(0x6933D5F1)
|
||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h)(0x6933D5F1)
|
||||
I (D:\cangming\ARM\ARMCC\include\string.h)(0x5E8E3CC2)
|
||||
F (..\User\module\config.h)(0x693C0DC0)()
|
||||
F (..\User\module\mr16.c)(0x693D4C3C)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM3 -I ../User
-I.\RTE\_DevCBT6
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o devcbt6\mr16.o --omf_browse devcbt6\mr16.crf --depend devcbt6\mr16.d)
|
||||
F (..\User\module\mr16.c)(0x693D8AF5)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM3 -I ../User
-I.\RTE\_DevCBT6
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o devcbt6\mr16.o --omf_browse devcbt6\mr16.crf --depend devcbt6\mr16.d)
|
||||
I (../User/module/mr16.h)(0x693C0DC0)
|
||||
I (D:\cangming\ARM\ARMCC\include\stdint.h)(0x5E8E3CC2)
|
||||
I (D:\cangming\ARM\ARMCC\include\stdbool.h)(0x5E8E3CC2)
|
||||
@ -1692,7 +1692,7 @@ I (../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM3/portmacro.h)
|
||||
I (../Middlewares/Third_Party/FreeRTOS/Source/include/mpu_wrappers.h)(0x6933D5F1)
|
||||
I (../Middlewares/Third_Party/FreeRTOS/Source/include/task.h)(0x6933D5F1)
|
||||
I (../Middlewares/Third_Party/FreeRTOS/Source/include/list.h)(0x6933D5F1)
|
||||
F (..\User\task\radio.c)(0x693D42E1)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM3 -I ../User
-I.\RTE\_DevCBT6
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o devcbt6\radio.o --omf_browse devcbt6\radio.crf --depend devcbt6\radio.d)
|
||||
F (..\User\task\radio.c)(0x694060D1)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I ../Core/Inc -I ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I ../Drivers/STM32F1xx_HAL_Driver/Inc -I ../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I ../Drivers/CMSIS/Include -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM3 -I ../User
-I.\RTE\_DevCBT6
-ID:\cangming\ARM\CMSIS\5.7.0\CMSIS\Core\Include
-ID:\cangming\keil\STM32F1xx_DFP\2.0.0\Device\Include
-D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
-o devcbt6\radio.o --omf_browse devcbt6\radio.crf --depend devcbt6\radio.d)
|
||||
I (../User/task/user_task.h)(0x693C0DC0)
|
||||
I (../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.h)(0x6933D5F1)
|
||||
I (D:\cangming\ARM\ARMCC\include\stdint.h)(0x5E8E3CC2)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
752
DevCBT6/README.md
Normal file
752
DevCBT6/README.md
Normal file
@ -0,0 +1,752 @@
|
||||
# MR16 - 2.4GHz 无线通信模块
|
||||
|
||||
|
||||
|
||||
## 产品简介
|
||||
|
||||
**MR16** 是一款高性能 2.4GHz 无线通信模块,基于 **SX1281** 芯片设计,适用于遥控、传感器数据传输等应用场景。
|
||||
|
||||
### 核心特性
|
||||
| 特性 | 规格 |
|
||||
| ------------ | ------------------ |
|
||||
| **无线芯片** | SX1281 (2.4GHz) |
|
||||
| **主控芯片** | STM32F103C8T6 |
|
||||
| **通信协议** | BLE/LoRa/GFSK/FLRC |
|
||||
| **最大距离** | > 1km (开阔环境) |
|
||||
| **数据速率** | 125bps - 2Mbps |
|
||||
| **用户接口** | UART2 + CLI命令行 |
|
||||
| **显示屏** | 240×135 彩色LCD |
|
||||
| **状态指示** | WS2812 RGB LED |
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
||||
## 数据流
|
||||
|
||||
### TX 端 (发送端)
|
||||
|
||||
```
|
||||
用户数据 (UART2)
|
||||
↓
|
||||
MR16_PackTxBuffer() ← 自动添加 TX_ID
|
||||
↓
|
||||
完整数据包
|
||||
↓
|
||||
SX1281 无线射频发送 ← 自动添加 同步字节 + CRC
|
||||
```
|
||||
|
||||
### RX 端 (接收端)
|
||||
|
||||
```
|
||||
SX1281 无线接收 ← 自动校验数据包
|
||||
↓
|
||||
分通道 ← 自动校验数据包TXID (与三个RX_ID之一 匹配)
|
||||
↓
|
||||
输出数据包
|
||||
↓
|
||||
DBUS
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
||||
## 代码结构
|
||||
|
||||
### 文件组织
|
||||
```
|
||||
mr16.c - 主实现文件 (1788行)
|
||||
├─ [PART 1] 核心功能 (MR16 CORE FUNCTIONS)
|
||||
│ ├─ 无线事件回调
|
||||
│ ├─ 系统初始化
|
||||
│ ├─ 主循环
|
||||
│ └─ 数据包处理
|
||||
├─ [PART 2] UI显示 (UI DISPLAY FUNCTIONS)
|
||||
│ ├─ 开机动画
|
||||
│ ├─ 主界面显示
|
||||
│ └─ 状态更新
|
||||
└─ [PART 3] CLI命令 (CLI COMMAND FUNCTIONS)
|
||||
├─ 帮助文本
|
||||
├─ MR16命令处理器
|
||||
├─ Radio命令处理器
|
||||
└─ CLI初始化
|
||||
```
|
||||
|
||||
|
||||
|
||||
## PART 1: 核心功能模块
|
||||
|
||||
### 1.1 数据格式 (Data Format)
|
||||
|
||||
#### 可变长度模式 (VARIABLE)
|
||||
- 触发方式: UART 空闲中断
|
||||
- 长度: 动态,根据实际接收数据
|
||||
- 适用场景: 不定长数据传输
|
||||
- 注意:在VARIABLE模式下,数据包属性中的payloadlenth表示可能的最大数据包长度
|
||||
|
||||
#### 固定长度模式 (FIXED)
|
||||
- 长度: 预定义 (默认122字节)
|
||||
- 可调范围: 1-123 字节 (纯用户数据)
|
||||
- 适用场景: 固定格式数据,如遥控器
|
||||
|
||||
### 1.2 数据包格式
|
||||
|
||||
```
|
||||
完整数据包结构 (最大127字节):
|
||||
┌─────────┬──────────────────┬─────────┐
|
||||
│ Header │ User Data │ CRC │
|
||||
│ 2 bytes │ 1-123 bytes │ 2 bytes │
|
||||
└─────────┴──────────────────┴─────────┘
|
||||
```
|
||||
|
||||
#### Header (2字节)
|
||||
- Byte 0: TX_ID 高字节
|
||||
- Byte 1: TX_ID 低字节
|
||||
- 用途: 识别发送端,支持多机接收
|
||||
|
||||
#### User Data (1-123字节)
|
||||
- 用户纯数据,不包含 Header 和 CRC
|
||||
- VARIABLE 模式: 实际接收长度
|
||||
- FIXED 模式: 配置的 `fixedLength` 值
|
||||
- **⚠️ 不同协议的数据长度限制详见下表**
|
||||
|
||||
#### CRC (2字节)
|
||||
- 算法: CRC16
|
||||
- 校验范围: Header + User Data
|
||||
- Byte N+2: CRC 高字节
|
||||
- Byte N+3: CRC 低字节
|
||||
|
||||
---
|
||||
|
||||
### **各协议用户数据长度限制**
|
||||
|
||||
根据 SX1281 硬件限制,不同协议支持的最大用户数据长度不同:
|
||||
|
||||
| 协议 | 硬件最大总包长 | 最大用户数据 |
|
||||
|------|---|---|
|
||||
| **FLRC** | 124字节 | **120字节** |
|
||||
| **GFSK** | 252字节 | **248字节** |
|
||||
| **LoRa** | 253字节 | **249字节** |
|
||||
|
||||
#### 建议将数据包长度留出百分之5左右的裕度确保射频稳定工作
|
||||
|
||||
### 1.3 失控保护
|
||||
|
||||
**仅在 RX 端启用**
|
||||
|
||||
#### 触发条件
|
||||
- 100ms 未接收到有效数据
|
||||
|
||||
#### 安全帧格式
|
||||
```
|
||||
安全帧结构:
|
||||
┌─────────┬────────────────────────┬─────────┐
|
||||
│ Header │ 0xFF 0x00 0xFF 0x00 │ 0x00... │
|
||||
│ 2 bytes │ 4 bytes (安全标识) │ 填充0 │
|
||||
└─────────┴────────────────────────┴─────────┘
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## PART 2: UI 显示模块
|
||||
|
||||
### 2.1 显示界面
|
||||
|
||||
#### 开机动画 (`MR16_UI_PowerON`)
|
||||
- MR16 Logo
|
||||
- "Initializing..." 提示
|
||||
|
||||
#### 主界面 (`MR16_UI_Home`)
|
||||
|
||||
**TX 模式显示:**
|
||||
```
|
||||
┌──────────────────────────────┐
|
||||
│ MR16 Status [TX] │
|
||||
├──────────────────────────────┤
|
||||
│ Mode: FIXED Power: 10dBm │
|
||||
│ Radio: FLRC DataLen: 122B│
|
||||
│ Freq: 2450MHz │
|
||||
│ TXID: 0x1234 │
|
||||
└──────────────────────────────┘
|
||||
```
|
||||
|
||||
**RX 模式显示:**
|
||||
```
|
||||
┌──────────────────────────────┐
|
||||
│ MR16 Status [RX] │
|
||||
├──────────────────────────────┤
|
||||
│ Mode: FIXED rxcount: │
|
||||
│ Radio: FLRC ch1: 1234 │
|
||||
│ Freq: 2450MHz ch2: 567 │
|
||||
│ rxid: 0x1234 0x5678 0x9ABC │
|
||||
└──────────────────────────────┘
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## PART 3: CLI 命令模块
|
||||
|
||||
### 3.1 MR16 系统命令
|
||||
|
||||
```
|
||||
mr16 <subcmd> [args] - MR16 系统控制命令
|
||||
```
|
||||
|
||||
#### 配置管理
|
||||
- `save` - 保存当前配置到Flash
|
||||
- `get` - 从Flash加载配置
|
||||
- `reset` - 恢复默认配置
|
||||
- `mode <VARIABLE|FIXED>` - 设置/查看数据格式
|
||||
- `fixedlen <1-123>` - 设置用户数据长度(仅FIXED模式)
|
||||
- `power <-18 to +13>` - 设置/查看TX功率(dBm)
|
||||
|
||||
#### 接收ID配置
|
||||
- `rxid1 <hex>` - 设置/查看RX ID通道1
|
||||
- `rxid2 <hex>` - 设置/查看RX ID通道2
|
||||
- `rxid3 <hex>` - 设置/查看RX ID通道3
|
||||
- `rxid` - 显示所有三个RX ID
|
||||
|
||||
#### 操作命令
|
||||
- `tx` - 启动发送模式
|
||||
- `rx` - 启动连续接收模式
|
||||
|
||||
#### 信息显示
|
||||
- `show` - 显示所有MR16配置
|
||||
- `mode help` - 显示模式详细信息
|
||||
|
||||
#### 使用示例
|
||||
```bash
|
||||
mr16 mode FIXED # 切换到固定长度模式
|
||||
mr16 fixedlen 32 # 设置用户数据长度为32字节
|
||||
mr16 power 10 # 设置TX功率为+10dBm
|
||||
mr16 rxid1 0x1234 # 设置RX ID通道1为0x1234
|
||||
mr16 tx # 启动发送
|
||||
mr16 rx # 启动接收
|
||||
```
|
||||
|
||||
#### 重要说明
|
||||
1. **fixedlen设置的是仅用户数据长度**,不包含总包长度
|
||||
2. MR16自动添加:Header(2字节) + 用户数据 + CRC(2字节)
|
||||
3. 有效RX ID范围:0x0001 到 0xFFFE(0x0000和0xFFFF为保留值)
|
||||
|
||||
---
|
||||
|
||||
### 3.2 Radio 无线命令
|
||||
|
||||
```
|
||||
radio <subcmd> [args] - SX1281 无线控制命令
|
||||
```
|
||||
|
||||
#### 基本操作命令
|
||||
- `mode <BLE|LORA|GFSK|FLRC>` - 更改无线工作模式
|
||||
- `rffreq <Hz>` - 设置RF频率(单位: Hz)
|
||||
- `power <dBm>` - 设置TX功率(-18 到 +13 dBm)
|
||||
- `ramptime <us>` - 设置上升时间: 2, 4, 6, 8, 10, 12, 16, 20 微秒
|
||||
- `baudrate [index]` - 设置当前模式的波特率
|
||||
|
||||
#### 参数配置命令
|
||||
- `modulation <field> <value>` - 设置调制参数
|
||||
- **BLE/GFSK可用字段**: `br_bw`, `modindex`, `shaping`
|
||||
- **LoRa可用字段**: `sf`, `bw`, `cr`
|
||||
- **FLRC可用字段**: `br_bw`, `cr`, `shaping`
|
||||
- `packet <field> <value>` - 设置数据包参数
|
||||
- **BLE可用字段**: `ConnectionState`, `CrcField`, `BlePacketType`, `Whitening`
|
||||
- **GFSK可用字段**: `Preamble`, `SyncWordLength`, `SyncWordMatch`, `SyncWord1`, `SyncWord2`, `SyncWord3`, `SyncWord`, `Header`, `Payload`, `Crc`, `Whitening`
|
||||
- **LoRa可用字段**: `Preamble`, `Header`, `Payload`, `Crc`, `InvertIQ`
|
||||
- **FLRC可用字段**: 与GFSK相同(SyncWord最大4字节)
|
||||
|
||||
#### 详细帮助命令
|
||||
- `modulation help` - 显示调制参数详细帮助
|
||||
- `packet help` - 显示数据包参数详细帮助
|
||||
- `baudrate help` - 显示波特率配置详细信息
|
||||
|
||||
#### 使用示例
|
||||
```bash
|
||||
radio mode LORA # 切换到LoRa模式
|
||||
radio rffreq 2400000000 # 设置频率为2.4GHz
|
||||
radio power 10 # 设置TX功率为+10dBm
|
||||
radio baudrate 2 # 为当前模式设置波特率索引2
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#### 调制参数 (modulation) 完整说明
|
||||
|
||||
**br_bw - 比特率与带宽**
|
||||
```
|
||||
0x04 = 2.0Mbps / 2.4MHz 0x28 = 1.6Mbps / 2.4MHz
|
||||
0x4C = 1.0Mbps / 2.4MHz 0x45 = 1.0Mbps / 1.2MHz
|
||||
0x70 = 0.8Mbps / 2.4MHz 0x69 = 0.8Mbps / 1.2MHz
|
||||
0x8D = 0.5Mbps / 1.2MHz 0x86 = 0.5Mbps / 0.6MHz
|
||||
0xB1 = 0.4Mbps / 1.2MHz 0xAA = 0.4Mbps / 0.6MHz
|
||||
0xCE = 0.25Mbps / 0.6MHz 0xC7 = 0.25Mbps / 0.3MHz
|
||||
0xEF = 0.125Mbps / 0.3MHz
|
||||
```
|
||||
|
||||
**modindex - 调制指数**
|
||||
```
|
||||
0 = 0.35 1 = 0.50 2 = 0.75 3 = 1.00
|
||||
4 = 1.25 5 = 1.50 6 = 1.75 7 = 2.00
|
||||
8 = 2.25 9 = 2.50 10 = 2.75 11 = 3.00
|
||||
12 = 3.25 13 = 3.50 14 = 3.75 15 = 4.00
|
||||
```
|
||||
|
||||
**shaping - 调制整形**
|
||||
```
|
||||
0x00 = OFF (无整形)
|
||||
0x10 = BT=1.0 (高斯整形)
|
||||
0x20 = BT=0.5 (高斯整形)
|
||||
```
|
||||
|
||||
##### LoRa模式参数
|
||||
|
||||
**sf - 扩频因子**
|
||||
```
|
||||
0x50 = SF5 0x60 = SF6 0x70 = SF7 0x80 = SF8
|
||||
0x90 = SF9 0xA0 = SF10 0xB0 = SF11 0xC0 = SF12
|
||||
```
|
||||
|
||||
**bw - 带宽**
|
||||
```
|
||||
0x34 = 200kHz 0x26 = 400kHz 0x18 = 800kHz 0x0A = 1600kHz
|
||||
```
|
||||
|
||||
**cr - 编码率**
|
||||
```
|
||||
0x01 = 4/5 0x02 = 4/6
|
||||
0x03 = 4/7 0x04 = 4/8
|
||||
0x05 = Long Interleaving 4/5 0x06 = Long Interleaving 4/6
|
||||
0x07 = Long Interleaving 4/7
|
||||
```
|
||||
|
||||
##### FLRC模式参数
|
||||
|
||||
**br_bw - 比特率与带宽**
|
||||
```
|
||||
0x04 = 2.6Mbps / 2.4MHz 0x28 = 2.08Mbps / 2.4MHz
|
||||
0x45 = 1.3Mbps / 1.2MHz 0x69 = 1.04Mbps / 1.2MHz
|
||||
0x86 = 0.65Mbps / 0.6MHz 0xAA = 0.52Mbps / 0.6MHz
|
||||
0xC7 = 0.325Mbps / 0.3MHz 0xEB = 0.26Mbps / 0.3MHz
|
||||
```
|
||||
|
||||
**cr - 编码率**
|
||||
```
|
||||
0x00 = CR_1/2 0x02 = CR_3/4 0x04 = CR_1/0
|
||||
```
|
||||
|
||||
**shaping - 调制整形**
|
||||
```
|
||||
0x00 = OFF (无整形)
|
||||
0x10 = BT=1.0 (高斯整形)
|
||||
0x20 = BT=0.5 (高斯整形)
|
||||
```
|
||||
|
||||
**使用示例:**
|
||||
```bash
|
||||
radio modulation br_bw 0x4C # 设置GFSK比特率为1.0Mbps / 2.4MHz
|
||||
radio modulation sf 0x70 # 设置LoRa扩频因子为SF7
|
||||
radio modulation br_bw 0x45 # 设置FLRC比特率为1.3Mbps / 1.2MHz
|
||||
```
|
||||
|
||||
**注意:** 更改立即生效。使用`radio modulation`查看当前值。
|
||||
|
||||
#### 数据包参数 (packet) 详细说明
|
||||
|
||||
##### BLE模式参数
|
||||
|
||||
**ConnectionState - 连接状态**
|
||||
```
|
||||
0 = MASTER_SLAVE 1 = ADVERTISER 2 = TX_TEST
|
||||
3 = RX_TEST 4 = RXTX_TEST
|
||||
```
|
||||
|
||||
**CrcField - CRC字段配置**
|
||||
```
|
||||
0 = OFF 1 = CRC_3B (3字节CRC)
|
||||
```
|
||||
|
||||
**BlePacketType - BLE数据包类型**
|
||||
```
|
||||
0 = PRBS_9 1 = PRBS_15 2 = EYELONG_1_0 3 = EYELONG_0_1
|
||||
4 = EYESHORT_1_0 5 = EYESHORT_0_1 6 = ALL_1 7 = ALL_0
|
||||
```
|
||||
|
||||
**Whitening - 白化模式**
|
||||
```
|
||||
0x00 = ON 0x08 = OFF
|
||||
```
|
||||
|
||||
##### GFSK模式参数
|
||||
|
||||
**Preamble - 前导码长度**
|
||||
```
|
||||
0x00 = 4bits 0x10 = 8bits 0x20 = 12bits 0x30 = 16bits
|
||||
0x40 = 20bits 0x50 = 24bits 0x60 = 28bits 0x70 = 32bits
|
||||
```
|
||||
|
||||
**SyncWordLength - 同步字长度**
|
||||
```
|
||||
0x00 = 1byte 0x02 = 2bytes 0x04 = 3bytes
|
||||
0x06 = 4bytes 0x08 = 5bytes
|
||||
```
|
||||
|
||||
**SyncWordMatch - 同步字匹配**
|
||||
```
|
||||
0x00 = OFF 0x10 = 1 0x20 = 2 0x30 = 1_2
|
||||
0x40 = 3 0x50 = 1_3 0x60 = 2_3 0x70 = 1_2_3
|
||||
```
|
||||
|
||||
**SyncWord1/2/3 - 设置同步字字节**
|
||||
- 格式: `<hex_bytes>` (例如: 0x12345678)
|
||||
- GFSK最大5字节
|
||||
- 使用`radio packet SyncWord`显示所有已配置的同步字
|
||||
|
||||
**Header - 包头类型**
|
||||
```
|
||||
0x00 = VARIABLE (可变长度) 0x20 = FIXED (固定长度)
|
||||
```
|
||||
|
||||
**Payload - 载荷长度**
|
||||
- 范围: 1-255 字节
|
||||
|
||||
**Crc - CRC长度**
|
||||
```
|
||||
0x00 = OFF 0x10 = 1byte 0x20 = 2bytes 0x30 = 3bytes
|
||||
```
|
||||
|
||||
**Whitening - 白化模式**
|
||||
```
|
||||
0x00 = ON 0x08 = OFF
|
||||
```
|
||||
|
||||
##### LoRa模式参数
|
||||
|
||||
**Preamble - 前导码符号数**
|
||||
- 范围: 0-255
|
||||
|
||||
**Header - 包头类型**
|
||||
```
|
||||
0x00 = VARIABLE/EXPLICIT (可变长度/显式)
|
||||
0x80 = FIXED/IMPLICIT (固定长度/隐式)
|
||||
```
|
||||
|
||||
**Payload - 载荷长度**
|
||||
- 范围: 1-255 字节
|
||||
|
||||
**Crc - CRC模式**
|
||||
```
|
||||
0x00 = OFF 0x20 = ON
|
||||
```
|
||||
|
||||
**InvertIQ - IQ反转**
|
||||
```
|
||||
0x40 = NORMAL (正常) 0x00 = INVERTED (反转)
|
||||
```
|
||||
|
||||
##### FLRC模式参数
|
||||
|
||||
与GFSK大部分参数相同
|
||||
|
||||
**SyncWord1/2/3 - 设置同步字字节**
|
||||
- FLRC最大4字节
|
||||
|
||||
**使用示例:**
|
||||
```bash
|
||||
radio packet Payload 64 # 设置载荷长度为64字节
|
||||
radio packet Crc 0x20 # 启用2字节CRC
|
||||
radio packet SyncWord1 0x1234 # 设置同步字1为0x1234
|
||||
radio packet SyncWord # 显示所有同步字
|
||||
```
|
||||
|
||||
**注意:** 使用`radio packet`不带参数可查看当前参数。
|
||||
|
||||
#### 波特率配置 (baudrate) 详细说明
|
||||
|
||||
##### BLE模式波特率
|
||||
```
|
||||
Index 0 = 250 Kbps
|
||||
Index 1 = 500 Kbps
|
||||
Index 2 = 1 Mbps
|
||||
```
|
||||
|
||||
##### LoRa模式波特率
|
||||
```
|
||||
Index 0 = 216 bps
|
||||
Index 1 = 1 Kbps
|
||||
Index 2 = 5 Kbps
|
||||
Index 3 = 10 Kbps
|
||||
Index 4 = 20 Kbps
|
||||
Index 5 = 61 Kbps
|
||||
Index 6 = 127 Kbps
|
||||
Index 7 = 203 Kbps
|
||||
```
|
||||
|
||||
##### GFSK模式波特率
|
||||
```
|
||||
Index 0 = 125 Kbps
|
||||
Index 1 = 250 Kbps
|
||||
Index 2 = 500 Kbps
|
||||
Index 3 = 1 Mbps
|
||||
```
|
||||
|
||||
##### FLRC模式波特率
|
||||
```
|
||||
Index 0 = 130 Kbps
|
||||
Index 1 = 260 Kbps
|
||||
Index 2 = 520 Kbps
|
||||
Index 3 = 1040 Kbps
|
||||
```
|
||||
|
||||
**使用示例:**
|
||||
```bash
|
||||
radio baudrate # 显示当前所有模式的波特率
|
||||
radio baudrate 2 # 为当前模式设置波特率索引2
|
||||
```
|
||||
|
||||
**重要说明:**
|
||||
1. 波特率索引必须对当前无线模式有效
|
||||
2. 更高的波特率提供更快的数据速率但会减少传输距离
|
||||
3. 更低的波特率增加传输距离但会降低数据速率
|
||||
|
||||
#### 配置示例
|
||||
|
||||
**配置 FLRC模式 :**
|
||||
|
||||
```bash
|
||||
radio mode FLRC # 切换到FLRC模式
|
||||
radio rffreq 2450000000 # 设置频率2450MHz
|
||||
radio power 10 # 设置功率+10dBm
|
||||
radio ramptime 10 # 设置上升时间10us
|
||||
radio baudrate 2 # 设置波特率索引2 (520Kbps)
|
||||
radio modulation br_bw 0x45 # 1.3Mbps / 1.2MHz
|
||||
radio modulation cr 0x00 # 编码率CR_1/2
|
||||
radio modulation shaping 0x10 # BT=1.0高斯整形
|
||||
radio packet Preamble 0x30 # 16bits前导码
|
||||
radio packet Payload 114 # 载荷114字节
|
||||
radio packet Crc 0x20 # 2字节CRC
|
||||
mr16 mode FIXED # 固定长度模式
|
||||
mr16 fixedlen 110 # 用户数据110字节
|
||||
mr16 save # 保存配置
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 3.3 命令特性
|
||||
|
||||
- **不区分大小写**
|
||||
- **参数自动解析**: 支持十进制、十六进制 (0x前缀)
|
||||
- **帮助系统**: 所有命令支持 `help` 子命令
|
||||
- **实时生效**: 参数修改后立即更新硬件
|
||||
- **自动刷新**: 参数变更后自动更新 LCD 显示
|
||||
- **手动保存**: 需要手动使用 `mr16 save` 命令写入flash
|
||||
|
||||
---
|
||||
|
||||
### 默认配置
|
||||
```c
|
||||
/* MR16基本参数 */
|
||||
format = MR16_FORMAT_VARIABLE // 固定长度模式
|
||||
fixedLength = 110 // 用户数据长度110字节
|
||||
TX_ID = 0x0001 // 发送端ID
|
||||
RX_ID[0] = 0x0001 // 接收端ID通道1
|
||||
RX_ID[1] = 0x0002 // 接收端ID通道2
|
||||
RX_ID[2] = 0x0003 // 接收端ID通道3
|
||||
RadioRole = RadioRoleTX // 默认发送端模式
|
||||
|
||||
/* 射频基本参数 */
|
||||
radioMode = RADIOMODE_FLRC // FLRC模式
|
||||
rfFrequency = 2426000000 // 频率2426MHz
|
||||
txOutputPower = 13 // 发射功率+13dBm
|
||||
rampTime = RADIO_RAMP_02_US // 上升时间2us
|
||||
|
||||
/* 波特率索引 */
|
||||
baudrate.ble = RF_BAUDRATE_BLE_1M // BLE: 1Mbps
|
||||
baudrate.lora = RF_BAUDRATE_LORA_005K // LoRa: 5Kbps
|
||||
baudrate.gfks = RF_BAUDRATE_GFSK_125K // GFSK: 125Kbps
|
||||
baudrate.flrc = RF_BAUDRATE_FLRC_130K // FLRC: 130Kbps
|
||||
|
||||
/* BLE调制参数 */
|
||||
BLE.BitrateBandwidth = GFS_BLE_BR_1_000_BW_2_4 // 1.0Mbps / 2.4MHz
|
||||
BLE.ModulationIndex = GFS_BLE_MOD_IND_0_50 // 调制指数0.50
|
||||
BLE.ModulationShaping = RADIO_MOD_SHAPING_BT_0_5 // BT=0.5高斯整形
|
||||
|
||||
/* BLE数据包参数 */
|
||||
BLE.BlePacketType = BLE_EYELONG_1_0 // Eye pattern长序列1_0
|
||||
BLE.ConnectionState = BLE_ADVERTISER // 广播模式
|
||||
BLE.CrcField = BLE_CRC_3B // 3字节CRC
|
||||
BLE.Whitening = RADIO_WHITENING_ON // 启用白化
|
||||
|
||||
/* LoRa调制参数 */
|
||||
LoRa.SpreadingFactor = LORA_SF12 // 扩频因子SF12
|
||||
LoRa.Bandwidth = LORA_BW_0200 // 带宽200kHz
|
||||
LoRa.CodingRate = LORA_CR_LI_4_7 // 编码率4/7 (Long Interleaving)
|
||||
|
||||
/* LoRa数据包参数 */
|
||||
LoRa.PreambleLength = 12 // 前导码12符号
|
||||
LoRa.HeaderType = LORA_PACKET_VARIABLE_LENGTH // 可变长度
|
||||
LoRa.PayloadLength = BUFFER_SIZE // 载荷长度
|
||||
LoRa.CrcMode = LORA_CRC_ON // 启用CRC
|
||||
LoRa.InvertIQ = LORA_IQ_NORMAL // 正常IQ
|
||||
|
||||
/* GFSK调制参数 */
|
||||
GFSK.BitrateBandwidth = GFS_BLE_BR_0_125_BW_0_3 // 0.125Mbps / 0.3MHz
|
||||
GFSK.ModulationIndex = GFS_BLE_MOD_IND_0_50 // 调制指数0.50
|
||||
GFSK.ModulationShaping = RADIO_MOD_SHAPING_BT_0_5 // BT=0.5高斯整形
|
||||
|
||||
/* GFSK数据包参数 */
|
||||
GFSK.PreambleLength = PREAMBLE_LENGTH_32_BITS // 32bits前导码
|
||||
GFSK.SyncWordLength = GFS_SYNCWORD_LENGTH_5_BYTE // 5字节同步字
|
||||
GFSK.SyncWordMatch = RADIO_RX_MATCH_SYNCWORD_1 // 匹配同步字1
|
||||
GFSK.HeaderType = RADIO_PACKET_VARIABLE_LENGTH // 可变长度
|
||||
GFSK.PayloadLength = BUFFER_SIZE // 载荷长度
|
||||
GFSK.CrcLength = RADIO_CRC_3_BYTES // 3字节CRC
|
||||
GFSK.Whitening = RADIO_WHITENING_ON // 启用白化
|
||||
|
||||
/* FLRC调制参数 */
|
||||
FLRC.BitrateBandwidth = FLRC_BR_0_260_BW_0_3 // 0.26Mbps / 0.3MHz
|
||||
FLRC.CodingRate = FLRC_CR_1_2 // 编码率1/2
|
||||
FLRC.ModulationShaping = RADIO_MOD_SHAPING_BT_1_0 // BT=1.0高斯整形
|
||||
|
||||
/* FLRC数据包参数 */
|
||||
FLRC.PreambleLength = PREAMBLE_LENGTH_32_BITS // 32bits前导码
|
||||
FLRC.SyncWordLength = FLRC_SYNCWORD_LENGTH_4_BYTE // 4字节同步字
|
||||
FLRC.SyncWordMatch = RADIO_RX_MATCH_SYNCWORD_1 // 匹配同步字1
|
||||
FLRC.HeaderType = RADIO_PACKET_VARIABLE_LENGTH // 可变长度
|
||||
FLRC.PayloadLength = BUFFER_SIZE // 载荷长度
|
||||
FLRC.CrcLength = RADIO_CRC_3_BYTES // 3字节CRC
|
||||
FLRC.Whitening = RADIO_WHITENING_OFF // 禁用白化
|
||||
|
||||
/* 同步字默认值 */
|
||||
GFSK.SyncWord1 = 0x12 0x34 0x56 0x78 0x9A
|
||||
GFSK.SyncWord2 = 0x23 0x45 0x67 0x89 0xAB
|
||||
GFSK.SyncWord3 = 0x34 0x56 0x78 0x9A 0xBC
|
||||
FLRC.SyncWord1 = 0x12 0x23 0x34 0x45
|
||||
FLRC.SyncWord2 = 0x56 0x67 0x78 0x89
|
||||
FLRC.SyncWord3 = 0x9A 0xAB 0xBC 0xCD
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 性能指标
|
||||
|
||||
| 参数 | 值 |
|
||||
| -------------- | --------------- |
|
||||
| 最大数据包长度 | 127 字节 |
|
||||
| 最大用户数据 | 123 字节 |
|
||||
| DBUS 输出频率 | 71Hz (14ms间隔) |
|
||||
| 失控检测延迟 | 100ms |
|
||||
| UI 刷新频率 | 1Hz (RX模式) |
|
||||
| 命令响应 | <10ms |
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ 注意事项
|
||||
|
||||
### · 数据长度限制
|
||||
|
||||
**根据不同协议,用户数据长度有严格限制:**
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────┐
|
||||
│ 各协议数据长度对照表 │
|
||||
├─────────────────────────────────────────────────────────────────┤
|
||||
│ FLRC: 最大 120 字节 | 推荐 ≤ 110 字节 │
|
||||
│ GFSK: 最大 248 字节 | 推荐 ≤ 240 字节 │
|
||||
│ LoRa: 最大 249 字节 | 推荐 ≤ 240 字节 │
|
||||
└─────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
|
||||
|
||||
### · ID 配置规则
|
||||
|
||||
| 规则 | 说明 |
|
||||
|------|------|
|
||||
| **有效范围** | `0x0001` - `0xFFFE` |
|
||||
| **保留值** | `0x0000` 和 `0xFFFF` (禁用通道) |
|
||||
| **TX_ID** | 发送端唯一标识 |
|
||||
| **RX_ID** | 接收端最多配置3个,自动匹配 |
|
||||
| **多机通信** | 一个TX可以被多个RX接收 一个RX可以接收至多3个TX|
|
||||
|
||||
```bash
|
||||
# ❌ 无效配置
|
||||
mr16 rxid1 0x0000 # 保留值,无效
|
||||
mr16 rxid1 0xFFFF # 保留值,无效
|
||||
|
||||
# ✅ 有效配置
|
||||
mr16 rxid1 0x1234 # 有效
|
||||
mr16 rxid2 0x5678 # 有效
|
||||
mr16 rxid3 0x9ABC # 有效
|
||||
```
|
||||
|
||||
|
||||
|
||||
### · 失控保护
|
||||
|
||||
| 特性 | 说明 |
|
||||
|------|------|
|
||||
| **启用范围** | 仅RX端 |
|
||||
| **触发条件** | 100ms 未接收有效数据 |
|
||||
| **安全帧标识** | `0xFF 0x00 0xFF 0x00` (4字节) |
|
||||
|
||||
**安全帧示例:**
|
||||
```
|
||||
接收无效 100ms → 自动生成安全帧
|
||||
┌─────────┬────────────────────┬──────────────────┐
|
||||
│ TX_ID │ 0xFF 0x00 0xFF 0x00│ 剩余数据填充0x00 │
|
||||
│ 2 bytes │ 4 bytes │ 变长 │
|
||||
└─────────┴────────────────────┴──────────────────┘
|
||||
```
|
||||
|
||||
**下游应用处理:**
|
||||
```c
|
||||
// 检测安全帧
|
||||
if (data[2]==0xFF && data[3]==0x00 && data[4]==0xFF && data[5]==0x00) {
|
||||
// RC失控,执行安全动作
|
||||
motor_stop();
|
||||
printf("RC Failsafe Triggered!\n");
|
||||
}
|
||||
```
|
||||
|
||||
⚠️ **避免冲突**: 正常数据不应包含连续的 `0xFF 0x00 0xFF 0x00` 模式
|
||||
|
||||
|
||||
|
||||
### · 通信要求
|
||||
|
||||
> **重要提醒**:发送端和接收端必须配置完全一致,否则无法通信!
|
||||
|
||||
| 参数 | 命令 | 说明 | 示例 |
|
||||
| ----------------- | ----------------------- | --------------------------- | -------------------------- |
|
||||
| **1. 无线协议** | `radio mode <协议>` | 双方必须使用相同协议 | `radio mode FLRC` |
|
||||
| **2. 波特率** | `radio baudrate <索引>` | 同协议下必须相同 | `radio baudrate 2` |
|
||||
| **3. 调制属性** | `radio modulation ...` | 关键项必须一致 | `radio modulation sf 0x70` |
|
||||
| **4. 数据包属性** | `radio packet ...` | 关键项必须一致/强烈建议一致 | `radio packet Preamble 8` |
|
||||
| **5. 中心频率** | `radio channel <MHz>` | 工作频率必须一致 | `radio channel 2450` |
|
||||
| **6. 设备ID** | `mr16 txid/rxid <ID>` | TX端ID = RX端ID | `mr16 txid 0x1234` |
|
||||
|
||||
> 说明:
|
||||
>
|
||||
> 文档中的 `radio baudrate` 列表为开发者提供的若干示例调制参数预设,便于快速配置。用户也可以通过 `radio modulation` 命令自行精细配置调制属性。为了确保通信成功, **调制属性 (modulation )**和 **包属性()** 必须在发送端和接收端保持一致。
|
||||
|
||||
###
|
||||
|
||||
---
|
||||
|
||||
## 开发者信息
|
||||
|
||||
- **版本**: 2.0
|
||||
- **最后更新**: 2024-12-09
|
||||
- **开发团队**: MR16 Development Team
|
||||
|
||||
## 相关文件
|
||||
- `mr16.c` - 主实现文件
|
||||
- `mr16.h` - 头文件定义
|
||||
- `config.c` - 配置管理
|
||||
- `sx1281_driver.c` - SX1281 驱动
|
||||
- `lcd.c` - LCD 驱动
|
||||
|
||||
---
|
||||
|
||||
**文档结束**
|
||||
@ -298,7 +298,7 @@ void Config_SetDefaults(void) {
|
||||
robot_config.mr16.RX_ID[0] = 0x0001;
|
||||
robot_config.mr16.RX_ID[1] = 0x0002;
|
||||
robot_config.mr16.RX_ID[2] = 0x0003;
|
||||
robot_config.mr16.format = MR16_FORMAT_FIXED; /* 默认使用固定长度格式 */
|
||||
robot_config.mr16.format = MR16_FORMAT_VARIABLE; /* 默认使用固定长度格式 */
|
||||
robot_config.mr16.fixedLength = MR16_DEFAULT_FIXED_LEN; /* 默认14字节(用户数据+CRC) */
|
||||
robot_config.mr16.radioParams.RadioRole = RadioRoleTX;
|
||||
/* Radio defaults */
|
||||
|
||||
@ -754,138 +754,261 @@ int8_t MR16_CLI_Init(void) {
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
CLI Help Text Documentation
|
||||
Optimized CLI Help Texts (English only for maximum compatibility)
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
/* Radio Command Help */
|
||||
static const char radio_help_en[] =
|
||||
"============================================================================\r\n"
|
||||
"radio <subcmd> [args] - SX1281 radio control\r\n"
|
||||
"----------------------------------------------------------------------------\r\n"
|
||||
"Mode Configuration:\r\n"
|
||||
" mode <BLE|LORA|GFSK|FLRC> - Change working mode\r\n"
|
||||
" rffreq <Hz> - Set RF frequency\r\n"
|
||||
"----------------------------------------------------------------------------\r\n"
|
||||
"==============================================================================\r\n"
|
||||
"radio <subcmd> [args] - SX1281 Radio Control Commands\r\n"
|
||||
"==============================================================================\r\n"
|
||||
"Basic Operation Commands:\r\n"
|
||||
" mode <BLE|LORA|GFSK|FLRC> - Change radio working mode\r\n"
|
||||
" rffreq <Hz> - Set RF frequency in Hz\r\n"
|
||||
" power <dBm> - Set TX power (-18 to +13 dBm)\r\n"
|
||||
" ramptime <us> - Set ramp time: 2,4,6,8,10,12,16,20 microseconds\r\n"
|
||||
" baudrate [index] - Set baudrate for current mode\r\n"
|
||||
"\r\n"
|
||||
"Parameter Configuration:\r\n"
|
||||
" modulation <field> <value> - Set modulation parameters\r\n"
|
||||
" packet <field> <value> - Set packet parameters\r\n"
|
||||
" baudrate [index] - Set baudrate (auto-detect mode)\r\n"
|
||||
" power <dBm> - Set TX power (-18..+13)\r\n"
|
||||
" ramptime <us> - Set ramp time (2|4|6|8|10|12|16|20)\r\n"
|
||||
"----------------------------------------------------------------------------\r\n"
|
||||
"Operation Commands:\r\n"
|
||||
" tx | rx - TX/RX operations\r\n"
|
||||
"----------------------------------------------------------------------------\r\n"
|
||||
"Help Commands:\r\n"
|
||||
" modulation help | packet help - Show detailed help\r\n"
|
||||
" baudrate help - Show baudrate details\r\n"
|
||||
"============================================================================\r\n";
|
||||
|
||||
static const char modulation_help[] =
|
||||
"============================================================================================================\r\n"
|
||||
"modulation <field> <value> - Set modulation parameters\r\n"
|
||||
" BLE/GFSK fields:\r\n"
|
||||
" br_bw : 0x04(2.0M/2.4M)||0x28(1.6M/2.4M)||0x4C(1.0M/2.4M)||0x45(1.0M/1.2M)\r\n"
|
||||
" 0x70(0.8M/2.4M)||0x69(0.8M/1.2M)||0x8D(0.5M/1.2M)||0x86(0.5M/0.6M)\r\n"
|
||||
" 0xB1(0.4M/1.2M)||0xAA(0.4M/0.6M)||0xCE(0.25M/0.6M)||0xC7(0.25M/0.3M)||0xEF(0.125M/0.3M)\r\n"
|
||||
" modindex : 0(0.35)||1(0.50)||2(0.75)||3(1.00)||4(1.25)||5(1.50)||6(1.75)||7(2.00)\r\n"
|
||||
" 8(2.25)||9(2.50)||10(2.75)||11(3.00)||12(3.25)||13(3.50)||14(3.75)||15(4.00)\r\n"
|
||||
" shaping : 0x00(OFF)||0x10(BT_1_0)||0x20(BT_0_5)\r\n"
|
||||
" LORA fields:\r\n"
|
||||
" sf : 0x50(SF5)||0x60(SF6)||0x70(SF7)||0x80(SF8)||0x90(SF9)||0xA0(SF10)||0xB0(SF11)||0xC0(SF12)\r\n"
|
||||
" bw : 0x34(BW_200K)||0x26(BW_400K)||0x18(BW_800K)||0x0A(BW_1600K)\r\n"
|
||||
" cr : 0x01(4/5)||0x02(4/6)||0x03(4/7)||0x04(4/8)||0x05(LI_4/5)||0x06(LI_4/6)||0x07(LI_4/7)\r\n"
|
||||
" FLRC fields:\r\n"
|
||||
" br_bw : 0x04(2.6M/2.4M)||0x28(2.08M/2.4M)||0x45(1.3M/1.2M)||0x69(1.04M/1.2M)\r\n"
|
||||
" 0x86(0.65M/0.6M)||0xAA(0.52M/0.6M)||0xC7(0.325M/0.3M)||0xEB(0.26M/0.3M)\r\n"
|
||||
" cr : 0x00(CR_1/2)||0x02(CR_3/4)||0x04(CR_1/0)\r\n"
|
||||
" shaping : 0x00(OFF)||0x10(BT_1_0)||0x20(BT_0_5)\r\n"
|
||||
"Examples: radio modulation br_bw 0x4C\r\n"
|
||||
" radio modulation sf 0x70\r\n"
|
||||
"============================================================================================================\r\n";
|
||||
static const char packet_help[] =
|
||||
"================================================================================================\r\n"
|
||||
"packet <field> <value> - Set packet parameters (current PacketType based)\r\n"
|
||||
" BLE fields:\r\n"
|
||||
" ConnectionState : 0(MASTER_SLAVE)||1(ADVERTISER)||2(TX_TEST)||3(RX_TEST)||4(RXTX_TEST)\r\n"
|
||||
" CrcField : 0(OFF)||1(CRC_3B)\r\n"
|
||||
" BlePacketType : 0(PRBS_9)||1(PRBS_15)||2(EYELONG_1_0)||3(EYELONG_0_1)\r\n"
|
||||
" 4(EYESHORT_1_0)||5(EYESHORT_0_1)||6(ALL_1)||7(ALL_0)\r\n"
|
||||
" Whitening : 0x00(ON)||0x08(OFF)\r\n"
|
||||
" GFSK fields:\r\n"
|
||||
" Preamble : 0x00(4bits)||0x10(8bits)||0x20(12bits)||0x30(16bits)\r\n"
|
||||
" 0x40(20bits)||0x50(24bits)||0x60(28bits)||0x70(32bits)\r\n"
|
||||
" SyncWordLength : 0x00(1byte)||0x02(2bytes)||0x04(3bytes)||0x06(4bytes)||0x08(5bytes)\r\n"
|
||||
" SyncWordMatch : 0x00(OFF)||0x10(1)||0x20(2)||0x30(1_2)||0x40(3)||0x50(1_3)||0x60(2_3)||0x70(1_2_3)\r\n"
|
||||
" SyncWord1/2/3 : <hex_bytes> - Set sync word 1/2/3 (max 5 bytes for GFSK)\r\n"
|
||||
" SyncWord : Show all sync words\r\n"
|
||||
" Header : 0x00(VARIABLE)||0x20(FIXED)\r\n"
|
||||
" Payload : 1-255 (bytes)\r\n"
|
||||
" Crc : 0x00(OFF)||0x10(1byte)||0x20(2bytes)||0x30(3bytes)\r\n"
|
||||
" Whitening : 0x00(ON)||0x08(OFF)\r\n"
|
||||
" LORA fields:\r\n"
|
||||
" Preamble : 0-255 (symbols count)\r\n"
|
||||
" Header : 0x00(VARIABLE/EXPLICIT)||0x80(FIXED/IMPLICIT)\r\n"
|
||||
" Payload : 1-255 (bytes)\r\n"
|
||||
" Crc : 0x20(ON)||0x00(OFF)\r\n"
|
||||
" InvertIQ : 0x40(NORMAL)||0x00(INVERTED)\r\n"
|
||||
" FLRC fields: Same as GFSK (Preamble/SyncWordLength/SyncWordMatch/SyncWord1/2/3/Header/Payload/Crc/Whitening)\r\n"
|
||||
" SyncWord1/2/3 : <hex_bytes> - Set sync word 1/2/3 (max 4 bytes for FLRC)\r\n"
|
||||
"Examples: radio packet Payload 64\r\n"
|
||||
" radio packet Crc 0x20\r\n"
|
||||
" radio packet SyncWord1 0x12345678\r\n"
|
||||
" radio packet SyncWord\r\n"
|
||||
"================================================================================================\r\n";
|
||||
|
||||
static const char mr16_help[] =
|
||||
"======================================================\r\n"
|
||||
"mr16 <subcmd> [args] - MR16 system commands\r\n"
|
||||
"------------------------------------------------------\r\n"
|
||||
"Configuration Commands:\r\n"
|
||||
" save : Save MR16 configuration to Flash\r\n"
|
||||
" get : Load configuration from Flash\r\n"
|
||||
" reset : Restore default configuration\r\n"
|
||||
" mode <arg> : Set/get data format (VARIABLE|FIXED)\r\n"
|
||||
" fixedlen <len> : Set user data length (1-123 bytes)\r\n"
|
||||
" !!!Only user data length, NOT packet length!\r\n"
|
||||
" !!!MR16 auto adds: Header(2)+Data+CRC(2)\r\n"
|
||||
" power <dBm> : Set/show TX power (-18 to +13 dBm)\r\n"
|
||||
" rxid1/2/3 <hex> : Set/get RX ID (hex value)\r\n"
|
||||
"------------------------------------------------------\r\n"
|
||||
"Operation Commands:\r\n"
|
||||
" tx : Transmit current TX buffer\r\n"
|
||||
" rx : Start continuous receive\r\n"
|
||||
"------------------------------------------------------\r\n"
|
||||
"Information Commands:\r\n"
|
||||
" show : Show all MR16 configuration\r\n"
|
||||
" rxid : Show all three RX IDs\r\n"
|
||||
"------------------------------------------------------\r\n"
|
||||
"Help Commands:\r\n"
|
||||
" help : Show this help (supports paging)\r\n"
|
||||
" mode help : Show mode details\r\n"
|
||||
"======================================================\r\n";
|
||||
|
||||
static const char baudrate_help[] =
|
||||
"=====================================================================\r\n"
|
||||
"baudrate [index] - Set baudrate for current radio mode\r\n"
|
||||
"---------------------------------------------------------------------\r\n"
|
||||
"BLE Mode:\r\n"
|
||||
" 0 = 250Kbps | 1 = 500Kbps | 2 = 1Mbps\r\n"
|
||||
"---------------------------------------------------------------------\r\n"
|
||||
"LoRa Mode:\r\n"
|
||||
" 0 = 216bps | 1 = 1Kbps | 2 = 5Kbps | 3 = 10Kbps\r\n"
|
||||
" 4 = 20Kbps | 5 = 61Kbps | 6 = 127Kbps | 7 = 203Kbps\r\n"
|
||||
"---------------------------------------------------------------------\r\n"
|
||||
"GFSK Mode:\r\n"
|
||||
" 0 = 125Kbps | 1 = 250Kbps | 2 = 500Kbps | 3 = 1Mbps\r\n"
|
||||
"---------------------------------------------------------------------\r\n"
|
||||
"FLRC Mode:\r\n"
|
||||
" 0 = 130Kbps | 1 = 260Kbps | 2 = 520Kbps | 3 = 1040Kbps\r\n"
|
||||
"---------------------------------------------------------------------\r\n"
|
||||
"Examples:\r\n"
|
||||
" radio baudrate - Show current baudrates for all modes\r\n"
|
||||
"\r\n"
|
||||
"Detailed Help Commands:\r\n"
|
||||
" modulation help - Show detailed modulation parameters help\r\n"
|
||||
" packet help - Show detailed packet parameters help\r\n"
|
||||
" baudrate help - Show baudrate configuration details\r\n"
|
||||
"\r\n"
|
||||
"Usage Examples:\r\n"
|
||||
" radio mode LORA - Switch to LoRa mode\r\n"
|
||||
" radio rffreq 2400000000 - Set frequency to 2.4GHz\r\n"
|
||||
" radio power 10 - Set TX power to +10dBm\r\n"
|
||||
" radio baudrate 2 - Set baudrate index 2 for current mode\r\n"
|
||||
" radio baudrate help - Show this help\r\n"
|
||||
"=====================================================================\r\n";
|
||||
"\r\n"
|
||||
"For more details on a specific command, use: radio <command> help\r\n"
|
||||
"==============================================================================\r\n"
|
||||
"==============================================================================\r\n";
|
||||
|
||||
/* Modulation Parameters Help */
|
||||
static const char modulation_help[] =
|
||||
"==========================================================================================================\r\n"
|
||||
"modulation <field> <value> - Set Modulation Parameters\r\n"
|
||||
"==========================================================================================================\r\n"
|
||||
"Available fields for each radio mode:\r\n"
|
||||
"\r\n"
|
||||
"BLE/GFSK Mode Parameters:\r\n"
|
||||
" br_bw - Bitrate & Bandwidth\r\n"
|
||||
" 0x04 = 2.0Mbps / 2.4MHz 0x28 = 1.6Mbps / 2.4MHz\r\n"
|
||||
" 0x4C = 1.0Mbps / 2.4MHz 0x45 = 1.0Mbps / 1.2MHz\r\n"
|
||||
" 0x70 = 0.8Mbps / 2.4MHz 0x69 = 0.8Mbps / 1.2MHz\r\n"
|
||||
" 0x8D = 0.5Mbps / 1.2MHz 0x86 = 0.5Mbps / 0.6MHz\r\n"
|
||||
" 0xB1 = 0.4Mbps / 1.2MHz 0xAA = 0.4Mbps / 0.6MHz\r\n"
|
||||
" 0xCE = 0.25Mbps / 0.6MHz 0xC7 = 0.25Mbps / 0.3MHz\r\n"
|
||||
" 0xEF = 0.125Mbps / 0.3MHz\r\n"
|
||||
"\r\n"
|
||||
" modindex - Modulation Index\r\n"
|
||||
" 0=0.35, 1=0.50, 2=0.75, 3=1.00, 4=1.25, 5=1.50, 6=1.75, 7=2.00\r\n"
|
||||
" 8=2.25, 9=2.50, 10=2.75, 11=3.00, 12=3.25, 13=3.50, 14=3.75, 15=4.00\r\n"
|
||||
"\r\n"
|
||||
" shaping - Modulation Shaping\r\n"
|
||||
" 0x00 = OFF (no shaping)\r\n"
|
||||
" 0x10 = BT=1.0 (Gaussian shaping)\r\n"
|
||||
" 0x20 = BT=0.5 (Gaussian shaping)\r\n"
|
||||
"-------------------------------------------------------------------------------------------\r\n"
|
||||
"LoRa Mode Parameters:\r\n"
|
||||
" sf - Spreading Factor\r\n"
|
||||
" 0x50 = SF5, 0x60 = SF6, 0x70 = SF7, 0x80 = SF8\r\n"
|
||||
" 0x90 = SF9, 0xA0 = SF10, 0xB0 = SF11, 0xC0 = SF12\r\n"
|
||||
"\r\n"
|
||||
" bw - Bandwidth\r\n"
|
||||
" 0x34 = 200kHz, 0x26 = 400kHz, 0x18 = 800kHz, 0x0A = 1600kHz\r\n"
|
||||
"\r\n"
|
||||
" cr - Coding Rate\r\n"
|
||||
" 0x01 = 4/5, 0x02 = 4/6, 0x03 = 4/7, 0x04 = 4/8\r\n"
|
||||
" 0x05 = Long Interleaving 4/5, 0x06 = Long Interleaving 4/6\r\n"
|
||||
" 0x07 = Long Interleaving 4/7\r\n"
|
||||
"-------------------------------------------------------------------------------------------\r\n"
|
||||
"FLRC Mode Parameters:\r\n"
|
||||
" br_bw - Bitrate & Bandwidth\r\n"
|
||||
" 0x04 = 2.6Mbps / 2.4MHz 0x28 = 2.08Mbps / 2.4MHz\r\n"
|
||||
" 0x45 = 1.3Mbps / 1.2MHz 0x69 = 1.04Mbps / 1.2MHz\r\n"
|
||||
" 0x86 = 0.65Mbps / 0.6MHz 0xAA = 0.52Mbps / 0.6MHz\r\n"
|
||||
" 0xC7 = 0.325Mbps / 0.3MHz 0xEB = 0.26Mbps / 0.3MHz\r\n"
|
||||
"\r\n"
|
||||
" cr - Coding Rate\r\n"
|
||||
" 0x00 = CR_1/2, 0x02 = CR_3/4, 0x04 = CR_1/0\r\n"
|
||||
"\r\n"
|
||||
" shaping - Modulation Shaping\r\n"
|
||||
" 0x00 = OFF (no shaping)\r\n"
|
||||
" 0x10 = BT=1.0 (Gaussian shaping)\r\n"
|
||||
" 0x20 = BT=0.5 (Gaussian shaping)\r\n"
|
||||
"-------------------------------------------------------------------------------------------\r\n"
|
||||
"Usage Examples:\r\n"
|
||||
" radio modulation br_bw 0x4C - Set GFSK bitrate to 1.0Mbps / 2.4MHz\r\n"
|
||||
" radio modulation sf 0x70 - Set LoRa spreading factor to SF7\r\n"
|
||||
" radio modulation br_bw 0x45 - Set FLRC bitrate to 1.3Mbps / 1.2MHz\r\n"
|
||||
"-------------------------------------------------------------------------------------------\r\n"
|
||||
"Note: Changes take effect immediately. Use 'radio modulation' to see current values.\r\n"
|
||||
"==========================================================================================================\r\n"
|
||||
"==========================================================================================================\r\n";
|
||||
|
||||
/* Packet Parameters Help */
|
||||
static const char packet_help[] =
|
||||
"==========================================================================================================\r\n"
|
||||
"packet <field> <value> - Set Packet Parameters\r\n"
|
||||
"==========================================================================================================\r\n"
|
||||
"Available fields for each radio mode:\r\n"
|
||||
"-----------------------------------------------------------------------------------\r\n"
|
||||
"BLE Mode Parameters:\r\n"
|
||||
" ConnectionState - Connection state\r\n"
|
||||
" 0 = MASTER_SLAVE, 1 = ADVERTISER, 2 = TX_TEST\r\n"
|
||||
" 3 = RX_TEST, 4 = RXTX_TEST\r\n"
|
||||
" CrcField - CRC field configuration\r\n"
|
||||
" 0 = OFF, 1 = CRC_3B (3-byte CRC)\r\n"
|
||||
" BlePacketType - BLE packet type\r\n"
|
||||
" 0 = PRBS_9, 1 = PRBS_15, 2 = EYELONG_1_0, 3 = EYELONG_0_1\r\n"
|
||||
" 4 = EYESHORT_1_0, 5 = EYESHORT_0_1, 6 = ALL_1, 7 = ALL_0\r\n"
|
||||
" Whitening - Whitening mode\r\n"
|
||||
" 0x00 = ON, 0x08 = OFF\r\n"
|
||||
"-----------------------------------------------------------------------------------\r\n"
|
||||
"GFSK Mode Parameters:\r\n"
|
||||
" Preamble - Preamble length\r\n"
|
||||
" 0x00 = 4bits, 0x10 = 8bits, 0x20 = 12bits, 0x30 = 16bits\r\n"
|
||||
" 0x40 = 20bits, 0x50 = 24bits, 0x60 = 28bits, 0x70 = 32bits\r\n"
|
||||
" SyncWordLength - Sync word length\r\n"
|
||||
" 0x00 = 1byte, 0x02 = 2bytes, 0x04 = 3bytes\r\n"
|
||||
" 0x06 = 4bytes, 0x08 = 5bytes\r\n"
|
||||
" SyncWordMatch - Sync word match\r\n"
|
||||
" 0x00 = OFF, 0x10 = 1, 0x20 = 2, 0x30 = 1_2\r\n"
|
||||
" 0x40 = 3, 0x50 = 1_3, 0x60 = 2_3, 0x70 = 1_2_3\r\n"
|
||||
" SyncWord1/2/3 - Set sync word bytes\r\n"
|
||||
" Format: <hex_bytes> (e.g., 0x12345678)\r\n"
|
||||
" Maximum 5 bytes for GFSK\r\n"
|
||||
" SyncWord - Show all configured sync words\r\n"
|
||||
" Header - Header type\r\n"
|
||||
" 0x00 = VARIABLE, 0x20 = FIXED\r\n"
|
||||
" Payload - Payload length in bytes\r\n"
|
||||
" Range: 1-255\r\n"
|
||||
" Crc - CRC length\r\n"
|
||||
" 0x00 = OFF, 0x10 = 1byte, 0x20 = 2bytes, 0x30 = 3bytes\r\n"
|
||||
" Whitening - Whitening mode\r\n"
|
||||
" 0x00 = ON, 0x08 = OFF\r\n"
|
||||
"-----------------------------------------------------------------------------------\r\n"
|
||||
"LoRa Mode Parameters:\r\n"
|
||||
" Preamble - Preamble symbols count\r\n"
|
||||
" Range: 0-255\r\n"
|
||||
" Header - Header type\r\n"
|
||||
" 0x00 = VARIABLE/EXPLICIT\r\n"
|
||||
" 0x80 = FIXED/IMPLICIT\r\n"
|
||||
" Payload - Payload length in bytes\r\n"
|
||||
" Range: 1-255\r\n"
|
||||
" Crc - CRC mode\r\n"
|
||||
" 0x00 = OFF, 0x20 = ON\r\n"
|
||||
" InvertIQ - IQ inversion\r\n"
|
||||
" 0x40 = NORMAL, 0x00 = INVERTED\r\n"
|
||||
"-----------------------------------------------------------------------------------\r\n"
|
||||
"FLRC Mode Parameters:\r\n"
|
||||
" Most parameters same as GFSK\r\n"
|
||||
" SyncWord1/2/3 - Set sync word bytes\r\n"
|
||||
" Maximum 4 bytes for FLRC\r\n"
|
||||
"-----------------------------------------------------------------------------------\r\n"
|
||||
"Usage Examples:\r\n"
|
||||
" radio packet Payload 64 - Set payload length to 64 bytes\r\n"
|
||||
" radio packet Crc 0x20 - Enable 2-byte CRC\r\n"
|
||||
" radio packet SyncWord1 0x1234 - Set sync word 1 to 0x1234\r\n"
|
||||
" radio packet SyncWord - Display all sync words\r\n"
|
||||
"-----------------------------------------------------------------------------------\r\n"
|
||||
"Note: Use 'radio packet' without arguments to view current parameters.\r\n"
|
||||
"==========================================================================================================\r\n"
|
||||
"==========================================================================================================\r\n";
|
||||
|
||||
/* MR16 System Commands Help */
|
||||
static const char mr16_help[] =
|
||||
"================================================================================\r\n"
|
||||
"mr16 <subcmd> [args] - MR16 System Control Commands\r\n"
|
||||
"================================================================================\r\n"
|
||||
"Configuration Management:\r\n"
|
||||
" save - Save current configuration to Flash\r\n"
|
||||
" get - Load configuration from Flash\r\n"
|
||||
" reset - Restore default configuration\r\n"
|
||||
" mode <VARIABLE|FIXED> - Set/get data format\r\n"
|
||||
" fixedlen <1-123> - Set user data length for FIXED mode\r\n"
|
||||
" power <-18 to +13> - Set/show TX power in dBm\r\n"
|
||||
"--------------------------------------------------------------------\r\n"
|
||||
"Receiver ID Configuration:\r\n"
|
||||
" rxid1 <hex> - Set/get RX ID for channel 1\r\n"
|
||||
" rxid2 <hex> - Set/get RX ID for channel 2\r\n"
|
||||
" rxid3 <hex> - Set/get RX ID for channel 3\r\n"
|
||||
" rxid - Show all three RX IDs\r\n"
|
||||
"--------------------------------------------------------------------\r\n"
|
||||
"Operation Commands:\r\n"
|
||||
" tx - Start transmission mode\r\n"
|
||||
" rx - Start continuous receive mode\r\n"
|
||||
"--------------------------------------------------------------------\r\n"
|
||||
"Information Display:\r\n"
|
||||
" show - Show all MR16 configuration\r\n"
|
||||
"--------------------------------------------------------------------\r\n"
|
||||
"Detailed Help:\r\n"
|
||||
" mode help - Show detailed mode information\r\n"
|
||||
"--------------------------------------------------------------------\r\n"
|
||||
"Usage Examples:\r\n"
|
||||
" mr16 mode FIXED - Switch to fixed length mode\r\n"
|
||||
" mr16 fixedlen 32 - Set user data length to 32 bytes\r\n"
|
||||
" mr16 power 10 - Set TX power to +10dBm\r\n"
|
||||
" mr16 rxid1 0x1234 - Set RX ID for channel 1 to 0x1234\r\n"
|
||||
" mr16 tx - Start transmitting\r\n"
|
||||
" mr16 rx - Start receiving\r\n"
|
||||
"--------------------------------------------------------------------\r\n"
|
||||
"Important Notes:\r\n"
|
||||
"1. fixedlen sets ONLY user data length, NOT total packet length.\r\n"
|
||||
"2. MR16 automatically adds: Header(2 bytes) + Data + CRC(2 bytes).\r\n"
|
||||
"3. Valid RX ID range: 0x0001 to 0xFFFE (0x0000 and 0xFFFF are reserved).\r\n"
|
||||
"===============================================================================\r\n"
|
||||
"===============================================================================\r\n";
|
||||
|
||||
/* Baudrate Configuration Help */
|
||||
static const char baudrate_help[] =
|
||||
"==============================================================================\r\n"
|
||||
"baudrate [index] - Set Baudrate for Current Radio Mode\r\n"
|
||||
"==============================================================================\r\n"
|
||||
"Available baudrate indices for each mode:\r\n"
|
||||
"----------------------------------------------------------------------\r\n"
|
||||
"BLE Mode Baudrates:\r\n"
|
||||
" Index 0 = 250 Kbps\r\n"
|
||||
" Index 1 = 500 Kbps\r\n"
|
||||
" Index 2 = 1 Mbps\r\n"
|
||||
"----------------------------------------------------------------------\r\n"
|
||||
"LoRa Mode Baudrates:\r\n"
|
||||
" Index 0 = 216 bps\r\n"
|
||||
" Index 1 = 1 Kbps\r\n"
|
||||
" Index 2 = 5 Kbps\r\n"
|
||||
" Index 3 = 10 Kbps\r\n"
|
||||
" Index 4 = 20 Kbps\r\n"
|
||||
" Index 5 = 61 Kbps\r\n"
|
||||
" Index 6 = 127 Kbps\r\n"
|
||||
" Index 7 = 203 Kbps\r\n"
|
||||
"----------------------------------------------------------------------\r\n"
|
||||
"GFSK Mode Baudrates:\r\n"
|
||||
" Index 0 = 125 Kbps\r\n"
|
||||
" Index 1 = 250 Kbps\r\n"
|
||||
" Index 2 = 500 Kbps\r\n"
|
||||
" Index 3 = 1 Mbps\r\n"
|
||||
"----------------------------------------------------------------------\r\n"
|
||||
"FLRC Mode Baudrates:\r\n"
|
||||
" Index 0 = 130 Kbps\r\n"
|
||||
" Index 1 = 260 Kbps\r\n"
|
||||
" Index 2 = 520 Kbps\r\n"
|
||||
" Index 3 = 1040 Kbps\r\n"
|
||||
"----------------------------------------------------------------------\r\n"
|
||||
"Usage Examples:\r\n"
|
||||
" radio baudrate - Show current baudrate for all modes\r\n"
|
||||
" radio baudrate 2 - Set baudrate index 2 for current mode\r\n"
|
||||
"----------------------------------------------------------------------\r\n"
|
||||
"Important Notes:\r\n"
|
||||
"1. Baudrate index must be valid for the current radio mode.\r\n"
|
||||
"2. Higher baudrates provide faster data rates but reduced range.\r\n"
|
||||
"3. Lower baudrates increase range but reduce data rate.\r\n"
|
||||
"==============================================================================\r\n"
|
||||
"==============================================================================\r\n";
|
||||
/*----------------------------------------------------------------------------
|
||||
CLI Command Handlers (命令处理器)
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -1,51 +0,0 @@
|
||||
/*
|
||||
dbus Task
|
||||
|
||||
*/
|
||||
|
||||
/* Includes ----------------------------------------------------------------- */
|
||||
#include "module/mr16.h"
|
||||
#include "task/user_task.h"
|
||||
/* USER INCLUDE BEGIN */
|
||||
#include "bsp/uart.h"
|
||||
#include <stdint.h>
|
||||
/* USER INCLUDE END */
|
||||
|
||||
/* Private typedef ---------------------------------------------------------- */
|
||||
/* Private define ----------------------------------------------------------- */
|
||||
/* Private macro ------------------------------------------------------------ */
|
||||
/* Private variables -------------------------------------------------------- */
|
||||
uint8_t txbuffer[127]={0};
|
||||
/* USER STRUCT BEGIN */
|
||||
/* 定义消息结构体用于传递txbuffer数据 */
|
||||
|
||||
/* USER STRUCT END */
|
||||
|
||||
/* Private function --------------------------------------------------------- */
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
void Task_dbus(void *argument) {
|
||||
(void)argument; /* 未使用argument,消除警告 */
|
||||
|
||||
|
||||
/* 计算任务运行到指定频率需要等待的tick数 */
|
||||
const uint32_t delay_tick = osKernelGetTickFreq() / DBUS_FREQ;
|
||||
|
||||
osDelay(DBUS_INIT_DELAY); /* 延时一段时间再开启任务 */
|
||||
|
||||
uint32_t tick = osKernelGetTickCount(); /* 控制任务运行频率的计时 */
|
||||
/* USER CODE INIT BEGIN */
|
||||
|
||||
/* USER CODE INIT END */
|
||||
|
||||
while (1) {
|
||||
tick += delay_tick; /* 计算下一个唤醒时刻 */
|
||||
/* USER CODE BEGIN */
|
||||
|
||||
/* 从消息队列接收txbuffer数据 */
|
||||
|
||||
|
||||
/* USER CODE END */
|
||||
osDelayUntil(tick); /* 运行结束,等待下一次唤醒 */
|
||||
}
|
||||
|
||||
}
|
||||
@ -24,7 +24,6 @@
|
||||
/* Private variables -------------------------------------------------------- */
|
||||
/* USER STRUCT BEGIN */
|
||||
MR16_t mr16;
|
||||
uint8_t txdata[1];
|
||||
/* USER STRUCT END */
|
||||
|
||||
/* Private function --------------------------------------------------------- */
|
||||
@ -65,10 +64,6 @@ __HAL_UART_ENABLE_IT(&huart2,UART_IT_IDLE);
|
||||
|
||||
/* USER CODE BEGIN */
|
||||
|
||||
// if(StatusCtrl.status!=WS2812_STATUS_TX_OK)
|
||||
// {
|
||||
// a++;
|
||||
// }
|
||||
MR16_Main(&mr16);
|
||||
// //必须加点延迟要不然不能正常跑
|
||||
osDelay(1);
|
||||
@ -93,7 +88,7 @@ __HAL_UART_ENABLE_IT(&huart2,UART_IT_IDLE);
|
||||
mr16.timer.lastDbusSend = mr16.timer.now; // 同步更新浮点时间戳
|
||||
}
|
||||
/* USER CODE END */
|
||||
osDelayUntil(tick); /* 运行结束,等待下一次唤醒 */
|
||||
// osDelayUntil(tick); /* 运行结束,等待下一次唤醒 */
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user