Skip to content

Commit

Permalink
Moving files around to match main repo
Browse files Browse the repository at this point in the history
  • Loading branch information
pkendall64 committed Sep 10, 2023
1 parent fe9e0b0 commit 4c475cc
Show file tree
Hide file tree
Showing 84 changed files with 374 additions and 64 deletions.
35 changes: 22 additions & 13 deletions targets_validator.py → .github/targets_validator.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
import os, sys
import json
import glob
import argparse

hadError = False
warnEnabled = False
firmwares = set()

def error(msg):
global hadError
hadError = True
print(msg)

def warn(msg):
if warnEnabled:
global hadError
hadError = True
print(msg)

def validate_stm32(vendor, type, devname, device):
for method in device['upload_methods']:
if method not in ['stlink', 'dfu', 'uart', 'wifi', 'betaflight', 'stock']:
Expand All @@ -34,14 +42,19 @@ def validate_esp(vendor, type, devname, device):
if len(device['lua_name']) > 16:
error(f'device "{vendor}.{type}.{devname}" must have a "lua_name" of 16 characters or less')
# validate layout_file
if not device['firmware'].startswith('Unified'):
error(f'ESP target "{vendor}.{type}.{devname}" must be using a Unified firmware')
if 'layout_file' not in device:
error(f'device "{vendor}.{type}.{devname}" must have a "layout_file" child element')
else:
dir = 'hardware/' + ('RX/' if type.startswith('rx') else 'TX/')
dir = ('RX/' if type.startswith('rx') else 'TX/')
if not os.path.isfile(dir + device['layout_file']):
layout_file = device['layout_file']
error(f'File specified by layout_file "{layout_file}" in target "{vendor}.{type}.{devname}", does not exist')
# could validate overlay
if 'prior_target_name' not in device:
warn(f'device "{vendor}.{type}.{devname}" should have a "prior_target_name" child element')


def validate_esp32(vendor, type, devname, device):
for method in device['upload_methods']:
Expand All @@ -62,6 +75,8 @@ def validate_devices(vendor, type, devname, device):
error(f'device "{vendor}.{type}.{devname}" must have a "product_name" child element')
if 'upload_methods' not in device:
error(f'device "{vendor}.{type}.{devname}" must have a "upload_methods" child element')
if 'min_version' not in device:
error(f'device "{vendor}.{type}.{devname}" must have a "min_version" child element')

if 'firmware' not in device:
error(f'device "{vendor}.{type}.{devname}" must have a "firmware" child element')
Expand Down Expand Up @@ -105,21 +120,15 @@ def validate_vendor(name, types):
validate_devices(name, type, device, types[type][device])

if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Configure Binary Firmware")
parser.add_argument("--warn", "-w", action='store_true', default=False, help="Print warnings")
args = parser.parse_args()
warnEnabled = args.warn

targets = {}
with open('hardware/targets.json') as f:
with open('targets.json') as f:
targets = json.load(f)

for inifile in glob.iglob('targets/*.ini'):
with open(inifile) as ini:
for line in ini:
if line.startswith('[env:'):
try:
firmware_file = line[5:line.index('_via_')]
firmwares.add(firmware_file)
except ValueError:
print(line)
None

for vendor in targets:
validate_vendor(vendor, targets[vendor])

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -15,11 +15,11 @@ jobs:

- name: Validate hardware target files
run: |
python targets_validator.py
python .github/targets_validator.py
- name: Create hardware target zip
run: |
zip -r -9 hardware.zip ./hardware
zip -r -9 hardware.zip *
- name: Upload hardware target zip to ExpressLRS artifactory
env:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@

"radio_miso": 33,
"radio_mosi": 32,
"radio_rst": 26,
"radio_sck": 25,

"radio_busy": 36,
"radio_dio1": 37,
"radio_nss": 27,
"radio_rst": 26,

"radio_busy_2": 39,
"radio_dio1_2": 34,
"radio_nss_2": 13,
"radio_rst_2": 21,

"power_rxen": 10,
"power_txen": 14,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@

"radio_miso": 33,
"radio_mosi": 32,
"radio_rst": 26,
"radio_sck": 25,

"radio_busy": 36,
"radio_dio1": 37,
"radio_nss": 27,
"radio_rst": 26,

"radio_busy_2": 39,
"radio_dio1_2": 34,
"radio_nss_2": 13,
"radio_rst_2": 21,

"power_rxen": 10,
"power_txen": 14,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@

"radio_miso": 33,
"radio_mosi": 32,
"radio_rst": 26,
"radio_sck": 25,

"radio_busy": 36,
"radio_dio1": 37,
"radio_nss": 27,
"radio_rst": 26,

"radio_busy_2": 39,
"radio_dio1_2": 34,
"radio_nss_2": 13,
"radio_rst_2": 21,

"power_min": 0,
"power_high": 0,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"i2c_scl": 18,
"vbat": 39,
"button": 0,
"vbat_scale": 1024,
"vbat_offset": -62,
"vbat_scale": 700,
"vbat_offset": -30,
"vbat_atten": 7
}
4 changes: 2 additions & 2 deletions hardware/RX/Vario 2400.json → RX/Vario 2400.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"pwm_outputs": [14,1,3,15,2,4],
"vbat": 39,
"button": 0,
"vbat_scale": 700,
"vbat_offset": -30,
"vbat_scale": 1024,
"vbat_offset": -62,
"vbat_atten": 7
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@

"radio_miso": 33,
"radio_mosi": 32,
"radio_rst": 26,
"radio_sck": 25,

"radio_busy": 36,
"radio_dio1": 37,
"radio_nss": 27,
"radio_rst": 26,

"radio_busy_2": 39,
"radio_dio1_2": 34,
"radio_nss_2": 13,
"radio_rst_2": 21,

"power_rxen": 10,
"power_txen": 14,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"ledidx_rgb_boot": [0],

"use_backpack": true,
"debug_backpack_baud": 420000,
"debug_backpack_rx": 3,
"debug_backpack_tx": 1,
"debug_backpack_baud": 460800,
"debug_backpack_rx": 18,
"debug_backpack_tx": 5,
"backpack_boot": 23,
"backpack_en": 19
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions TX/Jumper T-20 2400.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"serial_rx": 3,
"serial_tx": 1,
"radio_busy": 21,
"radio_dio1": 4,
"radio_miso": 19,
"radio_mosi": 23,
"radio_nss": 5,
"radio_rst": 14,
"radio_sck": 18,
"radio_dcdc": true,
"power_enable": 25,
"power_rxen": 27,
"power_txen": 26,
"power_lna_gain": 12,
"power_min": 1,
"power_high": 6,
"power_max": 6,
"power_default": 2,
"power_control": 0,
"power_values": [-16,-13,-9,-5,-3,3]
}
19 changes: 19 additions & 0 deletions TX/Jumper T-20 900.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"serial_rx": 3,
"serial_tx": 1,
"radio_dio0": 26,
"radio_dio1": 25,
"radio_miso": 19,
"radio_mosi": 23,
"radio_nss": 5,
"radio_rst": 14,
"radio_sck": 18,
"power_rxen": 13,
"power_txen": 12,
"power_min": 4,
"power_high": 6,
"power_max": 6,
"power_default": 4,
"power_control": 0,
"power_values": [0,3,15]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions logo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Logos for TFT/OLED display

TFT color displays logos must be sized 160x53 in RGB565 raw format, so the file will be 16960 bytes in size.
```bash
ffmpeg -vcodec png -i input.png -vcodec rawvideo -f rawvideo -pix_fmt rgb565 logo.bin
```

Logos for display on the OLED screen must be size 128x64 for normal sized or 128x32 for small screen size.
OLED logos are in monochrome raw format.

```bash
convert ~/Downloads/logo.bmp -monochrome -colors 2 -type bilevel -write MONO:logo.bin
```
Binary file added logo/axis_tft.bin
Binary file not shown.
Binary file added logo/betafpv.bin
Binary file not shown.
Binary file added logo/elrs32.bin
Binary file not shown.
Binary file added logo/elrs64.bin
Binary file not shown.
Binary file added logo/emax.bin
Binary file not shown.
1 change: 1 addition & 0 deletions logo/geprc_tft.bin

Large diffs are not rendered by default.

Binary file added logo/jumper.bin
Binary file not shown.
Binary file added logo/namimno.bin
Binary file not shown.
Binary file added logo/radiomaster.bin
Binary file not shown.
Loading

0 comments on commit 4c475cc

Please sign in to comment.