feat: LoRa中心频率改为470.1~492.6MHz(46信道), 激光默认关闭时间改为1分钟, 软件版本升至13

- sx127x.h: CH0~CH45中心频率改为470100000~492600000, 步进500000; FREQ_CENT/USE_LORA_CH扩展至CH45
- sx127x.c: LoraSetChannel信道上限16->45; LoraSetFreqCent频率校验改为470.1~492.6MHz; 移除BOM
- main.c: LoraFreq频率校验同步改为470.1~492.6MHz; 激光默认关闭时间10分钟->1分钟
- UartDebug.c: lora帮助文本信道范围更新为0~45
- main.h: 软件版本12->13
- docs: 更新软件版本号与LoRa频率范围说明
- MDK: 调试器配置更新
This commit is contained in:
2026-09-01 19:14:32 +08:00
parent c417d124a0
commit 706eb1247e
7 changed files with 146 additions and 24 deletions
+18 -1
View File
@@ -461,7 +461,24 @@
<Name></Name> <Name></Name>
</SetRegEntry> </SetRegEntry>
</TargetDriverDllRegistry> </TargetDriverDllRegistry>
<Breakpoint/> <Breakpoint>
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>255</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>..\source\inc\bsp.h</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
</Breakpoint>
<WatchWindow1> <WatchWindow1>
<Ww> <Ww>
<count>0</count> <count>0</count>
+3 -3
View File
@@ -1,4 +1,4 @@
#include "sx127x.h" #include "sx127x.h"
#include "ddl.h" #include "ddl.h"
#include "UartDebug.h" #include "UartDebug.h"
@@ -622,7 +622,7 @@ void Sx1276RxRetValue(void)
bool LoraSetChannel(uint8_t Channel) bool LoraSetChannel(uint8_t Channel)
{ {
if(Channel > 16) if(Channel > 45)
return false; return false;
LoRaPara.ucChannel = Channel; LoRaPara.ucChannel = Channel;
return true; return true;
@@ -667,7 +667,7 @@ bool LoraSetRegPreamble(uint8_t RegPreamble)
} }
bool LoraSetFreqCent(uint32_t FreqCent) bool LoraSetFreqCent(uint32_t FreqCent)
{ {
if(FreqCent < 410000000 || FreqCent > 525000000) if(FreqCent < 470100000ul || FreqCent > 492600000ul)
return false; return false;
LoRaPara.dwFreqHz = FreqCent; LoRaPara.dwFreqHz = FreqCent;
return true; return true;
+118 -13
View File
@@ -756,19 +756,54 @@ typedef struct {
#endif #endif
/* /*
中心频率配置:433100000ul + 200000*N 中心频率配置:470100000ul ~ 492600000ul,步进500000
*/ */
#define CH0 (433100000ul + 0) //测试频率 #define CH0 (470100000ul) //出厂默认频率
#define CH1 (433100000ul + 200000) #define CH1 (470600000ul)
#define CH2 (433100000ul + 400000) #define CH2 (471100000ul)
#define CH3 (433100000ul + 600000) #define CH3 (471600000ul)
#define CH4 (433100000ul + 800000) #define CH4 (472100000ul)
#define CH5 (433100000ul + 1000000) #define CH5 (472600000ul)
#define CH6 (433100000ul + 1200000) #define CH6 (473100000ul)
#define CH7 (433100000ul + 1400000) #define CH7 (473600000ul)
#define CH8 (433100000ul + 1600000) #define CH8 (474100000ul)
#define CH9 (433100000ul + 1800000) #define CH9 (474600000ul)
#define CH10 (433100000ul + 2000000) #define CH10 (475100000ul)
#define CH11 (475600000ul)
#define CH12 (476100000ul)
#define CH13 (476600000ul)
#define CH14 (477100000ul)
#define CH15 (477600000ul)
#define CH16 (478100000ul)
#define CH17 (478600000ul)
#define CH18 (479100000ul)
#define CH19 (479600000ul)
#define CH20 (480100000ul)
#define CH21 (480600000ul)
#define CH22 (481100000ul)
#define CH23 (481600000ul)
#define CH24 (482100000ul)
#define CH25 (482600000ul)
#define CH26 (483100000ul)
#define CH27 (483600000ul)
#define CH28 (484100000ul)
#define CH29 (484600000ul)
#define CH30 (485100000ul)
#define CH31 (485600000ul)
#define CH32 (486100000ul)
#define CH33 (486600000ul)
#define CH34 (487100000ul)
#define CH35 (487600000ul)
#define CH36 (488100000ul)
#define CH37 (488600000ul)
#define CH38 (489100000ul)
#define CH39 (489600000ul)
#define CH40 (490100000ul)
#define CH41 (490600000ul)
#define CH42 (491100000ul)
#define CH43 (491600000ul)
#define CH44 (492100000ul)
#define CH45 (492600000ul)
#if (USE_LORA_CH == 0) #if (USE_LORA_CH == 0)
#define FREQ_CENT CH0 #define FREQ_CENT CH0
@@ -792,10 +827,80 @@ typedef struct {
#define FREQ_CENT CH9 #define FREQ_CENT CH9
#elif (USE_LORA_CH == 10) #elif (USE_LORA_CH == 10)
#define FREQ_CENT CH10 #define FREQ_CENT CH10
#elif (USE_LORA_CH == 11)
#define FREQ_CENT CH11
#elif (USE_LORA_CH == 12)
#define FREQ_CENT CH12
#elif (USE_LORA_CH == 13)
#define FREQ_CENT CH13
#elif (USE_LORA_CH == 14)
#define FREQ_CENT CH14
#elif (USE_LORA_CH == 15)
#define FREQ_CENT CH15
#elif (USE_LORA_CH == 16)
#define FREQ_CENT CH16
#elif (USE_LORA_CH == 17)
#define FREQ_CENT CH17
#elif (USE_LORA_CH == 18)
#define FREQ_CENT CH18
#elif (USE_LORA_CH == 19)
#define FREQ_CENT CH19
#elif (USE_LORA_CH == 20)
#define FREQ_CENT CH20
#elif (USE_LORA_CH == 21)
#define FREQ_CENT CH21
#elif (USE_LORA_CH == 22)
#define FREQ_CENT CH22
#elif (USE_LORA_CH == 23)
#define FREQ_CENT CH23
#elif (USE_LORA_CH == 24)
#define FREQ_CENT CH24
#elif (USE_LORA_CH == 25)
#define FREQ_CENT CH25
#elif (USE_LORA_CH == 26)
#define FREQ_CENT CH26
#elif (USE_LORA_CH == 27)
#define FREQ_CENT CH27
#elif (USE_LORA_CH == 28)
#define FREQ_CENT CH28
#elif (USE_LORA_CH == 29)
#define FREQ_CENT CH29
#elif (USE_LORA_CH == 30)
#define FREQ_CENT CH30
#elif (USE_LORA_CH == 31)
#define FREQ_CENT CH31
#elif (USE_LORA_CH == 32)
#define FREQ_CENT CH32
#elif (USE_LORA_CH == 33)
#define FREQ_CENT CH33
#elif (USE_LORA_CH == 34)
#define FREQ_CENT CH34
#elif (USE_LORA_CH == 35)
#define FREQ_CENT CH35
#elif (USE_LORA_CH == 36)
#define FREQ_CENT CH36
#elif (USE_LORA_CH == 37)
#define FREQ_CENT CH37
#elif (USE_LORA_CH == 38)
#define FREQ_CENT CH38
#elif (USE_LORA_CH == 39)
#define FREQ_CENT CH39
#elif (USE_LORA_CH == 40)
#define FREQ_CENT CH40
#elif (USE_LORA_CH == 41)
#define FREQ_CENT CH41
#elif (USE_LORA_CH == 42)
#define FREQ_CENT CH42
#elif (USE_LORA_CH == 43)
#define FREQ_CENT CH43
#elif (USE_LORA_CH == 44)
#define FREQ_CENT CH44
#elif (USE_LORA_CH == 45)
#define FREQ_CENT CH45
#endif #endif
#if !defined FREQ_CENT #if !defined FREQ_CENT
#define FREQ_CENT (433100000ul + 0)//200000 #define FREQ_CENT (470100000ul)//500000
#endif #endif
#if !defined FREQ_DEV #if !defined FREQ_DEV
#define FREQ_DEV 1000000ul #define FREQ_DEV 1000000ul
+1 -1
View File
@@ -562,7 +562,7 @@ static void DebugLoraConfig(int argc, char *argv[])
if(strcmp(argv[1], "?") == 0) { if(strcmp(argv[1], "?") == 0) {
DBG_LOG("Debug Cmd: lora arg1 arg2\r\n"); DBG_LOG("Debug Cmd: lora arg1 arg2\r\n");
DBG_LOG(" brief --> Configure Lora parameters.\r\n"); DBG_LOG(" brief --> Configure Lora parameters.\r\n");
DBG_LOG(" arg1 --> ch: Channel--para=(0~16)\r\n"); DBG_LOG(" arg1 --> ch: Channel--para=(0~45)\r\n");
DBG_LOG(" pw: Power--para=(0~20)\r\n"); DBG_LOG(" pw: Power--para=(0~20)\r\n");
DBG_LOG(" bw: SignalBw--para=(0~9)\r\n"); DBG_LOG(" bw: SignalBw--para=(0~9)\r\n");
DBG_LOG(" sf: SpreadFactor--para=(6~12)\r\n"); DBG_LOG(" sf: SpreadFactor--para=(6~12)\r\n");
+2 -2
View File
@@ -18,7 +18,7 @@ LaserTracing(激光示踪)是基于华大 HC32L170ARM Cortex-M0+)超低
### 1.2 软件版本 ### 1.2 软件版本
- 软件版本: `SOFTWARE_VERSION = 12` - 软件版本: `SOFTWARE_VERSION = 13`
- 硬件版本: `HARDWARE_VERSION = 11` - 硬件版本: `HARDWARE_VERSION = 11`
## 2. 目录结构 ## 2. 目录结构
@@ -221,7 +221,7 @@ GW_STATUS_IDLE
- CH0 = 470100000CH1 = 470600000...CH45 = 492600000。 - CH0 = 470100000CH1 = 470600000...CH45 = 492600000。
- 默认 `FREQ_CENT = CH0`;信道切换上限 `LoraSetChannel` 允许 0~45。 - 默认 `FREQ_CENT = CH0`;信道切换上限 `LoraSetChannel` 允许 0~45。
- 频率范围校验(`LoraSetFreqCent` / AppInit):410000000 ~ 525000000,覆盖全部信道。 - 频率范围校验(`LoraSetFreqCent` / AppInit):470100000 ~ 492600000,覆盖全部信道。
- 可通过调试命令 `lora ch <0~45>` 配置信道。 - 可通过调试命令 `lora ch <0~45>` 配置信道。
## 7. 调试命令 (UartDebug) ## 7. 调试命令 (UartDebug)
+1 -1
View File
@@ -5,7 +5,7 @@
#include "Update.h" #include "Update.h"
#include "Imu.h" #include "Imu.h"
#define SOFTWARE_VERSION 12 //软件版本 #define SOFTWARE_VERSION 13 //软件版本
#define HARDWARE_VERSION 11 //硬件版本 #define HARDWARE_VERSION 11 //硬件版本
#define MAIN_DBG_LOG(...) { if(MainDispEn) DBG_LOG(__VA_ARGS__);} #define MAIN_DBG_LOG(...) { if(MainDispEn) DBG_LOG(__VA_ARGS__);}
+3 -3
View File
@@ -137,10 +137,10 @@ static void AppInit(void)
App.Para.Layout.FPOTimeStart = 0; App.Para.Layout.FPOTimeStart = 0;
} }
if(App.Para.BLPara.LoraFreq < 410000000 || App.Para.BLPara.LoraFreq > 525000000) if(App.Para.BLPara.LoraFreq < 470100000ul || App.Para.BLPara.LoraFreq > 492600000ul)
App.Para.BLPara.LoraFreq = CH0; App.Para.BLPara.LoraFreq = CH0;
App.Para.Lora.FreqCent = App.Para.BLPara.LoraFreq; App.Para.Lora.FreqCent = App.Para.BLPara.LoraFreq;
SX1276LoRaWriteFreq(App.Para.Lora.FreqCent); //Lora频率:433100000ul + 200000*N SX1276LoRaWriteFreq(App.Para.Lora.FreqCent); //Lora频率:470100000ul + 500000*N
if(App.Para.Rs485Ch1.Addr > 16 || App.Para.Rs485Ch1.Addr < 1){ if(App.Para.Rs485Ch1.Addr > 16 || App.Para.Rs485Ch1.Addr < 1){
App.Para.Rs485Ch1.Addr = 1; App.Para.Rs485Ch1.Addr = 1;
@@ -167,7 +167,7 @@ static void AppInit(void)
App.Para.Layout.FPOTime = 0; App.Para.Layout.FPOTime = 0;
} }
if(App.Para.LaserTimerMinutes < 0 || App.Para.LaserTimerMinutes > 240) if(App.Para.LaserTimerMinutes < 0 || App.Para.LaserTimerMinutes > 240)
App.Para.LaserTimerMinutes = 10; App.Para.LaserTimerMinutes = 1;
SGCP.LaserTimerMinutes = App.Para.LaserTimerMinutes; SGCP.LaserTimerMinutes = App.Para.LaserTimerMinutes;
SAVE_APP_PARA((uint32_t *)&App.Para); SAVE_APP_PARA((uint32_t *)&App.Para);