mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-06 03:29:17 +00:00
Compare commits
26 Commits
c82f23ed2a
...
535b89dee6
Author | SHA1 | Date | |
---|---|---|---|
![]() |
535b89dee6 | ||
![]() |
ff92b869e0 | ||
![]() |
f1a8900288 | ||
![]() |
16bc89ea57 | ||
![]() |
6edf74e8f1 | ||
![]() |
7f280dd556 | ||
![]() |
2396aa77ca | ||
![]() |
d3cbbfd345 | ||
![]() |
c003ab0eee | ||
![]() |
4fcf7fe027 | ||
![]() |
9cc79b1d1e | ||
![]() |
403fa15a3f | ||
![]() |
b0087fd328 | ||
![]() |
fb74e1d182 | ||
![]() |
29a7866fc1 | ||
![]() |
2f552d15e5 | ||
![]() |
892e0922ff | ||
![]() |
d21d6c1301 | ||
![]() |
031aecac66 | ||
![]() |
7c10caa78b | ||
![]() |
5196ee39cb | ||
![]() |
02a5a91da0 | ||
![]() |
b2a89b8136 | ||
![]() |
15019e8663 | ||
![]() |
35814fd4bc | ||
![]() |
6aabbedc00 |
66
.github/workflows/build_debian_src.yml
vendored
Normal file
66
.github/workflows/build_debian_src.yml
vendored
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
name: Build Debian Source Package
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
secrets:
|
||||||
|
PPA_GPG_PRIVATE_KEY:
|
||||||
|
required: true
|
||||||
|
inputs:
|
||||||
|
series:
|
||||||
|
description: 'Ubuntu series to target'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-debian-src:
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
path: meshtasticd
|
||||||
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
|
||||||
|
- name: Install deps
|
||||||
|
shell: bash
|
||||||
|
working-directory: meshtasticd
|
||||||
|
run: |
|
||||||
|
sudo apt-get update -y --fix-missing
|
||||||
|
sudo apt-get install -y software-properties-common
|
||||||
|
sudo add-apt-repository ppa:meshtastic/meshtastic-daily -y
|
||||||
|
sudo apt-get install -y build-essential devscripts equivs
|
||||||
|
sudo mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
|
||||||
|
|
||||||
|
- name: Import GPG key
|
||||||
|
uses: crazy-max/ghaction-import-gpg@v6
|
||||||
|
with:
|
||||||
|
gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
|
||||||
|
id: gpg
|
||||||
|
|
||||||
|
- name: Get release version string
|
||||||
|
working-directory: meshtasticd
|
||||||
|
run: |
|
||||||
|
echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT
|
||||||
|
id: version
|
||||||
|
|
||||||
|
- name: Fetch libdeps, package debian source
|
||||||
|
working-directory: meshtasticd
|
||||||
|
run: debian/ci_pack_sdeb.sh
|
||||||
|
env:
|
||||||
|
SERIES: ${{ inputs.series }}
|
||||||
|
GPG_KEY_ID: ${{ steps.gpg.outputs.keyid }}
|
||||||
|
PKG_VERSION: ${{ steps.version.outputs.deb }}
|
||||||
|
|
||||||
|
- name: Store binaries as an artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: firmware-debian-${{ steps.version.outputs.deb }}~${{ inputs.series }}-src
|
||||||
|
overwrite: true
|
||||||
|
path: |
|
||||||
|
meshtasticd_${{ steps.version.outputs.deb }}*
|
5
.github/workflows/main_matrix.yml
vendored
5
.github/workflows/main_matrix.yml
vendored
@ -332,12 +332,17 @@ jobs:
|
|||||||
run: >-
|
run: >-
|
||||||
bin/bump_version.py
|
bin/bump_version.py
|
||||||
|
|
||||||
|
- name: Update debian changelog
|
||||||
|
run: >-
|
||||||
|
debian/ci_changelog.sh
|
||||||
|
|
||||||
- name: Create version.properties pull request
|
- name: Create version.properties pull request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v7
|
||||||
with:
|
with:
|
||||||
title: Bump version.properties
|
title: Bump version.properties
|
||||||
add-paths: |
|
add-paths: |
|
||||||
version.properties
|
version.properties
|
||||||
|
debian/changelog
|
||||||
|
|
||||||
release-firmware:
|
release-firmware:
|
||||||
strategy:
|
strategy:
|
||||||
|
68
.github/workflows/package_ppa.yml
vendored
Normal file
68
.github/workflows/package_ppa.yml
vendored
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
name: Package Launchpad PPA
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
secrets:
|
||||||
|
PPA_GPG_PRIVATE_KEY:
|
||||||
|
required: true
|
||||||
|
inputs:
|
||||||
|
series:
|
||||||
|
description: 'Ubuntu series to target'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-debian-src:
|
||||||
|
uses: ./.github/workflows/build_debian_src.yml
|
||||||
|
secrets: inherit
|
||||||
|
with:
|
||||||
|
series: ${{ inputs.series }}
|
||||||
|
|
||||||
|
package-ppa:
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
needs: build-debian-src
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
path: meshtasticd
|
||||||
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
|
||||||
|
- name: Install deps
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo apt-get update -y --fix-missing
|
||||||
|
sudo apt-get install -y dput
|
||||||
|
|
||||||
|
- name: Import GPG key
|
||||||
|
uses: crazy-max/ghaction-import-gpg@v6
|
||||||
|
with:
|
||||||
|
gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
|
||||||
|
id: gpg
|
||||||
|
|
||||||
|
- name: Get release version string
|
||||||
|
working-directory: meshtasticd
|
||||||
|
run: |
|
||||||
|
echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT
|
||||||
|
id: version
|
||||||
|
|
||||||
|
- name: Download artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: firmware-debian-${{ steps.version.outputs.deb }}~${{ inputs.series }}-src
|
||||||
|
merge-multiple: true
|
||||||
|
|
||||||
|
- name: Display structure of downloaded files
|
||||||
|
run: ls -lah
|
||||||
|
|
||||||
|
- name: Publish with dput
|
||||||
|
if: ${{ github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }}
|
||||||
|
run: |
|
||||||
|
dput ppa:meshtastic/meshtastic-daily meshtasticd_${{ steps.version.outputs.deb }}~${{ inputs.series }}_source.changes
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,4 +1,6 @@
|
|||||||
.pio
|
.pio
|
||||||
|
.pio_core
|
||||||
|
pio
|
||||||
|
|
||||||
# ignore vscode IDE settings files
|
# ignore vscode IDE settings files
|
||||||
.vscode/*
|
.vscode/*
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import configparser
|
import configparser
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import os
|
||||||
|
run_number = os.getenv('GITHUB_RUN_NUMBER', '0')
|
||||||
|
|
||||||
def readProps(prefsLoc):
|
def readProps(prefsLoc):
|
||||||
"""Read the version of our project as a string"""
|
"""Read the version of our project as a string"""
|
||||||
@ -10,6 +11,7 @@ def readProps(prefsLoc):
|
|||||||
version = dict(config.items("VERSION"))
|
version = dict(config.items("VERSION"))
|
||||||
verObj = dict(
|
verObj = dict(
|
||||||
short="{}.{}.{}".format(version["major"], version["minor"], version["build"]),
|
short="{}.{}.{}".format(version["major"], version["minor"], version["build"]),
|
||||||
|
deb="unset",
|
||||||
long="unset",
|
long="unset",
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -27,13 +29,13 @@ def readProps(prefsLoc):
|
|||||||
# if isDirty:
|
# if isDirty:
|
||||||
# # short for 'dirty', we want to keep our verstrings source for protobuf reasons
|
# # short for 'dirty', we want to keep our verstrings source for protobuf reasons
|
||||||
# suffix = sha + "-d"
|
# suffix = sha + "-d"
|
||||||
verObj["long"] = "{}.{}.{}.{}".format(
|
verObj["long"] = "{}.{}".format(verObj["short"], suffix)
|
||||||
version["major"], version["minor"], version["build"], suffix
|
verObj["deb"] = "{}-{}~ppa{}".format(verObj["short"], run_number, sha)
|
||||||
)
|
|
||||||
except:
|
except:
|
||||||
# print("Unexpected error:", sys.exc_info()[0])
|
# print("Unexpected error:", sys.exc_info()[0])
|
||||||
# traceback.print_exc()
|
# traceback.print_exc()
|
||||||
verObj["long"] = verObj["short"]
|
verObj["long"] = verObj["short"]
|
||||||
|
verObj["deb"] = "{}-{}~ppa".format(verObj["short"], run_number)
|
||||||
|
|
||||||
# print("firmware version " + verStr)
|
# print("firmware version " + verStr)
|
||||||
return verObj
|
return verObj
|
||||||
|
1
debian/update_changelog.sh → debian/ci_changelog.sh
vendored
Normal file → Executable file
1
debian/update_changelog.sh → debian/ci_changelog.sh
vendored
Normal file → Executable file
@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/bash
|
#!/usr/bin/bash
|
||||||
export DEBEMAIL="github-actions[bot]@users.noreply.github.com"
|
export DEBEMAIL="github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
dch --newversion "$(python3 bin/buildinfo.py short)-1" \
|
dch --newversion "$(python3 bin/buildinfo.py short)-1" \
|
||||||
--distribution unstable \
|
--distribution unstable \
|
||||||
"GitHub Actions Automatic version bump"
|
"GitHub Actions Automatic version bump"
|
20
debian/ci_pack_sdeb.sh
vendored
Executable file
20
debian/ci_pack_sdeb.sh
vendored
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
export DEBEMAIL="jbennett@incomsystems.biz"
|
||||||
|
export PLATFORMIO_LIBDEPS_DIR=pio/libdeps
|
||||||
|
export PLATFORMIO_PACKAGES_DIR=pio/packages
|
||||||
|
export PLATFORMIO_CORE_DIR=pio/core
|
||||||
|
|
||||||
|
# Download libraries to `libdeps`
|
||||||
|
platformio pkg install -e native
|
||||||
|
platformio pkg install -t tool-scons -e native
|
||||||
|
tar -cf pio.tar pio/
|
||||||
|
rm -rf pio
|
||||||
|
|
||||||
|
package=$(dpkg-parsechangelog --show-field Source)
|
||||||
|
|
||||||
|
rm -rf debian/changelog
|
||||||
|
dch --create --distribution $SERIES --package $package --newversion $PKG_VERSION~$SERIES \
|
||||||
|
"GitHub Actions Automatic packaging for $PKG_VERSION~$SERIES"
|
||||||
|
|
||||||
|
# Build the source deb
|
||||||
|
debuild -S -nc -k$GPG_KEY_ID
|
5
debian/control
vendored
5
debian/control
vendored
@ -3,8 +3,9 @@ Section: misc
|
|||||||
Priority: optional
|
Priority: optional
|
||||||
Maintainer: Austin Lane <vidplace7@gmail.com>
|
Maintainer: Austin Lane <vidplace7@gmail.com>
|
||||||
Build-Depends: debhelper-compat (= 13),
|
Build-Depends: debhelper-compat (= 13),
|
||||||
python3-pip,
|
platformio,
|
||||||
python3-venv,
|
python3-protobuf,
|
||||||
|
python3-grpcio,
|
||||||
git,
|
git,
|
||||||
g++,
|
g++,
|
||||||
pkg-config,
|
pkg-config,
|
||||||
|
17
debian/rules
vendored
17
debian/rules
vendored
@ -1,17 +1,20 @@
|
|||||||
#!/usr/bin/make -f
|
#!/usr/bin/make -f
|
||||||
|
# export DH_VERBOSE = 1
|
||||||
|
|
||||||
# Use the "dh" sequencer
|
# Use the "dh" sequencer
|
||||||
%:
|
%:
|
||||||
dh $@
|
dh $@
|
||||||
|
|
||||||
|
# https://docs.platformio.org/en/latest/envvars.html
|
||||||
|
PIO_ENV:=\
|
||||||
|
PLATFORMIO_CORE_DIR=pio/core \
|
||||||
|
PLATFORMIO_LIBDEPS_DIR=pio/libdeps \
|
||||||
|
PLATFORMIO_PACKAGES_DIR=pio/packages
|
||||||
|
|
||||||
override_dh_auto_build:
|
override_dh_auto_build:
|
||||||
# Terrible hack to use modern platformio to build the native version
|
# Build with platformio
|
||||||
python3 -m venv venv
|
tar -xf pio.tar
|
||||||
. venv/bin/activate
|
$(PIO_ENV) platformio run -e native
|
||||||
pip install platformio
|
|
||||||
platformio run -e native
|
|
||||||
deactivate
|
|
||||||
rm -rf venv
|
|
||||||
# Move the binary and default config to the correct name
|
# Move the binary and default config to the correct name
|
||||||
mv .pio/build/native/program .pio/build/native/meshtasticd
|
mv .pio/build/native/program .pio/build/native/meshtasticd
|
||||||
cp bin/config-dist.yaml bin/config.yaml
|
cp bin/config-dist.yaml bin/config.yaml
|
||||||
|
3
debian/source/include-binaries
vendored
Normal file
3
debian/source/include-binaries
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
pio/libdeps
|
||||||
|
pio/packages
|
||||||
|
pio/core
|
2
debian/source/options
vendored
Normal file
2
debian/source/options
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
extend-diff-ignore = "\.pio\w*?$"
|
||||||
|
tar-ignore = ""
|
@ -1 +1 @@
|
|||||||
Subproject commit c55f120a9c1ce90c85e4826907a0b9bcb2d5f5a2
|
Subproject commit 76f806e1bb1e2a7b157a14fadd095775f63db5e4
|
@ -63,6 +63,8 @@ PB_BIND(meshtastic_Config_SessionkeyConfig, meshtastic_Config_SessionkeyConfig,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -139,6 +139,14 @@ typedef enum _meshtastic_Config_NetworkConfig_AddressMode {
|
|||||||
meshtastic_Config_NetworkConfig_AddressMode_STATIC = 1
|
meshtastic_Config_NetworkConfig_AddressMode_STATIC = 1
|
||||||
} meshtastic_Config_NetworkConfig_AddressMode;
|
} meshtastic_Config_NetworkConfig_AddressMode;
|
||||||
|
|
||||||
|
/* Available flags auxiliary network protocols */
|
||||||
|
typedef enum _meshtastic_Config_NetworkConfig_ProtocolFlags {
|
||||||
|
/* Do not broadcast packets over any network protocol */
|
||||||
|
meshtastic_Config_NetworkConfig_ProtocolFlags_NO_BROADCAST = 0,
|
||||||
|
/* Enable broadcasting packets via UDP over the local network */
|
||||||
|
meshtastic_Config_NetworkConfig_ProtocolFlags_UDP_BROADCAST = 1
|
||||||
|
} meshtastic_Config_NetworkConfig_ProtocolFlags;
|
||||||
|
|
||||||
/* How the GPS coordinates are displayed on the OLED screen. */
|
/* How the GPS coordinates are displayed on the OLED screen. */
|
||||||
typedef enum _meshtastic_Config_DisplayConfig_GpsCoordinateFormat {
|
typedef enum _meshtastic_Config_DisplayConfig_GpsCoordinateFormat {
|
||||||
/* GPS coordinates are displayed in the normal decimal degrees format:
|
/* GPS coordinates are displayed in the normal decimal degrees format:
|
||||||
@ -429,6 +437,8 @@ typedef struct _meshtastic_Config_NetworkConfig {
|
|||||||
meshtastic_Config_NetworkConfig_IpV4Config ipv4_config;
|
meshtastic_Config_NetworkConfig_IpV4Config ipv4_config;
|
||||||
/* rsyslog Server and Port */
|
/* rsyslog Server and Port */
|
||||||
char rsyslog_server[33];
|
char rsyslog_server[33];
|
||||||
|
/* Flags for enabling/disabling network protocols */
|
||||||
|
uint32_t enabled_protocols;
|
||||||
} meshtastic_Config_NetworkConfig;
|
} meshtastic_Config_NetworkConfig;
|
||||||
|
|
||||||
/* Display Config */
|
/* Display Config */
|
||||||
@ -613,6 +623,10 @@ extern "C" {
|
|||||||
#define _meshtastic_Config_NetworkConfig_AddressMode_MAX meshtastic_Config_NetworkConfig_AddressMode_STATIC
|
#define _meshtastic_Config_NetworkConfig_AddressMode_MAX meshtastic_Config_NetworkConfig_AddressMode_STATIC
|
||||||
#define _meshtastic_Config_NetworkConfig_AddressMode_ARRAYSIZE ((meshtastic_Config_NetworkConfig_AddressMode)(meshtastic_Config_NetworkConfig_AddressMode_STATIC+1))
|
#define _meshtastic_Config_NetworkConfig_AddressMode_ARRAYSIZE ((meshtastic_Config_NetworkConfig_AddressMode)(meshtastic_Config_NetworkConfig_AddressMode_STATIC+1))
|
||||||
|
|
||||||
|
#define _meshtastic_Config_NetworkConfig_ProtocolFlags_MIN meshtastic_Config_NetworkConfig_ProtocolFlags_NO_BROADCAST
|
||||||
|
#define _meshtastic_Config_NetworkConfig_ProtocolFlags_MAX meshtastic_Config_NetworkConfig_ProtocolFlags_UDP_BROADCAST
|
||||||
|
#define _meshtastic_Config_NetworkConfig_ProtocolFlags_ARRAYSIZE ((meshtastic_Config_NetworkConfig_ProtocolFlags)(meshtastic_Config_NetworkConfig_ProtocolFlags_UDP_BROADCAST+1))
|
||||||
|
|
||||||
#define _meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MIN meshtastic_Config_DisplayConfig_GpsCoordinateFormat_DEC
|
#define _meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MIN meshtastic_Config_DisplayConfig_GpsCoordinateFormat_DEC
|
||||||
#define _meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MAX meshtastic_Config_DisplayConfig_GpsCoordinateFormat_OSGR
|
#define _meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MAX meshtastic_Config_DisplayConfig_GpsCoordinateFormat_OSGR
|
||||||
#define _meshtastic_Config_DisplayConfig_GpsCoordinateFormat_ARRAYSIZE ((meshtastic_Config_DisplayConfig_GpsCoordinateFormat)(meshtastic_Config_DisplayConfig_GpsCoordinateFormat_OSGR+1))
|
#define _meshtastic_Config_DisplayConfig_GpsCoordinateFormat_ARRAYSIZE ((meshtastic_Config_DisplayConfig_GpsCoordinateFormat)(meshtastic_Config_DisplayConfig_GpsCoordinateFormat_OSGR+1))
|
||||||
@ -674,7 +688,7 @@ extern "C" {
|
|||||||
#define meshtastic_Config_DeviceConfig_init_default {_meshtastic_Config_DeviceConfig_Role_MIN, 0, 0, 0, _meshtastic_Config_DeviceConfig_RebroadcastMode_MIN, 0, 0, 0, 0, "", 0}
|
#define meshtastic_Config_DeviceConfig_init_default {_meshtastic_Config_DeviceConfig_Role_MIN, 0, 0, 0, _meshtastic_Config_DeviceConfig_RebroadcastMode_MIN, 0, 0, 0, 0, "", 0}
|
||||||
#define meshtastic_Config_PositionConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _meshtastic_Config_PositionConfig_GpsMode_MIN}
|
#define meshtastic_Config_PositionConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _meshtastic_Config_PositionConfig_GpsMode_MIN}
|
||||||
#define meshtastic_Config_PowerConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0}
|
#define meshtastic_Config_PowerConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||||
#define meshtastic_Config_NetworkConfig_init_default {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_default, ""}
|
#define meshtastic_Config_NetworkConfig_init_default {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_default, "", 0}
|
||||||
#define meshtastic_Config_NetworkConfig_IpV4Config_init_default {0, 0, 0, 0}
|
#define meshtastic_Config_NetworkConfig_IpV4Config_init_default {0, 0, 0, 0}
|
||||||
#define meshtastic_Config_DisplayConfig_init_default {0, _meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MIN, 0, 0, 0, _meshtastic_Config_DisplayConfig_DisplayUnits_MIN, _meshtastic_Config_DisplayConfig_OledType_MIN, _meshtastic_Config_DisplayConfig_DisplayMode_MIN, 0, 0, _meshtastic_Config_DisplayConfig_CompassOrientation_MIN}
|
#define meshtastic_Config_DisplayConfig_init_default {0, _meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MIN, 0, 0, 0, _meshtastic_Config_DisplayConfig_DisplayUnits_MIN, _meshtastic_Config_DisplayConfig_OledType_MIN, _meshtastic_Config_DisplayConfig_DisplayMode_MIN, 0, 0, _meshtastic_Config_DisplayConfig_CompassOrientation_MIN}
|
||||||
#define meshtastic_Config_LoRaConfig_init_default {0, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _meshtastic_Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0}
|
#define meshtastic_Config_LoRaConfig_init_default {0, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _meshtastic_Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0}
|
||||||
@ -685,7 +699,7 @@ extern "C" {
|
|||||||
#define meshtastic_Config_DeviceConfig_init_zero {_meshtastic_Config_DeviceConfig_Role_MIN, 0, 0, 0, _meshtastic_Config_DeviceConfig_RebroadcastMode_MIN, 0, 0, 0, 0, "", 0}
|
#define meshtastic_Config_DeviceConfig_init_zero {_meshtastic_Config_DeviceConfig_Role_MIN, 0, 0, 0, _meshtastic_Config_DeviceConfig_RebroadcastMode_MIN, 0, 0, 0, 0, "", 0}
|
||||||
#define meshtastic_Config_PositionConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _meshtastic_Config_PositionConfig_GpsMode_MIN}
|
#define meshtastic_Config_PositionConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _meshtastic_Config_PositionConfig_GpsMode_MIN}
|
||||||
#define meshtastic_Config_PowerConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0}
|
#define meshtastic_Config_PowerConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||||
#define meshtastic_Config_NetworkConfig_init_zero {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_zero, ""}
|
#define meshtastic_Config_NetworkConfig_init_zero {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_zero, "", 0}
|
||||||
#define meshtastic_Config_NetworkConfig_IpV4Config_init_zero {0, 0, 0, 0}
|
#define meshtastic_Config_NetworkConfig_IpV4Config_init_zero {0, 0, 0, 0}
|
||||||
#define meshtastic_Config_DisplayConfig_init_zero {0, _meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MIN, 0, 0, 0, _meshtastic_Config_DisplayConfig_DisplayUnits_MIN, _meshtastic_Config_DisplayConfig_OledType_MIN, _meshtastic_Config_DisplayConfig_DisplayMode_MIN, 0, 0, _meshtastic_Config_DisplayConfig_CompassOrientation_MIN}
|
#define meshtastic_Config_DisplayConfig_init_zero {0, _meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MIN, 0, 0, 0, _meshtastic_Config_DisplayConfig_DisplayUnits_MIN, _meshtastic_Config_DisplayConfig_OledType_MIN, _meshtastic_Config_DisplayConfig_DisplayMode_MIN, 0, 0, _meshtastic_Config_DisplayConfig_CompassOrientation_MIN}
|
||||||
#define meshtastic_Config_LoRaConfig_init_zero {0, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _meshtastic_Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0}
|
#define meshtastic_Config_LoRaConfig_init_zero {0, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _meshtastic_Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0}
|
||||||
@ -739,6 +753,7 @@ extern "C" {
|
|||||||
#define meshtastic_Config_NetworkConfig_address_mode_tag 7
|
#define meshtastic_Config_NetworkConfig_address_mode_tag 7
|
||||||
#define meshtastic_Config_NetworkConfig_ipv4_config_tag 8
|
#define meshtastic_Config_NetworkConfig_ipv4_config_tag 8
|
||||||
#define meshtastic_Config_NetworkConfig_rsyslog_server_tag 9
|
#define meshtastic_Config_NetworkConfig_rsyslog_server_tag 9
|
||||||
|
#define meshtastic_Config_NetworkConfig_enabled_protocols_tag 10
|
||||||
#define meshtastic_Config_DisplayConfig_screen_on_secs_tag 1
|
#define meshtastic_Config_DisplayConfig_screen_on_secs_tag 1
|
||||||
#define meshtastic_Config_DisplayConfig_gps_format_tag 2
|
#define meshtastic_Config_DisplayConfig_gps_format_tag 2
|
||||||
#define meshtastic_Config_DisplayConfig_auto_screen_carousel_secs_tag 3
|
#define meshtastic_Config_DisplayConfig_auto_screen_carousel_secs_tag 3
|
||||||
@ -867,7 +882,8 @@ X(a, STATIC, SINGULAR, STRING, ntp_server, 5) \
|
|||||||
X(a, STATIC, SINGULAR, BOOL, eth_enabled, 6) \
|
X(a, STATIC, SINGULAR, BOOL, eth_enabled, 6) \
|
||||||
X(a, STATIC, SINGULAR, UENUM, address_mode, 7) \
|
X(a, STATIC, SINGULAR, UENUM, address_mode, 7) \
|
||||||
X(a, STATIC, OPTIONAL, MESSAGE, ipv4_config, 8) \
|
X(a, STATIC, OPTIONAL, MESSAGE, ipv4_config, 8) \
|
||||||
X(a, STATIC, SINGULAR, STRING, rsyslog_server, 9)
|
X(a, STATIC, SINGULAR, STRING, rsyslog_server, 9) \
|
||||||
|
X(a, STATIC, SINGULAR, UINT32, enabled_protocols, 10)
|
||||||
#define meshtastic_Config_NetworkConfig_CALLBACK NULL
|
#define meshtastic_Config_NetworkConfig_CALLBACK NULL
|
||||||
#define meshtastic_Config_NetworkConfig_DEFAULT NULL
|
#define meshtastic_Config_NetworkConfig_DEFAULT NULL
|
||||||
#define meshtastic_Config_NetworkConfig_ipv4_config_MSGTYPE meshtastic_Config_NetworkConfig_IpV4Config
|
#define meshtastic_Config_NetworkConfig_ipv4_config_MSGTYPE meshtastic_Config_NetworkConfig_IpV4Config
|
||||||
@ -972,12 +988,12 @@ extern const pb_msgdesc_t meshtastic_Config_SessionkeyConfig_msg;
|
|||||||
#define meshtastic_Config_DisplayConfig_size 30
|
#define meshtastic_Config_DisplayConfig_size 30
|
||||||
#define meshtastic_Config_LoRaConfig_size 85
|
#define meshtastic_Config_LoRaConfig_size 85
|
||||||
#define meshtastic_Config_NetworkConfig_IpV4Config_size 20
|
#define meshtastic_Config_NetworkConfig_IpV4Config_size 20
|
||||||
#define meshtastic_Config_NetworkConfig_size 196
|
#define meshtastic_Config_NetworkConfig_size 202
|
||||||
#define meshtastic_Config_PositionConfig_size 62
|
#define meshtastic_Config_PositionConfig_size 62
|
||||||
#define meshtastic_Config_PowerConfig_size 52
|
#define meshtastic_Config_PowerConfig_size 52
|
||||||
#define meshtastic_Config_SecurityConfig_size 178
|
#define meshtastic_Config_SecurityConfig_size 178
|
||||||
#define meshtastic_Config_SessionkeyConfig_size 0
|
#define meshtastic_Config_SessionkeyConfig_size 0
|
||||||
#define meshtastic_Config_size 199
|
#define meshtastic_Config_size 205
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
@ -51,6 +51,8 @@ typedef enum _meshtastic_Language {
|
|||||||
meshtastic_Language_GREEK = 13,
|
meshtastic_Language_GREEK = 13,
|
||||||
/* Norwegian */
|
/* Norwegian */
|
||||||
meshtastic_Language_NORWEGIAN = 14,
|
meshtastic_Language_NORWEGIAN = 14,
|
||||||
|
/* Slovenian */
|
||||||
|
meshtastic_Language_SLOVENIAN = 15,
|
||||||
/* Simplified Chinese (experimental) */
|
/* Simplified Chinese (experimental) */
|
||||||
meshtastic_Language_SIMPLIFIED_CHINESE = 30,
|
meshtastic_Language_SIMPLIFIED_CHINESE = 30,
|
||||||
/* Traditional Chinese (experimental) */
|
/* Traditional Chinese (experimental) */
|
||||||
@ -71,6 +73,8 @@ typedef struct _meshtastic_NodeFilter {
|
|||||||
bool position_switch;
|
bool position_switch;
|
||||||
/* Filter nodes by matching name string */
|
/* Filter nodes by matching name string */
|
||||||
char node_name[16];
|
char node_name[16];
|
||||||
|
/* Filter based on channel */
|
||||||
|
int8_t channel;
|
||||||
} meshtastic_NodeFilter;
|
} meshtastic_NodeFilter;
|
||||||
|
|
||||||
typedef struct _meshtastic_NodeHighlight {
|
typedef struct _meshtastic_NodeHighlight {
|
||||||
@ -138,10 +142,10 @@ extern "C" {
|
|||||||
|
|
||||||
/* Initializer values for message structs */
|
/* Initializer values for message structs */
|
||||||
#define meshtastic_DeviceUIConfig_init_default {0, 0, 0, 0, 0, 0, _meshtastic_Theme_MIN, 0, 0, 0, _meshtastic_Language_MIN, false, meshtastic_NodeFilter_init_default, false, meshtastic_NodeHighlight_init_default, {0, {0}}}
|
#define meshtastic_DeviceUIConfig_init_default {0, 0, 0, 0, 0, 0, _meshtastic_Theme_MIN, 0, 0, 0, _meshtastic_Language_MIN, false, meshtastic_NodeFilter_init_default, false, meshtastic_NodeHighlight_init_default, {0, {0}}}
|
||||||
#define meshtastic_NodeFilter_init_default {0, 0, 0, 0, 0, ""}
|
#define meshtastic_NodeFilter_init_default {0, 0, 0, 0, 0, "", 0}
|
||||||
#define meshtastic_NodeHighlight_init_default {0, 0, 0, 0, ""}
|
#define meshtastic_NodeHighlight_init_default {0, 0, 0, 0, ""}
|
||||||
#define meshtastic_DeviceUIConfig_init_zero {0, 0, 0, 0, 0, 0, _meshtastic_Theme_MIN, 0, 0, 0, _meshtastic_Language_MIN, false, meshtastic_NodeFilter_init_zero, false, meshtastic_NodeHighlight_init_zero, {0, {0}}}
|
#define meshtastic_DeviceUIConfig_init_zero {0, 0, 0, 0, 0, 0, _meshtastic_Theme_MIN, 0, 0, 0, _meshtastic_Language_MIN, false, meshtastic_NodeFilter_init_zero, false, meshtastic_NodeHighlight_init_zero, {0, {0}}}
|
||||||
#define meshtastic_NodeFilter_init_zero {0, 0, 0, 0, 0, ""}
|
#define meshtastic_NodeFilter_init_zero {0, 0, 0, 0, 0, "", 0}
|
||||||
#define meshtastic_NodeHighlight_init_zero {0, 0, 0, 0, ""}
|
#define meshtastic_NodeHighlight_init_zero {0, 0, 0, 0, ""}
|
||||||
|
|
||||||
/* Field tags (for use in manual encoding/decoding) */
|
/* Field tags (for use in manual encoding/decoding) */
|
||||||
@ -151,6 +155,7 @@ extern "C" {
|
|||||||
#define meshtastic_NodeFilter_hops_away_tag 4
|
#define meshtastic_NodeFilter_hops_away_tag 4
|
||||||
#define meshtastic_NodeFilter_position_switch_tag 5
|
#define meshtastic_NodeFilter_position_switch_tag 5
|
||||||
#define meshtastic_NodeFilter_node_name_tag 6
|
#define meshtastic_NodeFilter_node_name_tag 6
|
||||||
|
#define meshtastic_NodeFilter_channel_tag 7
|
||||||
#define meshtastic_NodeHighlight_chat_switch_tag 1
|
#define meshtastic_NodeHighlight_chat_switch_tag 1
|
||||||
#define meshtastic_NodeHighlight_position_switch_tag 2
|
#define meshtastic_NodeHighlight_position_switch_tag 2
|
||||||
#define meshtastic_NodeHighlight_telemetry_switch_tag 3
|
#define meshtastic_NodeHighlight_telemetry_switch_tag 3
|
||||||
@ -198,7 +203,8 @@ X(a, STATIC, SINGULAR, BOOL, offline_switch, 2) \
|
|||||||
X(a, STATIC, SINGULAR, BOOL, public_key_switch, 3) \
|
X(a, STATIC, SINGULAR, BOOL, public_key_switch, 3) \
|
||||||
X(a, STATIC, SINGULAR, INT32, hops_away, 4) \
|
X(a, STATIC, SINGULAR, INT32, hops_away, 4) \
|
||||||
X(a, STATIC, SINGULAR, BOOL, position_switch, 5) \
|
X(a, STATIC, SINGULAR, BOOL, position_switch, 5) \
|
||||||
X(a, STATIC, SINGULAR, STRING, node_name, 6)
|
X(a, STATIC, SINGULAR, STRING, node_name, 6) \
|
||||||
|
X(a, STATIC, SINGULAR, INT32, channel, 7)
|
||||||
#define meshtastic_NodeFilter_CALLBACK NULL
|
#define meshtastic_NodeFilter_CALLBACK NULL
|
||||||
#define meshtastic_NodeFilter_DEFAULT NULL
|
#define meshtastic_NodeFilter_DEFAULT NULL
|
||||||
|
|
||||||
@ -222,8 +228,8 @@ extern const pb_msgdesc_t meshtastic_NodeHighlight_msg;
|
|||||||
|
|
||||||
/* Maximum encoded size of messages (where known) */
|
/* Maximum encoded size of messages (where known) */
|
||||||
#define MESHTASTIC_MESHTASTIC_DEVICE_UI_PB_H_MAX_SIZE meshtastic_DeviceUIConfig_size
|
#define MESHTASTIC_MESHTASTIC_DEVICE_UI_PB_H_MAX_SIZE meshtastic_DeviceUIConfig_size
|
||||||
#define meshtastic_DeviceUIConfig_size 117
|
#define meshtastic_DeviceUIConfig_size 128
|
||||||
#define meshtastic_NodeFilter_size 36
|
#define meshtastic_NodeFilter_size 47
|
||||||
#define meshtastic_NodeHighlight_size 25
|
#define meshtastic_NodeHighlight_size 25
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -187,7 +187,7 @@ extern const pb_msgdesc_t meshtastic_LocalModuleConfig_msg;
|
|||||||
|
|
||||||
/* Maximum encoded size of messages (where known) */
|
/* Maximum encoded size of messages (where known) */
|
||||||
#define MESHTASTIC_MESHTASTIC_LOCALONLY_PB_H_MAX_SIZE meshtastic_LocalConfig_size
|
#define MESHTASTIC_MESHTASTIC_LOCALONLY_PB_H_MAX_SIZE meshtastic_LocalConfig_size
|
||||||
#define meshtastic_LocalConfig_size 735
|
#define meshtastic_LocalConfig_size 741
|
||||||
#define meshtastic_LocalModuleConfig_size 699
|
#define meshtastic_LocalModuleConfig_size 699
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -99,11 +99,11 @@ bool PowerTelemetryModule::wantUIFrame()
|
|||||||
void PowerTelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
void PowerTelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
||||||
{
|
{
|
||||||
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
||||||
display->setFont(FONT_MEDIUM);
|
display->setFont(FONT_SMALL);
|
||||||
display->drawString(x, y, "Power Telemetry");
|
display->drawString(x, y, "Power Telemetry");
|
||||||
if (lastMeasurementPacket == nullptr) {
|
if (lastMeasurementPacket == nullptr) {
|
||||||
display->setFont(FONT_SMALL);
|
display->setFont(FONT_SMALL);
|
||||||
display->drawString(x, y += _fontHeight(FONT_MEDIUM), "No measurement");
|
display->drawString(x, y += _fontHeight(FONT_SMALL), "No measurement");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,21 +122,21 @@ void PowerTelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *s
|
|||||||
|
|
||||||
// Display current and voltage based on ...power_metrics.has_[channel/voltage/current]... flags
|
// Display current and voltage based on ...power_metrics.has_[channel/voltage/current]... flags
|
||||||
display->setFont(FONT_SMALL);
|
display->setFont(FONT_SMALL);
|
||||||
display->drawString(x, y += _fontHeight(FONT_MEDIUM) - 2, "From: " + String(lastSender) + "(" + String(agoSecs) + "s)");
|
display->drawString(x, y += _fontHeight(FONT_SMALL) - 2, "From: " + String(lastSender) + "(" + String(agoSecs) + "s)");
|
||||||
if (lastMeasurement.variant.power_metrics.has_ch1_voltage || lastMeasurement.variant.power_metrics.has_ch1_current) {
|
if (lastMeasurement.variant.power_metrics.has_ch1_voltage || lastMeasurement.variant.power_metrics.has_ch1_current) {
|
||||||
display->drawString(x, y += _fontHeight(FONT_SMALL),
|
display->drawString(x, y += _fontHeight(FONT_SMALL),
|
||||||
"Ch1 Volt: " + String(lastMeasurement.variant.power_metrics.ch1_voltage, 2) +
|
"Ch1: " + String(lastMeasurement.variant.power_metrics.ch1_voltage, 2) +
|
||||||
"V / Curr: " + String(lastMeasurement.variant.power_metrics.ch1_current, 0) + "mA");
|
"V " + String(lastMeasurement.variant.power_metrics.ch1_current, 0) + "mA");
|
||||||
}
|
}
|
||||||
if (lastMeasurement.variant.power_metrics.has_ch2_voltage || lastMeasurement.variant.power_metrics.has_ch2_current) {
|
if (lastMeasurement.variant.power_metrics.has_ch2_voltage || lastMeasurement.variant.power_metrics.has_ch2_current) {
|
||||||
display->drawString(x, y += _fontHeight(FONT_SMALL),
|
display->drawString(x, y += _fontHeight(FONT_SMALL),
|
||||||
"Ch2 Volt: " + String(lastMeasurement.variant.power_metrics.ch2_voltage, 2) +
|
"Ch2: " + String(lastMeasurement.variant.power_metrics.ch2_voltage, 2) +
|
||||||
"V / Curr: " + String(lastMeasurement.variant.power_metrics.ch2_current, 0) + "mA");
|
"V " + String(lastMeasurement.variant.power_metrics.ch2_current, 0) + "mA");
|
||||||
}
|
}
|
||||||
if (lastMeasurement.variant.power_metrics.has_ch3_voltage || lastMeasurement.variant.power_metrics.has_ch3_current) {
|
if (lastMeasurement.variant.power_metrics.has_ch3_voltage || lastMeasurement.variant.power_metrics.has_ch3_current) {
|
||||||
display->drawString(x, y += _fontHeight(FONT_SMALL),
|
display->drawString(x, y += _fontHeight(FONT_SMALL),
|
||||||
"Ch3 Volt: " + String(lastMeasurement.variant.power_metrics.ch3_voltage, 2) +
|
"Ch3: " + String(lastMeasurement.variant.power_metrics.ch3_voltage, 2) +
|
||||||
"V / Curr: " + String(lastMeasurement.variant.power_metrics.ch3_current, 0) + "mA");
|
"V " + String(lastMeasurement.variant.power_metrics.ch3_current, 0) + "mA");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,24 +33,23 @@ const uint32_t g_ADigitalPinMap[] = {
|
|||||||
void initVariant()
|
void initVariant()
|
||||||
{
|
{
|
||||||
// LED1 & LED2
|
// LED1 & LED2
|
||||||
//pinMode(PIN_LED1, OUTPUT);
|
// pinMode(PIN_LED1, OUTPUT);
|
||||||
//ledOff(PIN_LED1);
|
// ledOff(PIN_LED1);
|
||||||
|
|
||||||
//pinMode(PIN_LED2, OUTPUT);
|
// pinMode(PIN_LED2, OUTPUT);
|
||||||
//ledOff(PIN_LED2);
|
// ledOff(PIN_LED2);
|
||||||
//pinMode(PIN_LED1, OUTPUT);
|
// pinMode(PIN_LED1, OUTPUT);
|
||||||
//digitalWrite(PIN_LED1, LOW);
|
// digitalWrite(PIN_LED1, LOW);
|
||||||
pinMode(24,OUTPUT);
|
pinMode(24, OUTPUT);
|
||||||
digitalWrite(24, HIGH);
|
digitalWrite(24, HIGH);
|
||||||
//pinMode(25,OUTPUT);
|
// pinMode(25,OUTPUT);
|
||||||
//digitalWrite(25, HIGH);
|
// digitalWrite(25, HIGH);
|
||||||
|
|
||||||
// 3V3 Power Rail
|
// 3V3 Power Rail
|
||||||
pinMode(PIN_3V3_EN, OUTPUT);
|
pinMode(PIN_3V3_EN, OUTPUT);
|
||||||
digitalWrite(PIN_3V3_EN, HIGH);
|
digitalWrite(PIN_3V3_EN, HIGH);
|
||||||
//pinMode(PIN_GPS_EN, OUTPUT);
|
// pinMode(PIN_GPS_EN, OUTPUT);
|
||||||
//digitalWrite(PIN_GPS_EN, HIGH);
|
// digitalWrite(PIN_GPS_EN, HIGH);
|
||||||
//pinMode(GPS_TX_PIN, OUTPUT);
|
// pinMode(GPS_TX_PIN, OUTPUT);
|
||||||
//pinMode(GPS_RX_PIN, INPUT_PULLUP);
|
// pinMode(GPS_RX_PIN, INPUT_PULLUP);
|
||||||
|
|
||||||
}
|
}
|
@ -24,8 +24,8 @@
|
|||||||
/** Master clock frequency */
|
/** Master clock frequency */
|
||||||
#define VARIANT_MCK (64000000ul)
|
#define VARIANT_MCK (64000000ul)
|
||||||
|
|
||||||
//#define USE_LFXO // Board uses 32khz crystal for LF
|
// #define USE_LFXO // Board uses 32khz crystal for LF
|
||||||
#define USE_LFRC // Board uses RC for LF
|
#define USE_LFRC // Board uses RC for LF
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Headers
|
* Headers
|
||||||
@ -43,28 +43,25 @@ extern "C" {
|
|||||||
#define NUM_ANALOG_INPUTS (2)
|
#define NUM_ANALOG_INPUTS (2)
|
||||||
#define NUM_ANALOG_OUTPUTS (0)
|
#define NUM_ANALOG_OUTPUTS (0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define BUTTON_PIN (38) // If defined, this will be used for user button presses,
|
#define BUTTON_PIN (38) // If defined, this will be used for user button presses,
|
||||||
#define BUTTON_NEED_PULLUP
|
#define BUTTON_NEED_PULLUP
|
||||||
|
|
||||||
|
|
||||||
// LEDs
|
// LEDs
|
||||||
#define PIN_LED1 (24) //24
|
#define PIN_LED1 (24) // 24
|
||||||
#define PIN_LED2 (-1) //Watchdog enable pin25
|
#define PIN_LED2 (-1) // Watchdog enable pin25
|
||||||
//#define PIN_LED3 (-1)
|
// #define PIN_LED3 (-1)
|
||||||
|
|
||||||
//#define LED_RED PIN_LED1
|
// #define LED_RED PIN_LED1
|
||||||
//#define LED_GREEN LED_PIN
|
// #define LED_GREEN LED_PIN
|
||||||
#define LED_BLUE PIN_LED1
|
#define LED_BLUE PIN_LED1
|
||||||
|
|
||||||
//#define LED_CONN PIN_LED1
|
// #define LED_CONN PIN_LED1
|
||||||
#define LED_BUILTIN PIN_LED1
|
#define LED_BUILTIN PIN_LED1
|
||||||
|
|
||||||
#define LED_STATE_ON 0 // State when LED is litted
|
#define LED_STATE_ON 0 // State when LED is litted
|
||||||
#define LED_INVERTED 1
|
#define LED_INVERTED 1
|
||||||
// Testing USB detection
|
// Testing USB detection
|
||||||
//#define NRF_APM
|
// #define NRF_APM
|
||||||
/*
|
/*
|
||||||
* Analog pins
|
* Analog pins
|
||||||
*/
|
*/
|
||||||
@ -83,10 +80,9 @@ static const uint8_t A7 = PIN_A7;
|
|||||||
#define ADC_RESOLUTION 14
|
#define ADC_RESOLUTION 14
|
||||||
|
|
||||||
// Other pins
|
// Other pins
|
||||||
//#define PIN_AREF (2)
|
// #define PIN_AREF (2)
|
||||||
|
|
||||||
|
// static const uint8_t AREF = PIN_AREF;
|
||||||
//static const uint8_t AREF = PIN_AREF;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Serial interfaces
|
* Serial interfaces
|
||||||
@ -94,9 +90,6 @@ static const uint8_t A7 = PIN_A7;
|
|||||||
#define PIN_SERIAL1_RX (40)
|
#define PIN_SERIAL1_RX (40)
|
||||||
#define PIN_SERIAL1_TX (7)
|
#define PIN_SERIAL1_TX (7)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SPI Interfaces
|
* SPI Interfaces
|
||||||
*/
|
*/
|
||||||
@ -118,17 +111,15 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
|||||||
/*
|
/*
|
||||||
* eink display pins
|
* eink display pins
|
||||||
*/
|
*/
|
||||||
//#define USE_EINK
|
// #define USE_EINK
|
||||||
|
|
||||||
#define PIN_EINK_CS (15)
|
#define PIN_EINK_CS (15)
|
||||||
#define PIN_EINK_BUSY (16)
|
#define PIN_EINK_BUSY (16)
|
||||||
#define PIN_EINK_DC (14)
|
#define PIN_EINK_DC (14)
|
||||||
#define PIN_EINK_RES (17) //17
|
#define PIN_EINK_RES (17) // 17
|
||||||
#define PIN_EINK_SCLK (19)
|
#define PIN_EINK_SCLK (19)
|
||||||
#define PIN_EINK_MOSI (21) // also called SDI
|
#define PIN_EINK_MOSI (21) // also called SDI
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Wire Interfaces
|
* Wire Interfaces
|
||||||
*/
|
*/
|
||||||
@ -164,7 +155,6 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define USE_SX1262
|
#define USE_SX1262
|
||||||
#define SX126X_CS (12)
|
#define SX126X_CS (12)
|
||||||
#define SX126X_DIO1 (32 + 1)
|
#define SX126X_DIO1 (32 + 1)
|
||||||
@ -175,8 +165,6 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
|||||||
#define SX126X_DIO2_AS_RF_SWITCH
|
#define SX126X_DIO2_AS_RF_SWITCH
|
||||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// enables 3.3V periphery like GPS or IO Module
|
// enables 3.3V periphery like GPS or IO Module
|
||||||
// Do not toggle this for GPS power savings
|
// Do not toggle this for GPS power savings
|
||||||
#define PIN_3V3_EN (25)
|
#define PIN_3V3_EN (25)
|
||||||
@ -188,19 +176,17 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
|||||||
// Therefore must be 1 to keep peripherals powered
|
// Therefore must be 1 to keep peripherals powered
|
||||||
// Power is on the controllable 3V3_S rail
|
// Power is on the controllable 3V3_S rail
|
||||||
// #define PIN_GPS_RESET (34)
|
// #define PIN_GPS_RESET (34)
|
||||||
//#define HAS_GPS 1
|
// #define HAS_GPS 1
|
||||||
//#define GNSS_ATGM336H
|
// #define GNSS_ATGM336H
|
||||||
//#define GPS_BAUDRATE 9600
|
// #define GPS_BAUDRATE 9600
|
||||||
//#undef GPS_RX_PIN
|
// #undef GPS_RX_PIN
|
||||||
//#undef GPS_TX_PIN
|
// #undef GPS_TX_PIN
|
||||||
//#define PIN_GPS_PPS 36 // Pulse per second input from the GPS
|
// #define PIN_GPS_PPS 36 // Pulse per second input from the GPS
|
||||||
|
|
||||||
#define GPS_TX_PIN PIN_SERIAL1_RX // This is for bits going TOWARDS the CPU
|
#define GPS_TX_PIN PIN_SERIAL1_RX // This is for bits going TOWARDS the CPU
|
||||||
#define GPS_RX_PIN PIN_SERIAL1_TX // This is for bits going TOWARDS the GPS
|
#define GPS_RX_PIN PIN_SERIAL1_TX // This is for bits going TOWARDS the GPS
|
||||||
|
|
||||||
//#define GPS_THREAD_INTERVAL 50
|
// #define GPS_THREAD_INTERVAL 50
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Define pin to enable GPS toggle (set GPIO to LOW) via user button triple press
|
// Define pin to enable GPS toggle (set GPIO to LOW) via user button triple press
|
||||||
#define PIN_GPS_EN (0)
|
#define PIN_GPS_EN (0)
|
||||||
@ -219,10 +205,6 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
|||||||
#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
|
#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
|
||||||
#define ADC_MULTIPLIER 1.42
|
#define ADC_MULTIPLIER 1.42
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -33,24 +33,23 @@ const uint32_t g_ADigitalPinMap[] = {
|
|||||||
void initVariant()
|
void initVariant()
|
||||||
{
|
{
|
||||||
// LED1 & LED2
|
// LED1 & LED2
|
||||||
//pinMode(PIN_LED1, OUTPUT);
|
// pinMode(PIN_LED1, OUTPUT);
|
||||||
//ledOff(PIN_LED1);
|
// ledOff(PIN_LED1);
|
||||||
|
|
||||||
//pinMode(PIN_LED2, OUTPUT);
|
// pinMode(PIN_LED2, OUTPUT);
|
||||||
//ledOff(PIN_LED2);
|
// ledOff(PIN_LED2);
|
||||||
//pinMode(PIN_LED1, OUTPUT);
|
// pinMode(PIN_LED1, OUTPUT);
|
||||||
//digitalWrite(PIN_LED1, LOW);
|
// digitalWrite(PIN_LED1, LOW);
|
||||||
pinMode(24,OUTPUT);
|
pinMode(24, OUTPUT);
|
||||||
digitalWrite(24, HIGH);
|
digitalWrite(24, HIGH);
|
||||||
//pinMode(25,OUTPUT);
|
// pinMode(25,OUTPUT);
|
||||||
//digitalWrite(25, HIGH);
|
// digitalWrite(25, HIGH);
|
||||||
|
|
||||||
// 3V3 Power Rail
|
// 3V3 Power Rail
|
||||||
pinMode(PIN_3V3_EN, OUTPUT);
|
pinMode(PIN_3V3_EN, OUTPUT);
|
||||||
digitalWrite(PIN_3V3_EN, HIGH);
|
digitalWrite(PIN_3V3_EN, HIGH);
|
||||||
//pinMode(PIN_GPS_EN, OUTPUT);
|
// pinMode(PIN_GPS_EN, OUTPUT);
|
||||||
//digitalWrite(PIN_GPS_EN, HIGH);
|
// digitalWrite(PIN_GPS_EN, HIGH);
|
||||||
//pinMode(GPS_TX_PIN, OUTPUT);
|
// pinMode(GPS_TX_PIN, OUTPUT);
|
||||||
//pinMode(GPS_RX_PIN, INPUT_PULLUP);
|
// pinMode(GPS_RX_PIN, INPUT_PULLUP);
|
||||||
|
|
||||||
}
|
}
|
@ -24,8 +24,8 @@
|
|||||||
/** Master clock frequency */
|
/** Master clock frequency */
|
||||||
#define VARIANT_MCK (64000000ul)
|
#define VARIANT_MCK (64000000ul)
|
||||||
|
|
||||||
//#define USE_LFXO // Board uses 32khz crystal for LF
|
// #define USE_LFXO // Board uses 32khz crystal for LF
|
||||||
#define USE_LFRC // Board uses RC for LF
|
#define USE_LFRC // Board uses RC for LF
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Headers
|
* Headers
|
||||||
@ -43,28 +43,25 @@ extern "C" {
|
|||||||
#define NUM_ANALOG_INPUTS (2)
|
#define NUM_ANALOG_INPUTS (2)
|
||||||
#define NUM_ANALOG_OUTPUTS (0)
|
#define NUM_ANALOG_OUTPUTS (0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define BUTTON_PIN (38) // If defined, this will be used for user button presses,
|
#define BUTTON_PIN (38) // If defined, this will be used for user button presses,
|
||||||
#define BUTTON_NEED_PULLUP
|
#define BUTTON_NEED_PULLUP
|
||||||
|
|
||||||
|
|
||||||
// LEDs
|
// LEDs
|
||||||
#define PIN_LED1 (24) //24
|
#define PIN_LED1 (24) // 24
|
||||||
#define PIN_LED2 (-1) //Watchdog enable pin25
|
#define PIN_LED2 (-1) // Watchdog enable pin25
|
||||||
//#define PIN_LED3 (-1)
|
// #define PIN_LED3 (-1)
|
||||||
|
|
||||||
//#define LED_RED PIN_LED1
|
// #define LED_RED PIN_LED1
|
||||||
//#define LED_GREEN LED_PIN
|
// #define LED_GREEN LED_PIN
|
||||||
#define LED_BLUE PIN_LED1
|
#define LED_BLUE PIN_LED1
|
||||||
|
|
||||||
//#define LED_CONN PIN_LED1
|
// #define LED_CONN PIN_LED1
|
||||||
#define LED_BUILTIN PIN_LED1
|
#define LED_BUILTIN PIN_LED1
|
||||||
|
|
||||||
#define LED_STATE_ON 0 // State when LED is litted
|
#define LED_STATE_ON 0 // State when LED is litted
|
||||||
#define LED_INVERTED 1
|
#define LED_INVERTED 1
|
||||||
// Testing USB detection
|
// Testing USB detection
|
||||||
//#define NRF_APM
|
// #define NRF_APM
|
||||||
/*
|
/*
|
||||||
* Analog pins
|
* Analog pins
|
||||||
*/
|
*/
|
||||||
@ -83,10 +80,9 @@ static const uint8_t A7 = PIN_A7;
|
|||||||
#define ADC_RESOLUTION 14
|
#define ADC_RESOLUTION 14
|
||||||
|
|
||||||
// Other pins
|
// Other pins
|
||||||
//#define PIN_AREF (2)
|
// #define PIN_AREF (2)
|
||||||
|
|
||||||
|
// static const uint8_t AREF = PIN_AREF;
|
||||||
//static const uint8_t AREF = PIN_AREF;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Serial interfaces
|
* Serial interfaces
|
||||||
@ -94,9 +90,6 @@ static const uint8_t A7 = PIN_A7;
|
|||||||
#define PIN_SERIAL1_RX (40)
|
#define PIN_SERIAL1_RX (40)
|
||||||
#define PIN_SERIAL1_TX (7)
|
#define PIN_SERIAL1_TX (7)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SPI Interfaces
|
* SPI Interfaces
|
||||||
*/
|
*/
|
||||||
@ -123,12 +116,10 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
|||||||
#define PIN_EINK_CS (15)
|
#define PIN_EINK_CS (15)
|
||||||
#define PIN_EINK_BUSY (16)
|
#define PIN_EINK_BUSY (16)
|
||||||
#define PIN_EINK_DC (14)
|
#define PIN_EINK_DC (14)
|
||||||
#define PIN_EINK_RES (17) //17
|
#define PIN_EINK_RES (17) // 17
|
||||||
#define PIN_EINK_SCLK (19)
|
#define PIN_EINK_SCLK (19)
|
||||||
#define PIN_EINK_MOSI (21) // also called SDI
|
#define PIN_EINK_MOSI (21) // also called SDI
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Wire Interfaces
|
* Wire Interfaces
|
||||||
*/
|
*/
|
||||||
@ -164,7 +155,6 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define USE_SX1262
|
#define USE_SX1262
|
||||||
#define SX126X_CS (12)
|
#define SX126X_CS (12)
|
||||||
#define SX126X_DIO1 (32 + 1)
|
#define SX126X_DIO1 (32 + 1)
|
||||||
@ -175,8 +165,6 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
|||||||
#define SX126X_DIO2_AS_RF_SWITCH
|
#define SX126X_DIO2_AS_RF_SWITCH
|
||||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// enables 3.3V periphery like GPS or IO Module
|
// enables 3.3V periphery like GPS or IO Module
|
||||||
// Do not toggle this for GPS power savings
|
// Do not toggle this for GPS power savings
|
||||||
#define PIN_3V3_EN (25)
|
#define PIN_3V3_EN (25)
|
||||||
@ -188,19 +176,17 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
|||||||
// Therefore must be 1 to keep peripherals powered
|
// Therefore must be 1 to keep peripherals powered
|
||||||
// Power is on the controllable 3V3_S rail
|
// Power is on the controllable 3V3_S rail
|
||||||
// #define PIN_GPS_RESET (34)
|
// #define PIN_GPS_RESET (34)
|
||||||
//#define HAS_GPS 1
|
// #define HAS_GPS 1
|
||||||
//#define GNSS_ATGM336H
|
// #define GNSS_ATGM336H
|
||||||
//#define GPS_BAUDRATE 9600
|
// #define GPS_BAUDRATE 9600
|
||||||
//#undef GPS_RX_PIN
|
// #undef GPS_RX_PIN
|
||||||
//#undef GPS_TX_PIN
|
// #undef GPS_TX_PIN
|
||||||
//#define PIN_GPS_PPS 36 // Pulse per second input from the GPS
|
// #define PIN_GPS_PPS 36 // Pulse per second input from the GPS
|
||||||
|
|
||||||
#define GPS_TX_PIN PIN_SERIAL1_RX // This is for bits going TOWARDS the CPU
|
#define GPS_TX_PIN PIN_SERIAL1_RX // This is for bits going TOWARDS the CPU
|
||||||
#define GPS_RX_PIN PIN_SERIAL1_TX // This is for bits going TOWARDS the GPS
|
#define GPS_RX_PIN PIN_SERIAL1_TX // This is for bits going TOWARDS the GPS
|
||||||
|
|
||||||
//#define GPS_THREAD_INTERVAL 50
|
// #define GPS_THREAD_INTERVAL 50
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Define pin to enable GPS toggle (set GPIO to LOW) via user button triple press
|
// Define pin to enable GPS toggle (set GPIO to LOW) via user button triple press
|
||||||
#define PIN_GPS_EN (0)
|
#define PIN_GPS_EN (0)
|
||||||
@ -219,10 +205,6 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
|||||||
#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
|
#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
|
||||||
#define ADC_MULTIPLIER 1.42
|
#define ADC_MULTIPLIER 1.42
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user