Skip to content

Commit 2d3b75e

Browse files
committed
Fixed the bug that LR 2 SIM could not be saved due to no radio frequency detected
修复LR 2 SIM因检测不到射频无法保存的bug
1 parent 5b3f6b0 commit 2d3b75e

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/js/show.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,19 @@ const show = {
9595

9696

9797

98+
var show_liteRadioUnitType = {
99+
UNKNOW:0x00,
100+
LiteRadio_2_SE:0x01,
101+
LiteRadio_2_SE_V2_SX1280:0x02,
102+
LiteRadio_2_SE_V2_CC2500:0x03,
103+
LiteRadio_3_SX1280:0x04,
104+
LiteRadio_3_CC2500:0x05,
105+
LiteRadio_1_CC2500:0x06,
106+
LiteRadio_4_SE_SX1280:0x07,
107+
LiteRadio_2_SIM:0x08,
108+
}
109+
110+
98111
function getBytesFromWordArray(wordArray) {
99112
const result = [];
100113
result.push(wordArray.words[0] >>> 24);
@@ -1021,7 +1034,14 @@ show.initialize = function (callback) {
10211034
var bufName = new Buffer.alloc(8);
10221035
console.log("HidConfig.internal_radio_protocol:"+HidConfig.internal_radio_protocol);
10231036
console.log("HidConfig.Internal_radio_module_switch:"+HidConfig.Internal_radio_module_switch);
1024-
if(HidConfig.Internal_radio_module_switch){
1037+
if(getLiteRadioUnitType() == show_liteRadioUnitType.LiteRadio_2_SIM){
1038+
bufName[0] = 0x05;
1039+
bufName[1] = HidConfig.internal_radio_protocol;
1040+
bufName[2] = HidConfig.rocker_mode;
1041+
bufName[3] = 0x02;
1042+
usbSendData(bufName);
1043+
console.log("Send internal RF module switch:",bufName);
1044+
}else if(HidConfig.Internal_radio_module_switch){
10251045
bufName[0] = 0x05;
10261046
bufName[1] = HidConfig.internal_radio_protocol;
10271047
bufName[2] = HidConfig.rocker_mode;

0 commit comments

Comments
 (0)