Skip to content

Commit

Permalink
Add support for dual frequency radio chips (LR1121)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkendall64 committed Apr 1, 2024
1 parent eecca44 commit 13d768c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
<option value="rx_2400" id="rx_2400" disabled>2.4GHz Receiver</option>
<option value="tx_900" id="tx_900" disabled>900MHz Transmitter</option>
<option value="rx_900" id="rx_900" disabled>900MHz Receiver</option>
<option value="tx_dual" id="tx_dual" disabled>Dual Frequency 2.4GHz/900Mhz Transmitter</option>
<option value="rx_dual" id="rx_dual" disabled>Dual Frequency 2.4GHz/900Mhz Receiver</option>
</select>
<label>Device Type</label>
</div>
Expand Down Expand Up @@ -117,13 +119,13 @@
</div>

<div class="mui-select tx_2400 rx_2400 display--none">
<label>Region</label>
<select id='fcclbt' name='fcclbt'>
<option value='FCC' selected>FCC</option>
<option value='LBT'>LBT</option>
</select>
<label>Region</label>
</div>
<div class="mui-select tx_900 rx_900 display--none">
<div class="mui-select tx_900 rx_900 tx_dual rx_dual display--none">
<select id='domain' name='domain'>
<option value='0'>AU915</option>
<option value='1' selected>FCC915</option>
Expand Down
11 changes: 8 additions & 3 deletions src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,10 @@ _('step-2').onclick = (e) => {
vendorSelect.onchange = () => {
_('tx_2400').disabled = true
_('tx_900').disabled = true
_('tx_dual').disabled = true
_('rx_2400').disabled = true
_('rx_900').disabled = true
_('rx_dual').disabled = true
for (const k in hardware[vendorSelect.value]) {
if (_(k) !== null) _(k).disabled = false
}
Expand Down Expand Up @@ -432,6 +434,8 @@ deviceNext.onclick = (e) => {
setDisplay('.rx_2400', false)
setDisplay('.tx_900', false)
setDisplay('.rx_900', false)
setDisplay('.tx_dual', false)
setDisplay('.rx_dual', false)
setDisplay('.esp8285', false)
setDisplay('.esp32', false)
setDisplay('.stm32', false)
Expand Down Expand Up @@ -500,7 +504,7 @@ const getSettings = async (deviceType) => {
options['uart-inverted'] = _('uart-inverted').checked
options['unlock-higher-power'] = _('unlock-higher-power').checked
}
if (typeSelect.value === 'rx_900' || typeSelect.value === 'tx_900') {
if (typeSelect.value.endsWith('_900') || typeSelect.value.endsWith('_dual')) {
options.domain = +_('domain').value
}
if (config.features !== undefined && config.features.indexOf('buzzer') !== -1) {
Expand All @@ -524,7 +528,7 @@ const getSettings = async (deviceType) => {
const connectUART = async (e) => {
e.preventDefault()
const deviceType = typeSelect.value.startsWith('tx_') ? 'TX' : 'RX'
const radioType = typeSelect.value.endsWith('_900') ? 'sx127x' : 'sx128x'
const radioType = typeSelect.value.endsWith('_900') ? 'sx127x' : (typeSelect.value.endsWith('_2400') ? 'sx128x' : 'lr1121')
term.clear()
const { config, firmwareUrl, options } = await getSettings(deviceType)
try {
Expand Down Expand Up @@ -582,7 +586,7 @@ const connectUART = async (e) => {

const generateFirmware = async () => {
const deviceType = typeSelect.value.startsWith('tx_') ? 'TX' : 'RX'
const radioType = typeSelect.value.endsWith('_900') ? 'sx127x' : 'sx128x'
const radioType = typeSelect.value.endsWith('_900') ? 'sx127x' : (typeSelect.value.endsWith('_2400') ? 'sx128x' : 'lr1121')
const { config, firmwareUrl, options } = await getSettings(deviceType)
const firmwareFiles = await Configure.download(deviceType, radioType, config, firmwareUrl, options)
return [
Expand Down Expand Up @@ -856,6 +860,7 @@ async function fileSelectHandler (e) {
}
}

// Need to do something about C3 & LR1121
async function parseFile (file) {
const reader = new FileReader()
reader.onload = async function (e) {
Expand Down

0 comments on commit 13d768c

Please sign in to comment.