mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-26 11:47:51 +00:00
Compare commits
29 Commits
v1.2.36
...
v1.2.41.32
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32f3682fae | ||
|
|
fc9fc1ee6f | ||
|
|
659286f738 | ||
|
|
17a1262382 | ||
|
|
66b96d2052 | ||
|
|
06892c412c | ||
|
|
5c4d1a88a8 | ||
|
|
27dced6a35 | ||
|
|
3c4f3316c0 | ||
|
|
2f607d5a8c | ||
|
|
42f3154079 | ||
|
|
e7e09cb7ed | ||
|
|
c6092ea520 | ||
|
|
29ff778e22 | ||
|
|
d80814a12e | ||
|
|
cfeb0b47e9 | ||
|
|
6f14d017d8 | ||
|
|
cf4e508fb3 | ||
|
|
96fc1f5272 | ||
|
|
5b65fd5754 | ||
|
|
29587d4c4e | ||
|
|
a98bf80c24 | ||
|
|
49869ca044 | ||
|
|
5699abc8ad | ||
|
|
6b56583023 | ||
|
|
abe95ae1a4 | ||
|
|
4e8e85c9f1 | ||
|
|
26bb4ffe79 | ||
|
|
c857e5707e |
9
.github/workflows/main.yml
vendored
9
.github/workflows/main.yml
vendored
@@ -78,9 +78,16 @@ jobs:
|
|||||||
- name: Build everything
|
- name: Build everything
|
||||||
run: bin/build-all.sh
|
run: bin/build-all.sh
|
||||||
|
|
||||||
- name: Store release zip as an artifact
|
- name: Store binaries as an artifact
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: built
|
name: built
|
||||||
path: release/archive/firmware-*.zip
|
path: release/archive/firmware-*.zip
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
|
- name: Store debugging elf files as an artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: debug-elfs
|
||||||
|
path: release/archive/elfs-*.zip
|
||||||
|
retention-days: 7
|
||||||
|
|||||||
16
.github/workflows/release.yml
vendored
16
.github/workflows/release.yml
vendored
@@ -49,7 +49,7 @@ jobs:
|
|||||||
|
|
||||||
# Will be available in steps.version.outputs.version
|
# Will be available in steps.version.outputs.version
|
||||||
- name: Get version string
|
- name: Get version string
|
||||||
run: echo "::set-output name=version::$(./bin/buildinfo.py)"
|
run: echo "::set-output name=version::$(./bin/buildinfo.py long)"
|
||||||
id: version
|
id: version
|
||||||
|
|
||||||
- name: Build everything
|
- name: Build everything
|
||||||
@@ -69,7 +69,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
|
||||||
- name: Add artifact to release
|
- name: Add bins to release
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
@@ -77,4 +77,14 @@ jobs:
|
|||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
asset_path: release/archive/firmware-${{ steps.version.outputs.version }}.zip
|
asset_path: release/archive/firmware-${{ steps.version.outputs.version }}.zip
|
||||||
asset_name: firmware-${{ steps.version.outputs.version }}.zip
|
asset_name: firmware-${{ steps.version.outputs.version }}.zip
|
||||||
asset_content_type: application/zip
|
asset_content_type: application/zip
|
||||||
|
|
||||||
|
- name: Add debug elfs to release
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: release/archive/elfs-${{ steps.version.outputs.version }}.zip
|
||||||
|
asset_name: debug-elfs-${{ steps.version.outputs.version }}.zip
|
||||||
|
asset_content_type: application/zip
|
||||||
@@ -187,7 +187,7 @@ Hard resetting via RTS pin...
|
|||||||
|
|
||||||
# Meshtastic Android app
|
# Meshtastic Android app
|
||||||
|
|
||||||
The companion (optional) Meshtastic Android app is [here](https://play.google.com/store/apps/details?id=com.geeksville.mesh&referrer=utm_source%3Dgithub-dev-readme). You can also download it on Google Play.
|
The companion (optional, free, open-source) Meshtastic Android app is available on various appstores [see this page for details](https://github.com/meshtastic/Meshtastic-Android/blob/master/README.md).
|
||||||
|
|
||||||
# Python API
|
# Python API
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ BOARDS_ESP32="tlora-v2 tlora-v1 tlora_v1_3 tlora-v2-1-1.6 tbeam heltec-v2.0 helt
|
|||||||
|
|
||||||
# FIXME note nrf52840dk build is for some reason only generating a BIN file but not a HEX file nrf52840dk-geeksville is fine
|
# FIXME note nrf52840dk build is for some reason only generating a BIN file but not a HEX file nrf52840dk-geeksville is fine
|
||||||
BOARDS_NRF52="rak4631 t-echo"
|
BOARDS_NRF52="rak4631 t-echo"
|
||||||
|
#BOARDS_NRF52=""
|
||||||
|
|
||||||
OUTDIR=release/latest
|
OUTDIR=release/latest
|
||||||
|
|
||||||
@@ -98,6 +99,9 @@ XML
|
|||||||
|
|
||||||
echo Generating $ARCHIVEDIR/firmware-$VERSION.zip
|
echo Generating $ARCHIVEDIR/firmware-$VERSION.zip
|
||||||
rm -f $ARCHIVEDIR/firmware-$VERSION.zip
|
rm -f $ARCHIVEDIR/firmware-$VERSION.zip
|
||||||
zip --junk-paths $ARCHIVEDIR/firmware-$VERSION.zip $ARCHIVEDIR/spiffs-$VERSION.bin $OUTDIR/bins/universal/firmware-*-$VERSION.* images/system-info.bin bin/device-install.sh bin/device-update.sh
|
zip --junk-paths $ARCHIVEDIR/firmware-$VERSION.zip $ARCHIVEDIR/spiffs-$VERSION.bin $OUTDIR/bins/universal/firmware-*-$VERSION.* images/system-info.bin bin/device-install.* bin/device-update.*
|
||||||
|
echo Generating $ARCHIVEDIR/elfs-$VERSION.zip
|
||||||
|
rm -f $ARCHIVEDIR/elfs-$VERSION.zip
|
||||||
|
zip --junk-paths $ARCHIVEDIR/elfs-$VERSION.zip $OUTDIR/elfs/universal/firmware-*-$VERSION.*
|
||||||
|
|
||||||
echo BUILT ALL
|
echo BUILT ALL
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ set -e
|
|||||||
|
|
||||||
echo "This script is only for developers who are publishing new builds on github. Most users don't need it"
|
echo "This script is only for developers who are publishing new builds on github. Most users don't need it"
|
||||||
|
|
||||||
VERSION=`bin/buildinfo.py short`
|
VERSION=`bin/buildinfo.py long`
|
||||||
|
|
||||||
# Must have a V prefix to trigger github
|
# Must have a V prefix to trigger github
|
||||||
git tag "v${VERSION}"
|
git tag "v${VERSION}"
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo "Converting to uf2 for NRF52 Adafruit bootloader"
|
echo "building for t-echo"
|
||||||
|
pio run --environment t-echo
|
||||||
|
|
||||||
|
echo "Converting to uf2 for NRF52 Adafruit bootloader - double tap on the reset button to force bootloader entry"
|
||||||
bin/uf2conv.py .pio/build/t-echo/firmware.hex -f 0xADA52840
|
bin/uf2conv.py .pio/build/t-echo/firmware.hex -f 0xADA52840
|
||||||
cp flash.uf2 /media/kevinh/FTH*BOOT/
|
cp flash.uf2 /media/kevinh/FTH*BOOT/
|
||||||
|
|||||||
@@ -2,22 +2,19 @@
|
|||||||
|
|
||||||
You probably don't care about this section - skip to the next one.
|
You probably don't care about this section - skip to the next one.
|
||||||
|
|
||||||
* DONE investigate TCP on ESP32 https://github.com/meshtastic/Meshtastic-device/issues/807
|
* list portduino on platformio
|
||||||
* DONE fix python tool problem with windows and the heartbeat
|
|
||||||
* router mode dropping messages? https://meshtastic.discourse.group/t/router-mode-missing-messages/3329/3
|
* router mode dropping messages? https://meshtastic.discourse.group/t/router-mode-missing-messages/3329/3
|
||||||
* fix ttgo eink screen
|
* fix ttgo eink screen
|
||||||
* list portduino on platformio
|
|
||||||
* DONE make native sim not touch hardware
|
|
||||||
* DONE reenable sim in CI builds
|
|
||||||
* figure our wss for mqtt.meshtastic - use cloudflare? 2052 ws, 2053 crypt
|
* figure our wss for mqtt.meshtastic - use cloudflare? 2052 ws, 2053 crypt
|
||||||
|
* measure rak4630 power draw and turn off power for GPS most of the time. We should be able to run on the small solar panel.
|
||||||
* pine64 lora module
|
* pine64 lora module
|
||||||
* @havealoha fixedposition not working
|
* @havealoha fixedposition not working
|
||||||
* ask for vercel access
|
* ask for vercel access
|
||||||
* finish plan for riot.im
|
* finish plan for riot.im
|
||||||
* turn on setTx(timeout) and state = setDioIrqParams(SX126X_IRQ_TX_DONE | SX126X_IRQ_TIMEOUT, SX126X_IRQ_TX_DONE | SX126X_IRQ_TIMEOUT); in sx1262 code
|
* turn on setTx(timeout) and state = setDioIrqParams(SX126X_IRQ_TX_DONE | SX126X_IRQ_TIMEOUT, SX126X_IRQ_TX_DONE | SX126X_IRQ_TIMEOUT); in sx1262 code
|
||||||
* DONE fix this sleep problem: https://meshtastic.discourse.group/t/new-device-release-1-2-30-ready-for-alpha-testing/3272/13?u=geeksville
|
|
||||||
* add rak4600 support (with rf95 radio and limited ram)
|
* add rak4600 support (with rf95 radio and limited ram)
|
||||||
|
* store esp32 crashes to flash (and 64KB coredump partition) - https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/core_dump.html
|
||||||
|
*
|
||||||
* Switch to use https://github.com/adafruit/Adafruit_nRF52_Arduino.git when available (see arduino code for examples)
|
* Switch to use https://github.com/adafruit/Adafruit_nRF52_Arduino.git when available (see arduino code for examples)
|
||||||
* DONE @luxonn reports that after a while the android app stops showing new messages
|
* DONE @luxonn reports that after a while the android app stops showing new messages
|
||||||
* DONE release android APK - fix recent 1.2.28 crash report
|
* DONE release android APK - fix recent 1.2.28 crash report
|
||||||
|
|||||||
7
geeksville-private/windows-build-instructions.md
Normal file
7
geeksville-private/windows-build-instructions.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
* install python
|
||||||
|
* install git (including git-bash)
|
||||||
|
* install platformio
|
||||||
|
* install vscode
|
||||||
|
* install https://sourceforge.net/projects/mingw-w64/ (for windows gcc/g++) - you'll need to add the bin directory to your PATH
|
||||||
@@ -355,14 +355,14 @@ lib_deps =
|
|||||||
extends = nrf52840_base
|
extends = nrf52840_base
|
||||||
board = t-echo
|
board = t-echo
|
||||||
# add our variants files to the include and src paths
|
# add our variants files to the include and src paths
|
||||||
# define build flags for the TFT_eSPI library
|
# define build flags for the TFT_eSPI library - NOTE: WE NOT LONGER USE TFT_eSPI, it was for an earlier version of the TTGO eink screens
|
||||||
build_flags = ${nrf52_base.build_flags} -Ivariants/t-echo
|
# -DBUSY_PIN=3 -DRST_PIN=2 -DDC_PIN=28 -DCS_PIN=30
|
||||||
-DBUSY_PIN=3 -DRST_PIN=2 -DDC_PIN=28 -DCS_PIN=30
|
build_flags = ${nrf52_base.build_flags} -Ivariants/t-echo
|
||||||
src_filter = ${nrf52_base.src_filter} +<../variants/t-echo>
|
src_filter = ${nrf52_base.src_filter} +<../variants/t-echo>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${nrf52840_base.lib_deps}
|
${nrf52840_base.lib_deps}
|
||||||
https://github.com/geeksville/EPD_Libraries.git
|
https://github.com/geeksville/GxEPD2.git
|
||||||
TFT_eSPI
|
adafruit/Adafruit BusIO
|
||||||
;upload_protocol = fs
|
;upload_protocol = fs
|
||||||
|
|
||||||
; First prototype eink/nrf52840/sx1262 device (removed from build because didn't ship in quantity)
|
; First prototype eink/nrf52840/sx1262 device (removed from build because didn't ship in quantity)
|
||||||
|
|||||||
2
proto
2
proto
Submodule proto updated: dfcfba8d1a...f5b3d0643b
@@ -1,3 +1,4 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "BluetoothCommon.h"
|
#include "BluetoothCommon.h"
|
||||||
|
|
||||||
// NRF52 wants these constants as byte arrays
|
// NRF52 wants these constants as byte arrays
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "FSCommon.h"
|
#include "FSCommon.h"
|
||||||
|
|
||||||
void fsInit()
|
void fsInit()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "OSTimer.h"
|
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
#include "OSTimer.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Schedule a callback to run. The callback must _not_ block, though it is called from regular thread level (not ISR)
|
* Schedule a callback to run. The callback must _not_ block, though it is called from regular thread level (not ISR)
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "Observer.h"
|
#include "Observer.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "power.h"
|
#include "power.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "PowerFSM.h"
|
#include "PowerFSM.h"
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "PowerFSM.h"
|
#include "PowerFSM.h"
|
||||||
#include "GPS.h"
|
#include "GPS.h"
|
||||||
#include "MeshService.h"
|
#include "MeshService.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "configuration.h"
|
|
||||||
#include "graphics/Screen.h"
|
#include "graphics/Screen.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "sleep.h"
|
#include "sleep.h"
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "RedirectablePrint.h"
|
#include "RedirectablePrint.h"
|
||||||
#include "RTC.h"
|
#include "RTC.h"
|
||||||
#include "concurrency/OSThread.h"
|
#include "concurrency/OSThread.h"
|
||||||
#include "configuration.h"
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A printer that doesn't go anywhere
|
* A printer that doesn't go anywhere
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "SPILock.h"
|
#include "SPILock.h"
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "SerialConsole.h"
|
#include "SerialConsole.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "PowerFSM.h"
|
#include "PowerFSM.h"
|
||||||
#include "configuration.h"
|
|
||||||
#include <Arduino.h>
|
|
||||||
|
|
||||||
#define Port Serial
|
#define Port Serial
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "airtime.h"
|
#include "airtime.h"
|
||||||
#include <Arduino.h>
|
|
||||||
|
|
||||||
#define periodsToLog 48
|
#define periodsToLog 48
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "concurrency/BinarySemaphoreFreeRTOS.h"
|
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
#include "concurrency/BinarySemaphoreFreeRTOS.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#ifdef HAS_FREE_RTOS
|
#ifdef HAS_FREE_RTOS
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "concurrency/BinarySemaphorePosix.h"
|
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
#include "concurrency/BinarySemaphorePosix.h"
|
||||||
|
|
||||||
#ifndef HAS_FREE_RTOS
|
#ifndef HAS_FREE_RTOS
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "concurrency/InterruptableDelay.h"
|
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
#include "concurrency/InterruptableDelay.h"
|
||||||
|
|
||||||
namespace concurrency
|
namespace concurrency
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "Lock.h"
|
#include "Lock.h"
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "LockGuard.h"
|
#include "LockGuard.h"
|
||||||
|
|
||||||
namespace concurrency {
|
namespace concurrency {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "NotifiedWorkerThread.h"
|
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
#include "NotifiedWorkerThread.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "OSThread.h"
|
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
#include "OSThread.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
namespace concurrency
|
namespace concurrency
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "Air530GPS.h"
|
#include "Air530GPS.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "GPS.h"
|
#include "GPS.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "RTC.h"
|
#include "RTC.h"
|
||||||
#include "configuration.h"
|
|
||||||
#include "sleep.h"
|
#include "sleep.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "NMEAGPS.h"
|
#include "NMEAGPS.h"
|
||||||
#include "RTC.h"
|
#include "RTC.h"
|
||||||
#include "configuration.h"
|
|
||||||
|
|
||||||
static int32_t toDegInt(RawDegrees d)
|
static int32_t toDegInt(RawDegrees d)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "UBloxGPS.h"
|
#include "UBloxGPS.h"
|
||||||
#include "RTC.h"
|
#include "RTC.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
|||||||
@@ -1,152 +0,0 @@
|
|||||||
#include "configuration.h"
|
|
||||||
|
|
||||||
#ifdef HAS_EINK
|
|
||||||
#include "EInkDisplay.h"
|
|
||||||
#include "SPILock.h"
|
|
||||||
#include "epd1in54.h" // Screen specific library
|
|
||||||
#include <SPI.h>
|
|
||||||
#include <TFT_eSPI.h> // Graphics library and Sprite class
|
|
||||||
|
|
||||||
Epd ePaper; // Create an instance ePaper
|
|
||||||
|
|
||||||
TFT_eSPI glc = TFT_eSPI(); // Invoke the graphics library class
|
|
||||||
TFT_eSprite frame = TFT_eSprite(&glc); // Invoke the Sprite class for the image frame buffer
|
|
||||||
uint8_t *framePtr; // Pointer for the black frame buffer
|
|
||||||
|
|
||||||
#define COLORED 0
|
|
||||||
#define UNCOLORED 1
|
|
||||||
|
|
||||||
#define INK COLORED // Black ink
|
|
||||||
#define PAPER UNCOLORED // 'paper' background colour
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------
|
|
||||||
// Update display - different displays have different function names in the default
|
|
||||||
// Waveshare libraries :-(
|
|
||||||
//------------------------------------------------------------------------------------
|
|
||||||
#if defined(EPD1IN54B_H) || defined(EPD1IN54C_H) || defined(EPD2IN13B_H) || defined(EPD2IN7B_H) || defined(EPD2IN9B_H) || \
|
|
||||||
defined(EPD4IN2_H)
|
|
||||||
void updateDisplay(uint8_t *blackFrame = blackFramePtr, uint8_t *redFrame = redFramePtr)
|
|
||||||
{
|
|
||||||
ePaper.DisplayFrame(blackFrame, redFrame); // Update 3 colour display
|
|
||||||
#else
|
|
||||||
void updateDisplay(uint8_t *blackFrame = framePtr)
|
|
||||||
{
|
|
||||||
#if defined(EPD2IN7_H) || defined(EPD4IN2_H)
|
|
||||||
ePaper.DisplayFrame(blackFrame); // Update 2 color display
|
|
||||||
|
|
||||||
#elif defined(EPD1IN54_H) || defined(EPD2IN13_H) || defined(EPD2IN9_H)
|
|
||||||
ePaper.SetFrameMemory(blackFrame); // Update 2 colour display
|
|
||||||
ePaper.DisplayFrame();
|
|
||||||
#else
|
|
||||||
#error "Selected ePaper library is not supported"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
EInkDisplay::EInkDisplay(uint8_t address, int sda, int scl)
|
|
||||||
{
|
|
||||||
setGeometry(GEOMETRY_RAWMODE, EPD_WIDTH, EPD_HEIGHT);
|
|
||||||
// setGeometry(GEOMETRY_RAWMODE, 128, 64); // old resolution
|
|
||||||
// setGeometry(GEOMETRY_128_64); // We originally used this because I wasn't sure if rawmode worked - it does
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIXME quick hack to limit drawing to a very slow rate
|
|
||||||
uint32_t lastDrawMsec;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Force a display update if we haven't drawn within the specified msecLimit
|
|
||||||
*/
|
|
||||||
bool EInkDisplay::forceDisplay(uint32_t msecLimit)
|
|
||||||
{
|
|
||||||
// No need to grab this lock because we are on our own SPI bus
|
|
||||||
// concurrency::LockGuard g(spiLock);
|
|
||||||
|
|
||||||
uint32_t now = millis();
|
|
||||||
uint32_t sinceLast = now - lastDrawMsec;
|
|
||||||
|
|
||||||
if (framePtr && (sinceLast > msecLimit || lastDrawMsec == 0)) {
|
|
||||||
lastDrawMsec = now;
|
|
||||||
|
|
||||||
// FIXME - only draw bits have changed (use backbuf similar to the other displays)
|
|
||||||
// tft.drawBitmap(0, 0, buffer, 128, 64, TFT_YELLOW, TFT_BLACK);
|
|
||||||
for (uint8_t y = 0; y < displayHeight; y++) {
|
|
||||||
for (uint8_t x = 0; x < displayWidth; x++) {
|
|
||||||
|
|
||||||
// get src pixel in the page based ordering the OLED lib uses FIXME, super inefficent
|
|
||||||
auto b = buffer[x + (y / 8) * displayWidth];
|
|
||||||
auto isset = b & (1 << (y & 7));
|
|
||||||
frame.drawPixel(x, y, isset ? INK : PAPER);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ePaper.Reset(); // wake the screen from sleep
|
|
||||||
|
|
||||||
DEBUG_MSG("Updating eink... ");
|
|
||||||
updateDisplay(); // Send image to display and refresh
|
|
||||||
DEBUG_MSG("done\n");
|
|
||||||
|
|
||||||
// Put screen to sleep to save power
|
|
||||||
ePaper.Sleep();
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
// DEBUG_MSG("Skipping eink display\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write the buffer to the display memory
|
|
||||||
void EInkDisplay::display(void)
|
|
||||||
{
|
|
||||||
// We don't allow regular 'dumb' display() calls to draw on eink until we've shown
|
|
||||||
// at least one forceDisplay() keyframe. This prevents flashing when we should the critical
|
|
||||||
// bootscreen (that we want to look nice)
|
|
||||||
if (lastDrawMsec)
|
|
||||||
forceDisplay(slowUpdateMsec); // Show the first screen a few seconds after boot, then slower
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send a command to the display (low level function)
|
|
||||||
void EInkDisplay::sendCommand(uint8_t com)
|
|
||||||
{
|
|
||||||
(void)com;
|
|
||||||
// Drop all commands to device (we just update the buffer)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Connect to the display
|
|
||||||
bool EInkDisplay::connect()
|
|
||||||
{
|
|
||||||
DEBUG_MSG("Doing EInk init\n");
|
|
||||||
|
|
||||||
#ifdef PIN_EINK_PWR_ON
|
|
||||||
digitalWrite(PIN_EINK_PWR_ON, HIGH); // If we need to assert a pin to power external peripherals
|
|
||||||
pinMode(PIN_EINK_PWR_ON, OUTPUT);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PIN_EINK_EN
|
|
||||||
// backlight power, HIGH is backlight on, LOW is off
|
|
||||||
digitalWrite(PIN_EINK_EN, LOW);
|
|
||||||
pinMode(PIN_EINK_EN, OUTPUT);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Initialise the ePaper library
|
|
||||||
// FIXME - figure out how to use lut_partial_update
|
|
||||||
if (ePaper.Init(lut_full_update) != 0) {
|
|
||||||
DEBUG_MSG("ePaper init failed\n");
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
frame.setColorDepth(1); // Must set the bits per pixel to 1 for ePaper displays
|
|
||||||
// Set bit depth BEFORE creating Sprite, default is 16!
|
|
||||||
|
|
||||||
// Create a frame buffer in RAM of defined size and save the pointer to it
|
|
||||||
// RAM needed is about (EPD_WIDTH * EPD_HEIGHT)/8 , ~5000 bytes for 200 x 200 pixels
|
|
||||||
// Note: always create the Sprite before setting the Sprite rotation
|
|
||||||
framePtr = (uint8_t *)frame.createSprite(EPD_WIDTH, EPD_HEIGHT);
|
|
||||||
|
|
||||||
frame.fillSprite(PAPER); // Fill frame with white
|
|
||||||
/* frame.drawLine(0, 0, frame.width() - 1, frame.height() - 1, INK);
|
|
||||||
frame.drawLine(0, frame.height() - 1, frame.width() - 1, 0, INK);
|
|
||||||
updateDisplay(); */
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
116
src/graphics/EInkDisplay2.cpp
Normal file
116
src/graphics/EInkDisplay2.cpp
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
#include "configuration.h"
|
||||||
|
|
||||||
|
#ifdef HAS_EINK
|
||||||
|
#include "EInkDisplay2.h"
|
||||||
|
#include "SPILock.h"
|
||||||
|
#include <SPI.h>
|
||||||
|
#include "GxEPD2_BW.h"
|
||||||
|
|
||||||
|
#define COLORED GxEPD_BLACK
|
||||||
|
#define UNCOLORED GxEPD_WHITE
|
||||||
|
|
||||||
|
|
||||||
|
#define TECHO_DISPLAY_MODEL GxEPD2_154_D67
|
||||||
|
|
||||||
|
GxEPD2_BW<TECHO_DISPLAY_MODEL, TECHO_DISPLAY_MODEL::HEIGHT> *adafruitDisplay;
|
||||||
|
|
||||||
|
EInkDisplay::EInkDisplay(uint8_t address, int sda, int scl)
|
||||||
|
{
|
||||||
|
setGeometry(GEOMETRY_RAWMODE, TECHO_DISPLAY_MODEL::WIDTH, TECHO_DISPLAY_MODEL::HEIGHT);
|
||||||
|
// setGeometry(GEOMETRY_RAWMODE, 128, 64); // old resolution
|
||||||
|
// setGeometry(GEOMETRY_128_64); // We originally used this because I wasn't sure if rawmode worked - it does
|
||||||
|
}
|
||||||
|
|
||||||
|
// FIXME quick hack to limit drawing to a very slow rate
|
||||||
|
uint32_t lastDrawMsec;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Force a display update if we haven't drawn within the specified msecLimit
|
||||||
|
*/
|
||||||
|
bool EInkDisplay::forceDisplay(uint32_t msecLimit)
|
||||||
|
{
|
||||||
|
// No need to grab this lock because we are on our own SPI bus
|
||||||
|
// concurrency::LockGuard g(spiLock);
|
||||||
|
|
||||||
|
uint32_t now = millis();
|
||||||
|
uint32_t sinceLast = now - lastDrawMsec;
|
||||||
|
|
||||||
|
if (adafruitDisplay && (sinceLast > msecLimit || lastDrawMsec == 0)) {
|
||||||
|
lastDrawMsec = now;
|
||||||
|
|
||||||
|
// FIXME - only draw bits have changed (use backbuf similar to the other displays)
|
||||||
|
// tft.drawBitmap(0, 0, buffer, 128, 64, TFT_YELLOW, TFT_BLACK);
|
||||||
|
for (uint8_t y = 0; y < displayHeight; y++) {
|
||||||
|
for (uint8_t x = 0; x < displayWidth; x++) {
|
||||||
|
|
||||||
|
// get src pixel in the page based ordering the OLED lib uses FIXME, super inefficent
|
||||||
|
auto b = buffer[x + (y / 8) * displayWidth];
|
||||||
|
auto isset = b & (1 << (y & 7));
|
||||||
|
adafruitDisplay->drawPixel(x, y, isset ? COLORED : UNCOLORED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DEBUG_MSG("Updating eink... ");
|
||||||
|
// ePaper.Reset(); // wake the screen from sleep
|
||||||
|
adafruitDisplay->display(false); // FIXME, use partial update mode
|
||||||
|
// Put screen to sleep to save power (possibly not necessary because we already did poweroff inside of display)
|
||||||
|
adafruitDisplay->hibernate();
|
||||||
|
DEBUG_MSG("done\n");
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
// DEBUG_MSG("Skipping eink display\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write the buffer to the display memory
|
||||||
|
void EInkDisplay::display(void)
|
||||||
|
{
|
||||||
|
// We don't allow regular 'dumb' display() calls to draw on eink until we've shown
|
||||||
|
// at least one forceDisplay() keyframe. This prevents flashing when we should the critical
|
||||||
|
// bootscreen (that we want to look nice)
|
||||||
|
if (lastDrawMsec)
|
||||||
|
forceDisplay(slowUpdateMsec); // Show the first screen a few seconds after boot, then slower
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send a command to the display (low level function)
|
||||||
|
void EInkDisplay::sendCommand(uint8_t com)
|
||||||
|
{
|
||||||
|
(void)com;
|
||||||
|
// Drop all commands to device (we just update the buffer)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Connect to the display
|
||||||
|
bool EInkDisplay::connect()
|
||||||
|
{
|
||||||
|
DEBUG_MSG("Doing EInk init\n");
|
||||||
|
|
||||||
|
#ifdef PIN_EINK_PWR_ON
|
||||||
|
digitalWrite(PIN_EINK_PWR_ON, HIGH); // If we need to assert a pin to power external peripherals
|
||||||
|
pinMode(PIN_EINK_PWR_ON, OUTPUT);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PIN_EINK_EN
|
||||||
|
// backlight power, HIGH is backlight on, LOW is off
|
||||||
|
digitalWrite(PIN_EINK_EN, LOW);
|
||||||
|
pinMode(PIN_EINK_EN, OUTPUT);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
auto lowLevel = new TECHO_DISPLAY_MODEL(PIN_EINK_CS,
|
||||||
|
PIN_EINK_DC,
|
||||||
|
PIN_EINK_RES,
|
||||||
|
PIN_EINK_BUSY, SPI1);
|
||||||
|
|
||||||
|
adafruitDisplay = new GxEPD2_BW<TECHO_DISPLAY_MODEL, TECHO_DISPLAY_MODEL::HEIGHT>(*lowLevel);
|
||||||
|
adafruitDisplay->init();
|
||||||
|
adafruitDisplay->setRotation(1);
|
||||||
|
//adafruitDisplay->setFullWindow();
|
||||||
|
//adafruitDisplay->fillScreen(UNCOLORED);
|
||||||
|
//adafruitDisplay->drawCircle(100, 100, 20, COLORED);
|
||||||
|
//adafruitDisplay->display(false);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -19,14 +19,13 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
#include "configuration.h"
|
||||||
#include <OLEDDisplay.h>
|
#include <OLEDDisplay.h>
|
||||||
|
|
||||||
#include "GPS.h"
|
#include "GPS.h"
|
||||||
#include "MeshService.h"
|
#include "MeshService.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "Screen.h"
|
#include "Screen.h"
|
||||||
#include "configuration.h"
|
|
||||||
#include "fonts.h"
|
#include "fonts.h"
|
||||||
#include "gps/RTC.h"
|
#include "gps/RTC.h"
|
||||||
#include "graphics/images.h"
|
#include "graphics/images.h"
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class Screen
|
|||||||
#include <SSD1306Wire.h>
|
#include <SSD1306Wire.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "EInkDisplay.h"
|
#include "EInkDisplay2.h"
|
||||||
#include "TFTDisplay.h"
|
#include "TFTDisplay.h"
|
||||||
#include "TypedQueue.h"
|
#include "TypedQueue.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "GPS.h"
|
#include "GPS.h"
|
||||||
#include "MeshRadio.h"
|
#include "MeshRadio.h"
|
||||||
#include "MeshService.h"
|
#include "MeshService.h"
|
||||||
@@ -6,7 +6,6 @@
|
|||||||
#include "PowerFSM.h"
|
#include "PowerFSM.h"
|
||||||
#include "airtime.h"
|
#include "airtime.h"
|
||||||
#include "buzz.h"
|
#include "buzz.h"
|
||||||
#include "configuration.h"
|
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "power.h"
|
#include "power.h"
|
||||||
// #include "rom/rtc.h"
|
// #include "rom/rtc.h"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "Channels.h"
|
#include "Channels.h"
|
||||||
#include "CryptoEngine.h"
|
#include "CryptoEngine.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "CryptoEngine.h"
|
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
#include "CryptoEngine.h"
|
||||||
|
|
||||||
void CryptoEngine::setKey(const CryptoKey &k)
|
void CryptoEngine::setKey(const CryptoKey &k)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "DSRRouter.h"
|
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
#include "DSRRouter.h"
|
||||||
|
|
||||||
/* when we receive any packet
|
/* when we receive any packet
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "FloodingRouter.h"
|
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
#include "FloodingRouter.h"
|
||||||
#include "mesh-pb-constants.h"
|
#include "mesh-pb-constants.h"
|
||||||
|
|
||||||
FloodingRouter::FloodingRouter() {}
|
FloodingRouter::FloodingRouter() {}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "MeshPacketQueue.h"
|
#include "MeshPacketQueue.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "MeshPlugin.h"
|
#include "MeshPlugin.h"
|
||||||
#include "Channels.h"
|
#include "Channels.h"
|
||||||
#include "MeshService.h"
|
#include "MeshService.h"
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include <Arduino.h>
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include <Arduino.h>
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include "FS.h"
|
#include "FS.h"
|
||||||
@@ -14,7 +13,6 @@
|
|||||||
#include "PowerFSM.h"
|
#include "PowerFSM.h"
|
||||||
#include "RTC.h"
|
#include "RTC.h"
|
||||||
#include "Router.h"
|
#include "Router.h"
|
||||||
#include "configuration.h"
|
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "mesh-pb-constants.h"
|
#include "mesh-pb-constants.h"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "PacketHistory.h"
|
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
#include "PacketHistory.h"
|
||||||
#include "mesh-pb-constants.h"
|
#include "mesh-pb-constants.h"
|
||||||
|
|
||||||
PacketHistory::PacketHistory()
|
PacketHistory::PacketHistory()
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
#include <queue>
|
#include <queue>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
/// We clear our old flood record five minute after we see the last of it
|
/// We clear our old flood record five minute after we see the last of it
|
||||||
#define FLOOD_EXPIRE_TIME (5 * 60 * 1000L)
|
#define FLOOD_EXPIRE_TIME (5 * 60 * 1000L)
|
||||||
|
|
||||||
@@ -23,7 +21,7 @@ struct PacketRecord {
|
|||||||
class PacketRecordHashFunction
|
class PacketRecordHashFunction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
size_t operator()(const PacketRecord &p) const { return (hash<NodeNum>()(p.sender)) ^ (hash<PacketId>()(p.id)); }
|
size_t operator()(const PacketRecord &p) const { return (std::hash<NodeNum>()(p.sender)) ^ (std::hash<PacketId>()(p.id)); }
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Order packet records by arrival time, we want the oldest packets to be in the front of our heap
|
/// Order packet records by arrival time, we want the oldest packets to be in the front of our heap
|
||||||
@@ -54,7 +52,7 @@ class PacketHistory
|
|||||||
/** FIXME: really should be a std::unordered_set with the key being sender,id.
|
/** FIXME: really should be a std::unordered_set with the key being sender,id.
|
||||||
* This would make checking packets in wasSeenRecently faster.
|
* This would make checking packets in wasSeenRecently faster.
|
||||||
*/
|
*/
|
||||||
vector<PacketRecord> recentPackets;
|
std::vector<PacketRecord> recentPackets;
|
||||||
// priority_queue<PacketRecord, vector<PacketRecord>, PacketRecordOrderFunction> arrivalTimes;
|
// priority_queue<PacketRecord, vector<PacketRecord>, PacketRecordOrderFunction> arrivalTimes;
|
||||||
// unordered_set<PacketRecord, PacketRecordHashFunction> recentPackets;
|
// unordered_set<PacketRecord, PacketRecordHashFunction> recentPackets;
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "PhoneAPI.h"
|
#include "PhoneAPI.h"
|
||||||
#include "Channels.h"
|
#include "Channels.h"
|
||||||
#include "GPS.h"
|
#include "GPS.h"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "ProtobufPlugin.h"
|
#include "ProtobufPlugin.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "RF95Interface.h"
|
#include "RF95Interface.h"
|
||||||
#include "MeshRadio.h" // kinda yucky, but we need to know which region we are in
|
#include "MeshRadio.h" // kinda yucky, but we need to know which region we are in
|
||||||
#include "RadioLibRF95.h"
|
#include "RadioLibRF95.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include <configuration.h>
|
|
||||||
|
|
||||||
#define MAX_POWER 20
|
#define MAX_POWER 20
|
||||||
// if we use 20 we are limited to 1% duty cycle or hw might overheat. For continuous operation set a limit of 17
|
// if we use 20 we are limited to 1% duty cycle or hw might overheat. For continuous operation set a limit of 17
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "RadioInterface.h"
|
#include "RadioInterface.h"
|
||||||
#include "Channels.h"
|
#include "Channels.h"
|
||||||
#include "MeshRadio.h"
|
#include "MeshRadio.h"
|
||||||
@@ -6,7 +6,6 @@
|
|||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "Router.h"
|
#include "Router.h"
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#include "configuration.h"
|
|
||||||
#include "sleep.h"
|
#include "sleep.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <pb_decode.h>
|
#include <pb_decode.h>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "RadioLibInterface.h"
|
#include "RadioLibInterface.h"
|
||||||
#include "MeshTypes.h"
|
#include "MeshTypes.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "SPILock.h"
|
#include "SPILock.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "mesh-pb-constants.h"
|
#include "mesh-pb-constants.h"
|
||||||
#include <configuration.h>
|
|
||||||
#include <pb_decode.h>
|
#include <pb_decode.h>
|
||||||
#include <pb_encode.h>
|
#include <pb_encode.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "RadioLibRF95.h"
|
#include "RadioLibRF95.h"
|
||||||
|
|
||||||
#define RF95_CHIP_VERSION 0x12
|
#define RF95_CHIP_VERSION 0x12
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "ReliableRouter.h"
|
#include "ReliableRouter.h"
|
||||||
#include "MeshPlugin.h"
|
#include "MeshPlugin.h"
|
||||||
#include "MeshTypes.h"
|
#include "MeshTypes.h"
|
||||||
#include "configuration.h"
|
|
||||||
#include "mesh-pb-constants.h"
|
#include "mesh-pb-constants.h"
|
||||||
|
|
||||||
// ReliableRouter::ReliableRouter() {}
|
// ReliableRouter::ReliableRouter() {}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ struct PendingPacket {
|
|||||||
class GlobalPacketIdHashFunction
|
class GlobalPacketIdHashFunction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
size_t operator()(const GlobalPacketId &p) const { return (hash<NodeNum>()(p.node)) ^ (hash<PacketId>()(p.id)); }
|
size_t operator()(const GlobalPacketId &p) const { return (std::hash<NodeNum>()(p.node)) ^ (std::hash<PacketId>()(p.id)); }
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -60,7 +60,7 @@ class GlobalPacketIdHashFunction
|
|||||||
class ReliableRouter : public FloodingRouter
|
class ReliableRouter : public FloodingRouter
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
unordered_map<GlobalPacketId, PendingPacket, GlobalPacketIdHashFunction> pending;
|
std::unordered_map<GlobalPacketId, PendingPacket, GlobalPacketIdHashFunction> pending;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "Router.h"
|
#include "Router.h"
|
||||||
#include "Channels.h"
|
#include "Channels.h"
|
||||||
#include "CryptoEngine.h"
|
#include "CryptoEngine.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "RTC.h"
|
#include "RTC.h"
|
||||||
#include "configuration.h"
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "mesh-pb-constants.h"
|
#include "mesh-pb-constants.h"
|
||||||
#include "plugins/RoutingPlugin.h"
|
#include "plugins/RoutingPlugin.h"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "SX1262Interface.h"
|
#include "SX1262Interface.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include <configuration.h>
|
|
||||||
|
|
||||||
// Particular boards might define a different max power based on what their hardware can do
|
// Particular boards might define a different max power based on what their hardware can do
|
||||||
#ifndef SX1262_MAX_POWER
|
#ifndef SX1262_MAX_POWER
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ typedef enum _HardwareModel {
|
|||||||
|
|
||||||
typedef enum _Constants {
|
typedef enum _Constants {
|
||||||
Constants_Unused = 0,
|
Constants_Unused = 0,
|
||||||
Constants_DATA_PAYLOAD_LEN = 240
|
Constants_DATA_PAYLOAD_LEN = 237
|
||||||
} Constants;
|
} Constants;
|
||||||
|
|
||||||
typedef enum _CriticalErrorCode {
|
typedef enum _CriticalErrorCode {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ size_t pb_encode_to_bytes(uint8_t *destbuf, size_t destbufsize, const pb_msgdesc
|
|||||||
|
|
||||||
pb_ostream_t stream = pb_ostream_from_buffer(destbuf, destbufsize);
|
pb_ostream_t stream = pb_ostream_from_buffer(destbuf, destbufsize);
|
||||||
if (!pb_encode(&stream, fields, src_struct)) {
|
if (!pb_encode(&stream, fields, src_struct)) {
|
||||||
DEBUG_MSG("Panic: can't encode protobuf reason='%s', reason=%s\n", PB_GET_ERROR(&stream));
|
DEBUG_MSG("Panic: can't encode protobuf reason='%s'\n", PB_GET_ERROR(&stream));
|
||||||
assert(0); // If this asser fails it probably means you made a field too large for the max limits specified in mesh.options
|
assert(0); // If this asser fails it probably means you made a field too large for the max limits specified in mesh.options
|
||||||
} else {
|
} else {
|
||||||
return stream.bytes_written;
|
return stream.bytes_written;
|
||||||
@@ -30,7 +30,7 @@ bool pb_decode_from_bytes(const uint8_t *srcbuf, size_t srcbufsize, const pb_msg
|
|||||||
{
|
{
|
||||||
pb_istream_t stream = pb_istream_from_buffer(srcbuf, srcbufsize);
|
pb_istream_t stream = pb_istream_from_buffer(srcbuf, srcbufsize);
|
||||||
if (!pb_decode(&stream, fields, dest_struct)) {
|
if (!pb_decode(&stream, fields, dest_struct)) {
|
||||||
DEBUG_MSG("Error: can't decode protobuf reason='%s', pb_msgdesc 0x%p, reason=%s\n", PB_GET_ERROR(&stream), fields);
|
DEBUG_MSG("Error: can't decode protobuf reason='%s', pb_msgdesc 0x%p\n", PB_GET_ERROR(&stream), fields);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1,100 +0,0 @@
|
|||||||
#include "BQ25713.h"
|
|
||||||
#include "configuration.h"
|
|
||||||
|
|
||||||
#include <Wire.h>
|
|
||||||
|
|
||||||
#ifdef BQ25703A_ADDR
|
|
||||||
|
|
||||||
const uint8_t BQ25713::devAddr = BQ25703A_ADDR;
|
|
||||||
|
|
||||||
bool BQ25713::setup()
|
|
||||||
{
|
|
||||||
DEBUG_MSG("Init BQ25713\n");
|
|
||||||
|
|
||||||
// if(!writeReg(0x34,0x9034)) return false;
|
|
||||||
//
|
|
||||||
// if(!writeReg(0x34,0x8034)) return false;
|
|
||||||
|
|
||||||
if (!writeReg(0x00, 0x0F0A))
|
|
||||||
return false; // Config Charge Option 0
|
|
||||||
|
|
||||||
if (!writeReg(0x02, 0x0224)) // 512mA, FIXME, this seems to be setting a number of bits marked as reserved, why?
|
|
||||||
return false; // Config Charge Current
|
|
||||||
|
|
||||||
if (!writeReg(0x04, 0x1070)) // about 4.29V
|
|
||||||
return false; // Config Charge Voltage
|
|
||||||
|
|
||||||
if (!writeReg(0x06, 0x099C))
|
|
||||||
return false; // Config OTG Voltage
|
|
||||||
|
|
||||||
if (!writeReg(0x08, 0x5000))
|
|
||||||
return false; // Config OTG Current
|
|
||||||
|
|
||||||
// if(!writeReg(0x0A,0x0100)) return false;//Config Input Voltage
|
|
||||||
|
|
||||||
if (!writeReg(0x0C, 0x1800)) // 4.2Vish FIXME, we could lower this?
|
|
||||||
return false; // Config Minimum System Voltage
|
|
||||||
|
|
||||||
if (!writeReg(0x0E, 0x4900))
|
|
||||||
return false; // Config Input Current
|
|
||||||
|
|
||||||
if (!writeReg(0x30, 0xE210))
|
|
||||||
return false; // Config Charge Option 1
|
|
||||||
|
|
||||||
if (!writeReg(0x32, 0x32BF))
|
|
||||||
return false; // Config Charge Option 2
|
|
||||||
|
|
||||||
if (!writeReg(0x34, 0x0834))
|
|
||||||
return false; // Config Charge Option 3
|
|
||||||
|
|
||||||
if (!writeReg(0x36, 0x4A65))
|
|
||||||
return false; // Config Prochot Option 0
|
|
||||||
|
|
||||||
if (!writeReg(0x38, 0x81FF))
|
|
||||||
return false; // Config Prochot Option 1
|
|
||||||
|
|
||||||
if (!writeReg(0x3A, 0xA0FF))
|
|
||||||
return false; // Config ADC Option
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint16_t BQ25713::readReg(uint8_t reg)
|
|
||||||
{
|
|
||||||
Wire.beginTransmission(devAddr);
|
|
||||||
Wire.write(reg);
|
|
||||||
byte err = Wire.endTransmission();
|
|
||||||
if (!err) {
|
|
||||||
int readLen = 2;
|
|
||||||
Wire.requestFrom(devAddr, (int)(readLen + 1));
|
|
||||||
if (Wire.available() >= readLen) {
|
|
||||||
uint8_t lsb = Wire.read(), msb = Wire.read();
|
|
||||||
|
|
||||||
return (((uint16_t)msb) << 8) + lsb;
|
|
||||||
} else
|
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool BQ25713::writeReg(uint8_t reg, uint16_t v)
|
|
||||||
{
|
|
||||||
Wire.beginTransmission(devAddr);
|
|
||||||
Wire.write(reg);
|
|
||||||
Wire.write(v & 0xff);
|
|
||||||
Wire.write((v >> 8) & 0xff);
|
|
||||||
byte err = Wire.endTransmission(); // 0 for success
|
|
||||||
|
|
||||||
if (!err) {
|
|
||||||
// Do a test readback for early debugging
|
|
||||||
uint16_t found = readReg(reg);
|
|
||||||
if (found != v) {
|
|
||||||
DEBUG_MSG("Readback reg=0x%0x test failed, expected 0x%0x, found 0x%0x!\n", reg, v, found);
|
|
||||||
return true; // claim success - FIXME
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return !err;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <Arduino.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Driver class to control/monitor BQ25713 charge controller
|
|
||||||
*/
|
|
||||||
class BQ25713 {
|
|
||||||
static const uint8_t devAddr;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/// Return true for success
|
|
||||||
bool setup();
|
|
||||||
|
|
||||||
private:
|
|
||||||
uint16_t readReg(uint8_t reg);
|
|
||||||
|
|
||||||
/// Return true for success
|
|
||||||
bool writeReg(uint8_t reg, uint16_t v);
|
|
||||||
};
|
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "NRF52Bluetooth.h"
|
#include "NRF52Bluetooth.h"
|
||||||
#include "BluetoothCommon.h"
|
#include "BluetoothCommon.h"
|
||||||
#include "configuration.h"
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "mesh/PhoneAPI.h"
|
#include "mesh/PhoneAPI.h"
|
||||||
#include "mesh/mesh-pb-constants.h"
|
#include "mesh/mesh-pb-constants.h"
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
#include "CryptoEngine.h"
|
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
#include "CryptoEngine.h"
|
||||||
#include "ocrypto_aes_ctr.h"
|
#include "ocrypto_aes_ctr.h"
|
||||||
|
|
||||||
class NRF52CryptoEngine : public CryptoEngine
|
class NRF52CryptoEngine : public CryptoEngine
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "rtos.h"
|
#include "rtos.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
#include <Wire.h>
|
#include <Wire.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@@ -6,7 +7,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "NRF52Bluetooth.h"
|
#include "NRF52Bluetooth.h"
|
||||||
#include "configuration.h"
|
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
|
||||||
#ifdef BQ25703A_ADDR
|
#ifdef BQ25703A_ADDR
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "AdminPlugin.h"
|
#include "AdminPlugin.h"
|
||||||
#include "Channels.h"
|
#include "Channels.h"
|
||||||
#include "MeshService.h"
|
#include "MeshService.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "Router.h"
|
#include "Router.h"
|
||||||
#include "configuration.h"
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
#ifdef PORTDUINO
|
#ifdef PORTDUINO
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "ExternalNotificationPlugin.h"
|
#include "ExternalNotificationPlugin.h"
|
||||||
#include "MeshService.h"
|
#include "MeshService.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "RTC.h"
|
#include "RTC.h"
|
||||||
#include "Router.h"
|
#include "Router.h"
|
||||||
#include "configuration.h"
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
//#include <assert.h>
|
//#include <assert.h>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "NodeInfoPlugin.h"
|
#include "NodeInfoPlugin.h"
|
||||||
#include "MeshService.h"
|
#include "MeshService.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "RTC.h"
|
#include "RTC.h"
|
||||||
#include "Router.h"
|
#include "Router.h"
|
||||||
#include "configuration.h"
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
NodeInfoPlugin *nodeInfoPlugin;
|
NodeInfoPlugin *nodeInfoPlugin;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "plugins/ExternalNotificationPlugin.h"
|
#include "plugins/ExternalNotificationPlugin.h"
|
||||||
#include "plugins/NodeInfoPlugin.h"
|
#include "plugins/NodeInfoPlugin.h"
|
||||||
#include "plugins/PositionPlugin.h"
|
#include "plugins/PositionPlugin.h"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "PositionPlugin.h"
|
#include "PositionPlugin.h"
|
||||||
#include "MeshService.h"
|
#include "MeshService.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "RTC.h"
|
#include "RTC.h"
|
||||||
#include "Router.h"
|
#include "Router.h"
|
||||||
#include "configuration.h"
|
|
||||||
|
|
||||||
PositionPlugin *positionPlugin;
|
PositionPlugin *positionPlugin;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "RemoteHardwarePlugin.h"
|
#include "RemoteHardwarePlugin.h"
|
||||||
#include "MeshService.h"
|
#include "MeshService.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "RTC.h"
|
#include "RTC.h"
|
||||||
#include "Router.h"
|
#include "Router.h"
|
||||||
#include "configuration.h"
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
#define NUM_GPIOS 64
|
#define NUM_GPIOS 64
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "ReplyPlugin.h"
|
#include "ReplyPlugin.h"
|
||||||
#include "MeshService.h"
|
#include "MeshService.h"
|
||||||
#include "configuration.h"
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "RoutingPlugin.h"
|
#include "RoutingPlugin.h"
|
||||||
#include "MeshService.h"
|
#include "MeshService.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "Router.h"
|
#include "Router.h"
|
||||||
#include "configuration.h"
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
RoutingPlugin *routingPlugin;
|
RoutingPlugin *routingPlugin;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "SerialPlugin.h"
|
#include "SerialPlugin.h"
|
||||||
#include "MeshService.h"
|
#include "MeshService.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "RTC.h"
|
#include "RTC.h"
|
||||||
#include "Router.h"
|
#include "Router.h"
|
||||||
#include "configuration.h"
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
../nrf52/wifi-stubs.cpp
|
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
|
#include "configuration.h"
|
||||||
#include "sleep.h"
|
#include "sleep.h"
|
||||||
#include "GPS.h"
|
#include "GPS.h"
|
||||||
#include "MeshRadio.h"
|
#include "MeshRadio.h"
|
||||||
#include "MeshService.h"
|
#include "MeshService.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "configuration.h"
|
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "target_specific.h"
|
#include "target_specific.h"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
//#include "mesh/wifi/WebServer.h"
|
//#include "mesh/wifi/WebServer.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
|
||||||
#ifndef NO_ESP32
|
#ifdef NO_ESP32
|
||||||
|
|
||||||
//#include "mesh/wifi/WiFiAPClient.h"
|
//#include "mesh/wifi/WiFiAPClient.h"
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[VERSION]
|
[VERSION]
|
||||||
major = 1
|
major = 1
|
||||||
minor = 2
|
minor = 2
|
||||||
build = 36
|
build = 41
|
||||||
|
|||||||
Reference in New Issue
Block a user