From 436e6317744576ca6b00559937ca76235b7cd66b Mon Sep 17 00:00:00 2001 From: Jim Whitelaw Date: Thu, 14 Mar 2024 10:26:07 -0600 Subject: [PATCH] Format changes from trunk --- .trunk/trunk.yaml | 12 +- .vscode/extensions.json | 7 +- bin/build-esp32.sh | 6 +- bin/build-nrf52.sh | 6 +- bin/build-rpi2040.sh | 6 +- bin/buildinfo.py | 4 +- bin/bump_version.py | 8 +- bin/device-update.sh | 48 +++--- bin/dump-ram-users.sh | 2 +- bin/gen-images.sh | 2 +- bin/genpartitions.py | 10 +- bin/platformio-custom.py | 30 ++-- bin/promote-release.sh | 4 +- bin/readprops.py | 35 ++-- bin/test-simulator.sh | 1 - bin/uf2conv.py | 223 ++++++++++++++++--------- images/compass.png | Bin 845 -> 594 bytes images/face-24px.svg | 2 +- images/face.png | Bin 329 -> 225 bytes images/location_searching-24px.svg | 2 +- images/pin.png | Bin 288 -> 203 bytes images/room-24px.svg | 2 +- images/textsms-24px.svg | 2 +- monitor/filter_c3_exception_decoder.py | 21 +-- src/GPSStatus.h | 15 +- src/mesh/SX128xInterface.cpp | 6 +- src/mesh/compression/unishox2.h | 4 +- variants/trackerd/variant.h | 6 +- 28 files changed, 267 insertions(+), 197 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 0826b71d9d..f102c779de 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -1,6 +1,6 @@ version: 0.1 cli: - version: 1.20.1 + version: 1.21.0 plugins: sources: - id: trunk @@ -8,15 +8,15 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: - - trufflehog@3.68.5 + - trufflehog@3.69.0 - yamllint@1.35.1 - - bandit@1.7.7 - - checkov@3.2.32 + - bandit@1.7.8 + - checkov@3.2.38 - terrascan@1.19.1 - trivy@0.49.1 #- trufflehog@3.63.2-rc0 - taplo@0.8.1 - - ruff@0.3.1 + - ruff@0.3.2 - isort@5.13.2 - markdownlint@0.39.0 - oxipng@9.0.0 @@ -25,7 +25,7 @@ lint: - flake8@7.0.0 - hadolint@2.12.0 - shfmt@3.6.0 - - shellcheck@0.9.0 + - shellcheck@0.10.0 - black@24.2.0 - git-diff-check - gitleaks@8.18.2 diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 4fc84fa780..080e70d08b 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,8 +2,9 @@ // See http://go.microsoft.com/fwlink/?LinkId=827846 // for the documentation about the extensions.json format "recommendations": [ - "ms-vscode.cpptools", - "platformio.platformio-ide", - "trunk.io" + "platformio.platformio-ide" ], + "unwantedRecommendations": [ + "ms-vscode.cpptools-extension-pack" + ] } diff --git a/bin/build-esp32.sh b/bin/build-esp32.sh index f60331ed52..b79cbacf0e 100755 --- a/bin/build-esp32.sh +++ b/bin/build-esp32.sh @@ -2,8 +2,8 @@ set -e -VERSION=`bin/buildinfo.py long` -SHORT_VERSION=`bin/buildinfo.py short` +VERSION=$(bin/buildinfo.py long) +SHORT_VERSION=$(bin/buildinfo.py short) OUTDIR=release/ @@ -11,7 +11,7 @@ rm -f $OUTDIR/firmware* rm -r $OUTDIR/* || true # Important to pull latest version of libs into all device flavors, otherwise some devices might be stale -platformio pkg update +platformio pkg update echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS" rm -f .pio/build/$1/firmware.* diff --git a/bin/build-nrf52.sh b/bin/build-nrf52.sh index a9980f486b..c3a59dcbe5 100755 --- a/bin/build-nrf52.sh +++ b/bin/build-nrf52.sh @@ -2,8 +2,8 @@ set -e -VERSION=`bin/buildinfo.py long` -SHORT_VERSION=`bin/buildinfo.py short` +VERSION=$(bin/buildinfo.py long) +SHORT_VERSION=$(bin/buildinfo.py short) OUTDIR=release/ @@ -11,7 +11,7 @@ rm -f $OUTDIR/firmware* rm -r $OUTDIR/* || true # Important to pull latest version of libs into all device flavors, otherwise some devices might be stale -platformio pkg update +platformio pkg update echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS" rm -f .pio/build/$1/firmware.* diff --git a/bin/build-rpi2040.sh b/bin/build-rpi2040.sh index fe0725085a..8eebfc8f13 100755 --- a/bin/build-rpi2040.sh +++ b/bin/build-rpi2040.sh @@ -2,8 +2,8 @@ set -e -VERSION=`bin/buildinfo.py long` -SHORT_VERSION=`bin/buildinfo.py short` +VERSION=$(bin/buildinfo.py long) +SHORT_VERSION=$(bin/buildinfo.py short) OUTDIR=release/ @@ -11,7 +11,7 @@ rm -f $OUTDIR/firmware* rm -r $OUTDIR/* || true # Important to pull latest version of libs into all device flavors, otherwise some devices might be stale -platformio pkg update +platformio pkg update echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS" rm -f .pio/build/$1/firmware.* diff --git a/bin/buildinfo.py b/bin/buildinfo.py index 6b123c9cf4..2036970ea6 100755 --- a/bin/buildinfo.py +++ b/bin/buildinfo.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 import configparser import sys -from readprops import readProps +from readprops import readProps -verObj = readProps('version.properties') +verObj = readProps("version.properties") propName = sys.argv[1] print(f"{verObj[propName]}") diff --git a/bin/bump_version.py b/bin/bump_version.py index 6128fad945..43ed452d55 100755 --- a/bin/bump_version.py +++ b/bin/bump_version.py @@ -3,14 +3,14 @@ lines = None -with open('version.properties', 'r', encoding='utf-8') as f: +with open("version.properties", "r", encoding="utf-8") as f: lines = f.readlines() -with open('version.properties', 'w', encoding='utf-8') as f: +with open("version.properties", "w", encoding="utf-8") as f: for line in lines: if line.lstrip().startswith("build = "): words = line.split(" = ") - ver = f'build = {int(words[1]) + 1}' - f.write(f'{ver}\n') + ver = f"build = {int(words[1]) + 1}" + f.write(f"{ver}\n") else: f.write(line) diff --git a/bin/device-update.sh b/bin/device-update.sh index 7233f61f6e..6640741c02 100755 --- a/bin/device-update.sh +++ b/bin/device-update.sh @@ -1,10 +1,10 @@ #!/bin/sh -PYTHON=${PYTHON:-$(which python3 python|head -n 1)} +PYTHON=${PYTHON:-$(which python3 python | head -n 1)} # Usage info show_help() { -cat << EOF + cat <&2 - exit 1 - ;; - esac + case "${opt}" in + h) + show_help + exit 0 + ;; + p) + export ESPTOOL_PORT=${OPTARG} + ;; + P) + PYTHON=${OPTARG} + ;; + f) + FILENAME=${OPTARG} + ;; + *) + echo "Invalid flag." + show_help >&2 + exit 1 + ;; + esac done -shift "$((OPTIND-1))" +shift "$((OPTIND - 1))" [ -z "$FILENAME" -a -n "$1" ] && { - FILENAME=$1 - shift + FILENAME=$1 + shift } if [ -f "${FILENAME}" ] && [ -z "${FILENAME##*"update"*}" ]; then diff --git a/bin/dump-ram-users.sh b/bin/dump-ram-users.sh index 3cc3ce5dca..1fc5ebe45f 100755 --- a/bin/dump-ram-users.sh +++ b/bin/dump-ram-users.sh @@ -2,4 +2,4 @@ arm-none-eabi-readelf -s -e .pio/build/nrf52dk/firmware.elf | head -80 -nm -CSr --size-sort .pio/build/nrf52dk/firmware.elf | grep '^200' +nm -CSr --size-sort .pio/build/nrf52dk/firmware.elf | grep '^200' diff --git a/bin/gen-images.sh b/bin/gen-images.sh index 0c10fddb84..b6a4b2fe08 100755 --- a/bin/gen-images.sh +++ b/bin/gen-images.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -e +set -e # regen the design bins first cd design diff --git a/bin/genpartitions.py b/bin/genpartitions.py index 2e1a9f1de1..930fdc4528 100755 --- a/bin/genpartitions.py +++ b/bin/genpartitions.py @@ -10,7 +10,9 @@ start = 0x9000 nvssys = 0x3000 -nvsuser = 0x2000 # NOTE: ti seems total size of nvssys MUST be 0x5000 or device will bootloop +nvsuser = ( + 0x2000 # NOTE: ti seems total size of nvssys MUST be 0x5000 or device will bootloop +) nvs = nvssys + nvsuser ota = 0x2000 # app = 0x1c0000 @@ -18,7 +20,7 @@ # treat sys part sizes + spiffs size as reserved, then calculate what appsize can be reserved = start + nvs + ota + spi -maxsize = 0x400000 # 4MB +maxsize = 0x400000 # 4MB app = (maxsize - reserved) / 2 @@ -36,6 +38,8 @@ otadata, data, ota, , 0x{ota:x}, app0, app, ota_0, , 0x{app:x}, app1, app, ota_1, , 0x{app:x}, -spiffs, data, spiffs, , 0x{spi:x} """.format(**locals()) +spiffs, data, spiffs, , 0x{spi:x} """.format( + **locals() +) print(table) diff --git a/bin/platformio-custom.py b/bin/platformio-custom.py index e03a35e3a3..5b0da4ba58 100644 --- a/bin/platformio-custom.py +++ b/bin/platformio-custom.py @@ -1,13 +1,15 @@ -import subprocess import configparser -import traceback +import subprocess import sys +import traceback from os.path import join + from readprops import readProps Import("env") platform = env.PioPlatform() + def esp32_create_combined_bin(source, target, env): # this sub is borrowed from ESPEasy build toolchain. It's licensed under GPL V3 # https://github.com/letscontrolit/ESPEasy/blob/mega/tools/pio/post_esp32.py @@ -20,8 +22,8 @@ def esp32_create_combined_bin(source, target, env): firmware_name = env.subst("$BUILD_DIR/${PROGNAME}.bin") chip = env.get("BOARD_MCU") flash_size = env.BoardConfig().get("upload.flash_size") - flash_freq = env.BoardConfig().get("build.f_flash", '40m') - flash_freq = flash_freq.replace('000000L', 'm') + flash_freq = env.BoardConfig().get("build.f_flash", "40m") + flash_freq = flash_freq.replace("000000L", "m") flash_mode = env.BoardConfig().get("build.flash_mode", "dio") memory_type = env.BoardConfig().get("build.arduino.memory_type", "qio_qspi") if flash_mode == "qio" or flash_mode == "qout": @@ -51,23 +53,27 @@ def esp32_create_combined_bin(source, target, env): print(f" - {hex(app_offset)} | {firmware_name}") cmd += [hex(app_offset), firmware_name] - print('Using esptool.py arguments: %s' % ' '.join(cmd)) + print("Using esptool.py arguments: %s" % " ".join(cmd)) esptool.main(cmd) -if (platform.name == "espressif32"): + +if platform.name == "espressif32": sys.path.append(join(platform.get_package_dir("tool-esptoolpy"))) import esptool - env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", esp32_create_combined_bin) + + env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", esp32_create_combined_bin) Import("projenv") prefsLoc = projenv["PROJECT_DIR"] + "/version.properties" verObj = readProps(prefsLoc) -print("Using meshtastic platformio-custom.py, firmware version " + verObj['long']) +print("Using meshtastic platformio-custom.py, firmware version " + verObj["long"]) # General options that are passed to the C and C++ compilers -projenv.Append(CCFLAGS=[ - "-DAPP_VERSION=" + verObj['long'], - "-DAPP_VERSION_SHORT=" + verObj['short'] -]) +projenv.Append( + CCFLAGS=[ + "-DAPP_VERSION=" + verObj["long"], + "-DAPP_VERSION_SHORT=" + verObj["short"], + ] +) diff --git a/bin/promote-release.sh b/bin/promote-release.sh index f96d2a568b..9edafd83ce 100755 --- a/bin/promote-release.sh +++ b/bin/promote-release.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash -set -e +set -e echo "This script is only for developers who are publishing new builds on github. Most users don't need it" -VERSION=`bin/buildinfo.py long` +VERSION=$(bin/buildinfo.py long) # Must have a V prefix to trigger github git tag "v${VERSION}" diff --git a/bin/readprops.py b/bin/readprops.py index ffa3615416..db8c8c0116 100644 --- a/bin/readprops.py +++ b/bin/readprops.py @@ -1,9 +1,7 @@ - - -import subprocess import configparser -import traceback +import subprocess import sys +import traceback def readProps(prefsLoc): @@ -11,27 +9,36 @@ def readProps(prefsLoc): config = configparser.RawConfigParser() config.read(prefsLoc) - version = dict(config.items('VERSION')) - verObj = dict(short = "{}.{}.{}".format(version["major"], version["minor"], version["build"]), - long = "unset") + version = dict(config.items("VERSION")) + verObj = dict( + short="{}.{}.{}".format(version["major"], version["minor"], version["build"]), + long="unset", + ) # Try to find current build SHA if if the workspace is clean. This could fail if git is not installed try: - sha = subprocess.check_output( - ['git', 'rev-parse', '--short', 'HEAD']).decode("utf-8").strip() - isDirty = subprocess.check_output( - ['git', 'diff', 'HEAD']).decode("utf-8").strip() + sha = ( + subprocess.check_output(["git", "rev-parse", "--short", "HEAD"]) + .decode("utf-8") + .strip() + ) + isDirty = ( + subprocess.check_output(["git", "diff", "HEAD"]).decode("utf-8").strip() + ) suffix = sha # if isDirty: # # short for 'dirty', we want to keep our verstrings source for protobuf reasons # suffix = sha + "-d" - verObj['long'] = "{}.{}.{}.{}".format( - version["major"], version["minor"], version["build"], suffix) + verObj["long"] = "{}.{}.{}.{}".format( + version["major"], version["minor"], version["build"], suffix + ) except: # print("Unexpected error:", sys.exc_info()[0]) # traceback.print_exc() - verObj['long'] = verObj['short'] + verObj["long"] = verObj["short"] # print("firmware version " + verStr) return verObj + + # print("path is" + ','.join(sys.path)) diff --git a/bin/test-simulator.sh b/bin/test-simulator.sh index 3c5f8f811a..132f621a95 100755 --- a/bin/test-simulator.sh +++ b/bin/test-simulator.sh @@ -8,4 +8,3 @@ sleep 20 # 5 seconds was not enough echo "Simulator started, launching python test..." python3 -c 'from meshtastic.test import testSimulator; testSimulator()' - diff --git a/bin/uf2conv.py b/bin/uf2conv.py index b619d14db0..b0fa8a3138 100755 --- a/bin/uf2conv.py +++ b/bin/uf2conv.py @@ -1,39 +1,38 @@ #!/usr/bin/env python3 -import sys -import struct -import subprocess -import re +import argparse import os import os.path -import argparse - +import re +import struct +import subprocess +import sys -UF2_MAGIC_START0 = 0x0A324655 # "UF2\n" -UF2_MAGIC_START1 = 0x9E5D5157 # Randomly selected -UF2_MAGIC_END = 0x0AB16F30 # Ditto +UF2_MAGIC_START0 = 0x0A324655 # "UF2\n" +UF2_MAGIC_START1 = 0x9E5D5157 # Randomly selected +UF2_MAGIC_END = 0x0AB16F30 # Ditto families = { - 'SAMD21': 0x68ed2b88, - 'SAML21': 0x1851780a, - 'SAMD51': 0x55114460, - 'NRF52': 0x1b57745f, - 'STM32F0': 0x647824b6, - 'STM32F1': 0x5ee21072, - 'STM32F2': 0x5d1a0a2e, - 'STM32F3': 0x6b846188, - 'STM32F4': 0x57755a57, - 'STM32F7': 0x53b80f00, - 'STM32G0': 0x300f5633, - 'STM32G4': 0x4c71240a, - 'STM32H7': 0x6db66082, - 'STM32L0': 0x202e3a91, - 'STM32L1': 0x1e1f432d, - 'STM32L4': 0x00ff6919, - 'STM32L5': 0x04240bdf, - 'STM32WB': 0x70d16653, - 'STM32WL': 0x21460ff0, - 'ATMEGA32': 0x16573617, - 'MIMXRT10XX': 0x4FB2D5BD + "SAMD21": 0x68ED2B88, + "SAML21": 0x1851780A, + "SAMD51": 0x55114460, + "NRF52": 0x1B57745F, + "STM32F0": 0x647824B6, + "STM32F1": 0x5EE21072, + "STM32F2": 0x5D1A0A2E, + "STM32F3": 0x6B846188, + "STM32F4": 0x57755A57, + "STM32F7": 0x53B80F00, + "STM32G0": 0x300F5633, + "STM32G4": 0x4C71240A, + "STM32H7": 0x6DB66082, + "STM32L0": 0x202E3A91, + "STM32L1": 0x1E1F432D, + "STM32L4": 0x00FF6919, + "STM32L5": 0x04240BDF, + "STM32WB": 0x70D16653, + "STM32WL": 0x21460FF0, + "ATMEGA32": 0x16573617, + "MIMXRT10XX": 0x4FB2D5BD, } INFO_FILE = "/INFO_UF2.TXT" @@ -46,15 +45,17 @@ def is_uf2(buf): w = struct.unpack(" 10*1024*1024: + if padding > 10 * 1024 * 1024: assert False, "More than 10M of padding needed at " + ptr if padding % 4 != 0: assert False, "Non-word padding size at " + ptr @@ -91,6 +92,7 @@ def convert_from_uf2(buf): curraddr = newaddr + datalen return outp + def convert_to_carray(file_content): outp = "const unsigned char bindata[] __attribute__((aligned(16))) = {" for i in range(len(file_content)): @@ -100,6 +102,7 @@ def convert_to_carray(file_content): outp += "\n};\n" return outp + def convert_to_uf2(file_content): global familyid datapadding = b"" @@ -109,13 +112,21 @@ def convert_to_uf2(file_content): outp = b"" for blockno in range(numblocks): ptr = 256 * blockno - chunk = file_content[ptr:ptr + 256] + chunk = file_content[ptr : ptr + 256] flags = 0x0 if familyid: flags |= 0x2000 - hd = struct.pack(b"= 3 and words[1] == "2" and words[2] == "FAT": drives.append(words[0]) else: @@ -206,7 +238,6 @@ def get_drives(): for d in os.listdir(rootpath): drives.append(os.path.join(rootpath, d)) - def has_info(d): try: return os.path.isfile(d + INFO_FILE) @@ -217,7 +248,7 @@ def has_info(d): def board_id(path): - with open(path + INFO_FILE, mode='r') as file: + with open(path + INFO_FILE, mode="r") as file: file_content = file.read() return re.search("Board-ID: ([^\r\n]*)", file_content).group(1) @@ -235,30 +266,61 @@ def write_file(name, buf): def main(): global appstartaddr, familyid + def error(msg): print(msg) sys.exit(1) - parser = argparse.ArgumentParser(description='Convert to UF2 or flash directly.') - parser.add_argument('input', metavar='INPUT', type=str, nargs='?', - help='input file (HEX, BIN or UF2)') - parser.add_argument('-b' , '--base', dest='base', type=str, - default="0x2000", - help='set base address of application for BIN format (default: 0x2000)') - parser.add_argument('-o' , '--output', metavar="FILE", dest='output', type=str, - help='write output to named file; defaults to "flash.uf2" or "flash.bin" where sensible') - parser.add_argument('-d' , '--device', dest="device_path", - help='select a device path to flash') - parser.add_argument('-l' , '--list', action='store_true', - help='list connected devices') - parser.add_argument('-c' , '--convert', action='store_true', - help='do not flash, just convert') - parser.add_argument('-D' , '--deploy', action='store_true', - help='just flash, do not convert') - parser.add_argument('-f' , '--family', dest='family', type=str, - default="0x0", - help='specify familyID - number or name (default: 0x0)') - parser.add_argument('-C' , '--carray', action='store_true', - help='convert binary file to a C array, not UF2') + + parser = argparse.ArgumentParser(description="Convert to UF2 or flash directly.") + parser.add_argument( + "input", + metavar="INPUT", + type=str, + nargs="?", + help="input file (HEX, BIN or UF2)", + ) + parser.add_argument( + "-b", + "--base", + dest="base", + type=str, + default="0x2000", + help="set base address of application for BIN format (default: 0x2000)", + ) + parser.add_argument( + "-o", + "--output", + metavar="FILE", + dest="output", + type=str, + help='write output to named file; defaults to "flash.uf2" or "flash.bin" where sensible', + ) + parser.add_argument( + "-d", "--device", dest="device_path", help="select a device path to flash" + ) + parser.add_argument( + "-l", "--list", action="store_true", help="list connected devices" + ) + parser.add_argument( + "-c", "--convert", action="store_true", help="do not flash, just convert" + ) + parser.add_argument( + "-D", "--deploy", action="store_true", help="just flash, do not convert" + ) + parser.add_argument( + "-f", + "--family", + dest="family", + type=str, + default="0x0", + help="specify familyID - number or name (default: 0x0)", + ) + parser.add_argument( + "-C", + "--carray", + action="store_true", + help="convert binary file to a C array, not UF2", + ) args = parser.parse_args() appstartaddr = int(args.base, 0) @@ -268,14 +330,17 @@ def error(msg): try: familyid = int(args.family, 0) except ValueError: - error("Family ID needs to be a number or one of: " + ", ".join(families.keys())) + error( + "Family ID needs to be a number or one of: " + + ", ".join(families.keys()) + ) if args.list: list_drives() else: if not args.input: error("Need input file") - with open(args.input, mode='rb') as f: + with open(args.input, mode="rb") as f: inpbuf = f.read() from_uf2 = is_uf2(inpbuf) ext = "uf2" @@ -291,8 +356,10 @@ def error(msg): ext = "h" else: outbuf = convert_to_uf2(inpbuf) - print("Converting to %s, output size: %d, start address: 0x%x" % - (ext, len(outbuf), appstartaddr)) + print( + "Converting to %s, output size: %d, start address: 0x%x" + % (ext, len(outbuf), appstartaddr) + ) if args.convert or ext != "uf2": drives = [] if args.output == None: diff --git a/images/compass.png b/images/compass.png index 8639dde5241d720e47e97d63280ec8073928c2b4..c4e5b589bc42cd7b05148dbbdee01ce0fe689548 100644 GIT binary patch delta 561 zcmV-10?z%-2GRtO83+Ub008|9F$|G07k>f-NklyvaQ|Snd!k0 z`OI;De`Ye9Uv~M=M1R(0gMZLqh6X-u)u4?}gX=K75ti8{AR4f`yk!Xo>{a+clz*{~ zS-?t;4MHM~72@M!Xo7>D5=T6yMwv0j@Tjp$r>9Aaf?4_RvEr{NF-VEc*cngsTjXN9 zKczyNS{PNkjF4(sU2O#u zRdw#WqqAXKWlx_6mt!NXR2>tYyBeY9QCJ zQCGwKFHzsRiH&l9o#Y02Y~=MDT*1aw{RSm$c>Q&fFZs?;mwZSfUqV)~@l>*(k*J|Y zmW{8HeV;@#bY)bOt#9BLQ>56HuuV+8k<4vUEva!mi-~zPt`|w=@KFNKxqpVPB0nVS z2!{-FYA^e^=*aP2G6HU+!6%Y+K#?qys(i#cT3lKx<%}w6<~difdyJx~z==u=*`mxK z9i+&9KCP@vWKiMvJ}k34xi>OA2~&+|RTG33(J{P+!6XA~>9XlIu1FbDP=?y*BR z;Rj@!MI0F3G%GY?r#a*~4<4AhKtF+(4KB3b>M76a97!*<00000NkvXXu0mjfa`FP& delta 814 zcmV+}1JV4_1kDDJ85jlt00374`G)`i00eVFNmK|32nc)#WQdU=7k>a5bVXQnQ*UN; zcVTj60C#tHE@^ISb7Ns}WiD@WXPfRk8UO$S%1J~)RA_# zlVG9=+yX8ERp5{xHUHjipp{U_HZYT?`L8j?9|8**v=)F3qJMjFj~t4aCi=;L!@LW& zoCWqHbhl9+PU|sA$_m;QU?)QVzJfMjW(e8U+E1uRxQDyIqN{KL_$Y*b0JE;b5tK1Q zGMKA{`PNvoDg-^;#{4iA3HSCj7r~c8?17`fG&~YHpW6x@XK;Dok!`B9rN&?{bbvV< zp_>doiBC!f(|^zwxo^ZZOj=0E73EWRU#XF~>TwN|3OFgQ-&@?49B(<+B1st_7V#~3#4TA+tiP#lwt>$7&WC0Dr z{($5jXp8F$D%R3*QCv6U8fGcrs9sJi(|MUBDP<_{U(3CX4q z+fXn#j3*-JGZ(QHA?9JWfqAh+csaf7B3J-E2*IDg5ht6`RDkayR}+PUuXBW-$_~0) z%4y)O$k7GPXeC$^;yuhBwxXatOW1r5xTm1~k0NFxFO%%!w((xV3`wcGh3>&KU=Ex1 zB9eKSZGT{vDYgbYCi-CO3vgJ?wP1$mp6Ev#xC31FO_uzq`So0&Q1-? s({2H;f!`WQC;t \ No newline at end of file + \ No newline at end of file diff --git a/images/face.png b/images/face.png index 036e29f7349217607c53f48aed28e99484a3e648..eb6b91e13b89f3a0d27efbaf83e35f2c1f70b3c5 100644 GIT binary patch delta 188 zcmV;t07L)D0^tFW83+Ub007wHEccNy7=M#VL_t(|+J(?P4gpaVhT*4BON@<(8woX? zLS_XDt%M~QvlYFcZ7@+#}B!d5~QJk`Ieg!u6Zu6ANf zfL!gRuO;*HjTun5835X*7IGKhu7|lHM&<}gpfJPQ7!xa`&cN2*zmpA+s4PV*4=Ejh qpmLB3Qb!McqD1DRbhgoH-0ltI05a+a8KhYN0000MzCV_|S*E^l&Yo9;Xs0002SNkl|LzC>pdL!hvB*6^ z(FP3ghR+|)I{B>%HGlAmX$!bfu}tCvee7YJxCxG7C(s-nTw~VwY#*06!YQtBUMH70 zi@(7|{4jAn^8$AB@Q#!CLv-W2IEX*a+~1nu!S8y;ee \ No newline at end of file + \ No newline at end of file diff --git a/images/pin.png b/images/pin.png index 112a7ce8ed6a7537c73dc2626d2f6cab93d87fbc..3c91a726c3cf3c5605e1580a89e35f84850da2f6 100644 GIT binary patch delta 166 zcmV;X09pT_0?PrA83+Ub007wHEccNy7=L|9L_t(|+KtdL4#5BzhT&&nDRCHfEL=e( zB;q9E1TG-%!VTP@Sj56g`b(r~qv_D+8{h5I#MH^f(L}{sCVtDTDD}LA)J`fqbrr@! z7-A%Zk-|U-3oM1uS7>_(Z)YFju0?4pif#PqxaHw0Q8CZcOpSxES1YlXGMzCV_|S*E^l&Yo9;Xs0001;Nkl# BWEB7a diff --git a/images/room-24px.svg b/images/room-24px.svg index 79a4807e7c..48e55ab80e 100644 --- a/images/room-24px.svg +++ b/images/room-24px.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/images/textsms-24px.svg b/images/textsms-24px.svg index 4455f047e3..84c4fdcc1d 100644 --- a/images/textsms-24px.svg +++ b/images/textsms-24px.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/monitor/filter_c3_exception_decoder.py b/monitor/filter_c3_exception_decoder.py index e59b0be2a4..6d7b5370c2 100644 --- a/monitor/filter_c3_exception_decoder.py +++ b/monitor/filter_c3_exception_decoder.py @@ -18,10 +18,7 @@ import sys from platformio.project.exception import PlatformioException -from platformio.public import ( - DeviceMonitorFilterBase, - load_build_metadata, -) +from platformio.public import DeviceMonitorFilterBase, load_build_metadata # By design, __init__ is called inside miniterm and we can't pass context to it. # pylint: disable=attribute-defined-outside-init @@ -32,7 +29,7 @@ class Esp32C3ExceptionDecoder(DeviceMonitorFilterBase): NAME = "esp32_c3_exception_decoder" - PCADDR_PATTERN = re.compile(r'0x4[0-9a-f]{7}', re.IGNORECASE) + PCADDR_PATTERN = re.compile(r"0x4[0-9a-f]{7}", re.IGNORECASE) def __call__(self): self.buffer = "" @@ -75,14 +72,14 @@ def setup_paths(self): % self.__class__.__name__ ) return False - + if not os.path.isfile(self.addr2line_path): sys.stderr.write( "%s: disabling, addr2line at %s does not exist\n" % (self.__class__.__name__, self.addr2line_path) ) return False - + return True except PlatformioException as e: sys.stderr.write( @@ -117,7 +114,7 @@ def rx(self, text): trace = self.get_backtrace(m) if len(trace) != "": - text = text[: last] + trace + text[last :] + text = text[:last] + trace + text[last:] last += len(trace) return text @@ -125,14 +122,10 @@ def rx(self, text): def get_backtrace(self, match): trace = "\n" enc = "mbcs" if IS_WINDOWS else "utf-8" - args = [self.addr2line_path, u"-fipC", u"-e", self.firmware_path] + args = [self.addr2line_path, "-fipC", "-e", self.firmware_path] try: addr = match.group() - output = ( - subprocess.check_output(args + [addr]) - .decode(enc) - .strip() - ) + output = subprocess.check_output(args + [addr]).decode(enc).strip() output = output.replace( "\n", "\n " ) # newlines happen with inlined methods diff --git a/src/GPSStatus.h b/src/GPSStatus.h index bcfb5f2eb5..81d348c2b6 100644 --- a/src/GPSStatus.h +++ b/src/GPSStatus.h @@ -88,20 +88,11 @@ class GPSStatus : public Status } } - uint32_t getDOP() const - { - return p.PDOP; - } + uint32_t getDOP() const { return p.PDOP; } - uint32_t getHeading() const - { - return p.ground_track; - } + uint32_t getHeading() const { return p.ground_track; } - uint32_t getNumSatellites() const - { - return p.sats_in_view; - } + uint32_t getNumSatellites() const { return p.sats_in_view; } bool matches(const GPSStatus *newStatus) const { diff --git a/src/mesh/SX128xInterface.cpp b/src/mesh/SX128xInterface.cpp index d0103ec291..00894536bc 100644 --- a/src/mesh/SX128xInterface.cpp +++ b/src/mesh/SX128xInterface.cpp @@ -251,9 +251,9 @@ template void SX128xInterface::startReceive() #endif // We use the PREAMBLE_DETECTED and HEADER_VALID IRQ flag to detect whether we are actively receiving - int err = lora.startReceive(RADIOLIB_SX128X_RX_TIMEOUT_INF, RADIOLIB_SX128X_IRQ_RX_DEFAULT | - RADIOLIB_SX128X_IRQ_PREAMBLE_DETECTED | - RADIOLIB_SX128X_IRQ_HEADER_VALID); + int err = + lora.startReceive(RADIOLIB_SX128X_RX_TIMEOUT_INF, RADIOLIB_SX128X_IRQ_RX_DEFAULT | RADIOLIB_SX128X_IRQ_PREAMBLE_DETECTED | + RADIOLIB_SX128X_IRQ_HEADER_VALID); assert(err == RADIOLIB_ERR_NONE); diff --git a/src/mesh/compression/unishox2.h b/src/mesh/compression/unishox2.h index a5117a5de0..e051375688 100644 --- a/src/mesh/compression/unishox2.h +++ b/src/mesh/compression/unishox2.h @@ -156,8 +156,8 @@ 3, 1, 3, 3, 3 \ } -//#define USX_HCODES_FAVOR_UMLAUT {0x00, 0x40, 0xE0, 0xC0, 0x80} -//#define USX_HCODE_LENS_FAVOR_UMLAUT {2, 2, 3, 3, 2} +// #define USX_HCODES_FAVOR_UMLAUT {0x00, 0x40, 0xE0, 0xC0, 0x80} +// #define USX_HCODE_LENS_FAVOR_UMLAUT {2, 2, 3, 3, 2} /// Horizontal codes preset favouring umlaut letters #define USX_HCODES_FAVOR_UMLAUT \ diff --git a/variants/trackerd/variant.h b/variants/trackerd/variant.h index b3fca367f0..09dcd422ce 100644 --- a/variants/trackerd/variant.h +++ b/variants/trackerd/variant.h @@ -10,7 +10,7 @@ #define LED_PIN 13 // 13 red, 2 blue, 15 red -//#define HAS_BUTTON 0 +// #define HAS_BUTTON 0 #define BUTTON_PIN 0 #define BUTTON_NEED_PULLUP @@ -42,5 +42,5 @@ #define ADC_MULTIPLIER VBAT_DIVIDER_COMP #define VBAT_RAW_TO_SCALED(x) (REAL_VBAT_MV_PER_LSB * x) -//#define BATTERY_SENSE_SAMPLES 15 // Set the number of samples, It has an effect of increasing sensitivity. -//#define ADC_MULTIPLIER 3.3 \ No newline at end of file +// #define BATTERY_SENSE_SAMPLES 15 // Set the number of samples, It has an effect of increasing sensitivity. +// #define ADC_MULTIPLIER 3.3 \ No newline at end of file