Răsfoiți Sursa

V05 修复无线信道设置

dropLin 1 săptămână în urmă
părinte
comite
123d2f23aa
5 a modificat fișierele cu 22 adăugiri și 21 ștergeri
  1. 5 0
      README.md
  2. 1 1
      keil_v5/adapterBoardDriver.uvoptx
  3. 4 6
      keil_v5/adapterBoardDriver.uvprojx
  4. 9 13
      project/main.c
  5. 3 1
      radio/myRadio.c

+ 5 - 0
README.md

@@ -208,6 +208,11 @@ C99标准
 - 更新显示界面
 - 更新数据包收发操作
 
+
+#### V05
+
+- 修复无线信道设置
+
 ## 二十三、免责说明
 1、本工程驱动软件只提供做演示项目使用,未经过大批量项目验证,客户需谨慎使用,如果使用在正式项目中引发的所有问题,本司概不负责。使用过程若发现任何问题,可及时与本司相关人员联系。
 2、本工程所有文件可以用于商业性项目移植,无需向本司申请。

+ 1 - 1
keil_v5/adapterBoardDriver.uvoptx

@@ -10,7 +10,7 @@
     <aExt>*.s*; *.src; *.a*</aExt>
     <oExt>*.obj</oExt>
     <lExt>*.lib</lExt>
-    <tExt>*.txt; *.h; *.inc</tExt>
+    <tExt>*.txt; *.h; *.inc; *.md</tExt>
     <pExt>*.plm</pExt>
     <CppX>*.cpp</CppX>
     <nMigrate>0</nMigrate>

+ 4 - 6
keil_v5/adapterBoardDriver.uvprojx

@@ -185,6 +185,7 @@
             <RvdsVP>1</RvdsVP>
             <RvdsMve>0</RvdsMve>
             <RvdsCdeCp>0</RvdsCdeCp>
+            <nBranchProt>0</nBranchProt>
             <hadIRAM2>0</hadIRAM2>
             <hadIROM2>0</hadIROM2>
             <StupSel>8</StupSel>
@@ -820,6 +821,7 @@
             <RvdsVP>1</RvdsVP>
             <RvdsMve>0</RvdsMve>
             <RvdsCdeCp>0</RvdsCdeCp>
+            <nBranchProt>0</nBranchProt>
             <hadIRAM2>0</hadIRAM2>
             <hadIROM2>0</hadIROM2>
             <StupSel>8</StupSel>
@@ -1319,7 +1321,7 @@
             <InvalidFlash>1</InvalidFlash>
           </TargetStatus>
           <OutputDirectory>.\Objects\</OutputDirectory>
-          <OutputName>VGKitBoard_3512S_APP_ST_V04</OutputName>
+          <OutputName>VGKitBoard_3512S_APP_ST_V05</OutputName>
           <CreateExecutable>1</CreateExecutable>
           <CreateLib>0</CreateLib>
           <CreateHexFile>1</CreateHexFile>
@@ -1456,6 +1458,7 @@
             <RvdsVP>0</RvdsVP>
             <RvdsMve>0</RvdsMve>
             <RvdsCdeCp>0</RvdsCdeCp>
+            <nBranchProt>0</nBranchProt>
             <hadIRAM2>0</hadIRAM2>
             <hadIROM2>0</hadIROM2>
             <StupSel>8</StupSel>
@@ -1924,11 +1927,6 @@
     <Layers>
       <Layer>
         <LayName>&lt;Project Info&gt;</LayName>
-        <LayDesc></LayDesc>
-        <LayUrl></LayUrl>
-        <LayKeys></LayKeys>
-        <LayCat></LayCat>
-        <LayLic></LayLic>
         <LayTarg>0</LayTarg>
         <LayPrjMark>1</LayPrjMark>
       </Layer>

+ 9 - 13
project/main.c

@@ -15,7 +15,7 @@
 #include "myUart3.h"
 #include "myRadio.h"
 
-#define SOFT_VERSION 0x04
+#define SOFT_VERSION 0x05
 #define SET_RF_FREQ_HZ(base, ch,step) base+ch*step*10*1000
 //---------------key
 KeyParamExt_ts *getKeyReturn;
@@ -72,7 +72,7 @@ static char deviceNameList[DVTP_MAX_COUNT][20] =
 
 userParams_ts deviceInforDef = 
 {
-    .projectModel = "VG237x",
+    .projectModel = "VG3512",
     .channelStep = 100,
     .packetLen = 12,
     .sendPacketCounts = 100,
@@ -404,7 +404,7 @@ void uiEnterCallback(int pageId, int cursorCount, int status, int value)
             myDisplay_setting_loadParams(SET_ITEM_INDEX_TXPOWER, "%ddBm", rfTxPowerList[deviceInfor.chipType][deviceInfor.txPower]);
             myDisplay_setting_loadParams(SET_ITEM_INDEX_TYPE, deviceNameList[deviceInfor.chipType]);
             myDisplay_setting_loadParams(SET_ITEM_INDEX_FREQ, "%03u->%6.2fMHz", deviceInfor.rfChannel, (float)(SET_RF_FREQ_HZ(rfBaseFreqList[deviceInfor.chipType], deviceInfor.rfChannel, deviceInfor.channelStep)) / 1000000.0);
-            myRadio_setFrequency(SET_RF_FREQ_HZ(rfBaseFreqList[deviceInfor.chipType], deviceInfor.rfChannel, deviceInfor.channelStep));
+            myRadio_setFrequency(deviceInfor.rfChannel);
             setEvent(EVENT_TIMEOUT_TO_SAVE_PARAMS, false, 200);
         }
             break;
@@ -412,7 +412,7 @@ void uiEnterCallback(int pageId, int cursorCount, int status, int value)
         {
             deviceInfor.rfChannel = value;
             myDisplay_setting_loadParams(SET_ITEM_INDEX_FREQ, "%03u->%6.2fMHz", deviceInfor.rfChannel, (float)(SET_RF_FREQ_HZ(rfBaseFreqList[deviceInfor.chipType], deviceInfor.rfChannel, deviceInfor.channelStep)) / 1000000.0);
-            myRadio_setFrequency(SET_RF_FREQ_HZ(rfBaseFreqList[deviceInfor.chipType], deviceInfor.rfChannel, deviceInfor.channelStep));
+            myRadio_setFrequency(deviceInfor.rfChannel);
             setEvent(EVENT_TIMEOUT_TO_SAVE_PARAMS, false, 200);
         }
             break;
@@ -421,7 +421,7 @@ void uiEnterCallback(int pageId, int cursorCount, int status, int value)
             deviceInfor.channelStep = value;
             myDisplay_setting_loadParams(SET_ITEM_INDEX_STEP, "%uHz", deviceInfor.channelStep*10*1000);
             myDisplay_setting_loadParams(SET_ITEM_INDEX_FREQ, "%03u->%6.2fMHz", deviceInfor.rfChannel, (float)(SET_RF_FREQ_HZ(rfBaseFreqList[deviceInfor.chipType], deviceInfor.rfChannel, deviceInfor.channelStep)) / 1000000.0);
-            myRadio_setFrequency(SET_RF_FREQ_HZ(rfBaseFreqList[deviceInfor.chipType], deviceInfor.rfChannel, deviceInfor.channelStep));
+            myRadio_setFrequency(deviceInfor.rfChannel);
             setEvent(EVENT_TIMEOUT_TO_SAVE_PARAMS, false, 200);
         }
             break;
@@ -595,7 +595,7 @@ int main(void)
     //³õʼ»¯É䯵
     myRadio_setChipType(deviceInfor.chipType);
     myRadio_init(0, rfRx_callback);
-    myRadio_setFrequency(SET_RF_FREQ_HZ(rfBaseFreqList[deviceInfor.chipType], deviceInfor.rfChannel, deviceInfor.channelStep));
+    myRadio_setFrequency(deviceInfor.rfChannel);
     myRadio_setTxPower(deviceInfor.txPower);
     myRadio_setBaudrate(deviceInfor.rfBaudrate);
 
@@ -663,21 +663,17 @@ int main(void)
         }
         if (getEvent(EVENT_RF_CONTINUOUS_RX))
         {
-            myRadio_setCtrl(RADIO_EXT_CONTROL_RX_SENSITIVITY, 
-                        SET_RF_FREQ_HZ(rfBaseFreqList[deviceInfor.chipType], deviceInfor.rfChannel, deviceInfor.channelStep));
+            myRadio_setCtrl(RADIO_EXT_CONTROL_RX_SENSITIVITY, deviceInfor.rfChannel);
             startToCountingRx = true;
             validPackageCount = 0;
         }
         if (getEvent(EVENT_RF_CONTINUOUS_TX))
         {
-            myRadio_setCtrl(RADIO_EXT_CONTROL_TX_UNMODULATED, 
-                        SET_RF_FREQ_HZ(rfBaseFreqList[deviceInfor.chipType], deviceInfor.rfChannel, deviceInfor.channelStep));
+            myRadio_setCtrl(RADIO_EXT_CONTROL_TX_UNMODULATED, deviceInfor.rfChannel);
         }
         if (getEvent(EVENT_RF_CONTINUOUS_TX_MD))
         {
-            myRadio_setTxPower(deviceInfor.txPower);
-            myRadio_setCtrl(RADIO_EXT_CONTROL_TX_MODULATED, 
-                        SET_RF_FREQ_HZ(rfBaseFreqList[deviceInfor.chipType], deviceInfor.rfChannel, deviceInfor.channelStep));
+            myRadio_setCtrl(RADIO_EXT_CONTROL_TX_MODULATED, deviceInfor.rfChannel);
         }
         if (getEvent(EVENT_RF_PACKET_TX))
         {

+ 3 - 1
radio/myRadio.c

@@ -268,15 +268,16 @@ void myRadio_setCtrl(controlMode_te mode, uint32_t value)
         myRadio_setTxPower(rfTxPower);
         myRadio_setFrequency(rfFrequence);
         NRF24L01_carrierWave();
+        printf("RADIO_EXT_CONTROL_TX_UNMODULATED rfTxPower=%d rfFrequence=%uMHz\r\n", rfTxPower, rfFrequence+2400);
     }
         break;
     case RADIO_EXT_CONTROL_TX_MODULATED:
     {
-        RF_EXT_PA_TO_TX();
         RF_EXT_PA_TO_TX();
         myRadio_setTxPower(rfTxPower);
         myRadio_setFrequency(rfFrequence);
         NRF24L01_carrierWave();
+        printf("RADIO_EXT_CONTROL_TX_MODULATED rfTxPower=%d rfFrequence=%uMHz\r\n", rfTxPower, rfFrequence+2400);
     }
         break;
     case RADIO_EXT_CONTROL_RX_SENSITIVITY:
@@ -284,6 +285,7 @@ void myRadio_setCtrl(controlMode_te mode, uint32_t value)
         RF_EXT_PA_TO_RX();
         myRadio_setFrequency(rfFrequence);
         myRadio_receiver();
+        printf("RADIO_EXT_CONTROL_RX_SENSITIVITY rfTxPower=%d rfFrequence=%uMHz\r\n", rfTxPower, rfFrequence+2400);
     }
         break;