Skip to content

Commit

Permalink
Merge branch 'master' into apollo
Browse files Browse the repository at this point in the history
  • Loading branch information
thebentern authored Dec 12, 2023
2 parents 55a75d2 + d14d2c8 commit b2a3137
Show file tree
Hide file tree
Showing 46 changed files with 477 additions and 128 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/main_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
- board: tlora-v2-1-1_6
- board: tlora-v2-1-1_8
- board: tbeam
- board: heltec-ht62-esp32c3-sx1262
- board: heltec-v1
- board: heltec-v2_0
- board: heltec-v2_1
Expand Down Expand Up @@ -125,6 +126,7 @@ jobs:
- board: pico
- board: picow
- board: rak11310
- board: senselora_rp2040
uses: ./.github/workflows/build_rpi2040.yml
with:
board: ${{ matrix.board }}
Expand Down Expand Up @@ -211,6 +213,9 @@ jobs:
repository: ${{github.event.pull_request.head.repo.full_name}}

gather-artifacts:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
needs:
[
Expand Down Expand Up @@ -284,14 +289,13 @@ jobs:
- name: Create request artifacts
continue-on-error: true # FIXME: Why are we getting 502, but things still work?
if: ${{ github.event_name == 'pull_request_target' || github.event_name == 'pull_request' }}
uses: gavv/pull-request-artifacts@v1.1.0
uses: gavv/pull-request-artifacts@v2.1.0
with:
commit: ${{ (github.event.pull_request_target || github.event.pull_request).head.sha }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
artifacts-token: ${{ secrets.ARTIFACTS_TOKEN }}
artifacts-repo: meshtastic/artifacts
artifacts-branch: device
artifacts-dir: pr
artifacts: ./firmware-${{ steps.version.outputs.version }}.zip

release-artifacts:
Expand Down
3 changes: 1 addition & 2 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ lint:
- checkov@3.1.9
- terrascan@1.18.5
- trivy@0.47.0
- trufflehog@3.63.2-rc0
#- trufflehog@3.63.2-rc0
- taplo@0.8.1
- ruff@0.1.6
- yamllint@1.33.0
- isort@5.12.0
- markdownlint@0.37.0
- oxipng@9.0.0
Expand Down
1 change: 0 additions & 1 deletion arch/esp32/esp32.ini
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ lib_deps =
${environmental_base.lib_deps}
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
h2zero/NimBLE-Arduino@^1.4.1
jgromes/RadioLib@^6.2.0
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f

Expand Down
1 change: 0 additions & 1 deletion arch/nrf52/nrf52.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ build_src_filter =

lib_deps=
${arduino_base.lib_deps}
jgromes/RadioLib@^6.2.0

lib_ignore =
BluetoothOTA
1 change: 0 additions & 1 deletion arch/portduino/portduino.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ lib_deps =
${env.lib_deps}
${networking_base.lib_deps}
rweather/Crypto@^0.4.0
jgromes/RadioLib@^6.1.0

build_flags =
${arduino_base.build_flags}
Expand Down
3 changes: 1 addition & 2 deletions arch/rp2040/rp2040.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[rp2040_base]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#612de5399d68b359053f1307ed223d400aea975c
extends = arduino_base
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#d2461a14ad5aa920e44508d236c2f459e3befbf8
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#3.6.2

board_build.core = earlephilhower
board_build.filesystem_size = 0.5m
Expand All @@ -29,5 +29,4 @@ lib_ignore =
lib_deps =
${arduino_base.lib_deps}
${environmental_base.lib_deps}
jgromes/RadioLib@^6.2.0
rweather/Crypto
1 change: 0 additions & 1 deletion arch/stm32/stm32wl5e.ini
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ upload_protocol = stlink

lib_deps =
${env.lib_deps}
jgromes/RadioLib@^6.2.0
https://github.com/kokke/tiny-AES-c.git#f06ac37fc31dfdaca2e0d9bec83f90d5663c319b
https://github.com/littlefs-project/littlefs.git#v2.5.1
https://github.com/stm32duino/STM32FreeRTOS.git#10.3.1
Expand Down
1 change: 1 addition & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ build_flags = -Wno-missing-field-initializers
monitor_speed = 115200

lib_deps =
jgromes/RadioLib@^6.3.0
https://github.com/meshtastic/esp8266-oled-ssd1306.git#b38094e03dfa964fbc0e799bc374e91a605c1223 ; ESP8266_SSD1306
mathertel/OneButton@^2.5.0 ; OneButton library for non-blocking button debounce
https://github.com/meshtastic/arduino-fsm.git#7db3702bf0cfe97b783d6c72595e3f38e0b19159
Expand Down
2 changes: 1 addition & 1 deletion protobufs
77 changes: 77 additions & 0 deletions src/AudioThread.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#pragma once
#include "PowerFSM.h"
#include "concurrency/OSThread.h"
#include "configuration.h"
#include "main.h"
#include "sleep.h"

#ifdef HAS_I2S
#include <AudioFileSourcePROGMEM.h>
#include <AudioGeneratorRTTTL.h>
#include <AudioOutputI2S.h>
#include <ESP8266SAM.h>

#define AUDIO_THREAD_INTERVAL_MS 100

class AudioThread : public concurrency::OSThread
{
public:
AudioThread() : OSThread("AudioThread") { initOutput(); }

void beginRttl(const void *data, uint32_t len)
{
setCPUFast(true);
rtttlFile = new AudioFileSourcePROGMEM(data, len);
i2sRtttl = new AudioGeneratorRTTTL();
i2sRtttl->begin(rtttlFile, audioOut);
}

bool isPlaying()
{
if (i2sRtttl != nullptr) {
return i2sRtttl->isRunning() && i2sRtttl->loop();
}
return false;
}

void stop()
{
if (i2sRtttl != nullptr) {
i2sRtttl->stop();
delete i2sRtttl;
i2sRtttl = nullptr;
}
if (rtttlFile != nullptr) {
delete rtttlFile;
rtttlFile = nullptr;
}

setCPUFast(false);
}

protected:
int32_t runOnce() override
{
canSleep = true; // Assume we should not keep the board awake

// if (i2sRtttl != nullptr && i2sRtttl->isRunning()) {
// i2sRtttl->loop();
// }
return AUDIO_THREAD_INTERVAL_MS;
}

private:
void initOutput()
{
audioOut = new AudioOutputI2S(1, AudioOutputI2S::EXTERNAL_I2S);
audioOut->SetPinout(DAC_I2S_BCK, DAC_I2S_WS, DAC_I2S_DOUT);
audioOut->SetGain(0.2);
};

AudioGeneratorRTTTL *i2sRtttl = nullptr;
AudioOutputI2S *audioOut;

AudioFileSourcePROGMEM *rtttlFile;
};

#endif
7 changes: 7 additions & 0 deletions src/ButtonThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "configuration.h"
#include "graphics/Screen.h"
#include "main.h"
#include "modules/ExternalNotificationModule.h"
#include "power.h"
#include <OneButton.h>

Expand Down Expand Up @@ -205,6 +206,12 @@ class ButtonThread : public concurrency::OSThread

static void userButtonPressedLongStart()
{
#ifdef T_DECK
// False positive long-press triggered on T-Deck with i2s audio, so short circuit
if (moduleConfig.external_notification.enabled && (externalNotificationModule->nagCycleCutoff != UINT32_MAX)) {
return;
}
#endif
if (millis() > 30 * 1000) {
LOG_DEBUG("Long press start!\n");
longPressTime = millis();
Expand Down
2 changes: 1 addition & 1 deletion src/PowerFSMThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class PowerFSMThread : public OSThread
powerFSM.trigger(EVENT_SHUTDOWN);
}

return 10;
return 100;
}
};

Expand Down
22 changes: 17 additions & 5 deletions src/gps/GPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ bool GPS::setup()
gnssModel = GNSS_MODEL_UNKNOWN;
}
#else
gnssModel = GNSS_MODEL_UC6850;
gnssModel = GNSS_MODEL_UC6580;
#endif

if (gnssModel == GNSS_MODEL_MTK) {
Expand All @@ -311,11 +311,23 @@ bool GPS::setup()
// Switch to Vehicle Mode, since SoftRF enables Aviation < 2g
_serial_gps->write("$PCAS11,3*1E\r\n");
delay(250);
} else if (gnssModel == GNSS_MODEL_UC6850) {

// use GPS + GLONASS
_serial_gps->write("$CFGSYS,h15\r\n");
} else if (gnssModel == GNSS_MODEL_UC6580) {
// The Unicore UC6580 can use a lot of sat systems, enable it to
// use GPS L1 & L5 + BDS B1I & B2a + GLONASS L1 + GALILEO E1 & E5a + SBAS
// This will reset the receiver, so wait a bit afterwards
// The paranoid will wait for the OK*04 confirmation response after each command.
_serial_gps->write("$CFGSYS,h25155\r\n");
delay(750);
// Must be done after the CFGSYS command
// Turn off GSV messages, we don't really care about which and where the sats are, maybe someday.
_serial_gps->write("$CFGMSG,0,3,0\r\n");
delay(250);
// Turn off NOTICE __TXT messages, these may provide Unicore some info but we don't care.
_serial_gps->write("$CFGMSG,6,0,0\r\n");
delay(250);
_serial_gps->write("$CFGMSG,6,1,0\r\n");
delay(250);

} else if (gnssModel == GNSS_MODEL_UBLOX) {
// Configure GNSS system to GPS+SBAS+GLONASS (Module may restart after this command)
// We need set it because by default it is GPS only, and we want to use GLONASS too
Expand Down
2 changes: 1 addition & 1 deletion src/gps/GPS.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct uBloxGnssModelInfo {
typedef enum {
GNSS_MODEL_MTK,
GNSS_MODEL_UBLOX,
GNSS_MODEL_UC6850,
GNSS_MODEL_UC6580,
GNSS_MODEL_UNKNOWN,
} GnssModel_t;

Expand Down
4 changes: 2 additions & 2 deletions src/gps/RTC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ bool perhapsSetRTC(RTCQuality q, const struct timeval *tv)
#endif

// nrf52 doesn't have a readable RTC (yet - software not written)
#ifdef HAS_RTC
#if HAS_RTC
readFromRTC();
#endif

Expand Down Expand Up @@ -208,4 +208,4 @@ uint32_t getTime()
uint32_t getValidTime(RTCQuality minQuality)
{
return (currentQuality >= minQuality) ? getTime() : 0;
}
}
7 changes: 5 additions & 2 deletions src/graphics/Screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "sleep.h"
#include "target_specific.h"

#if HAS_WIFI && !defined(ARCH_RASPBERRY_PI)
#include "mesh/wifi/WiFiAPClient.h"
#endif

#ifdef ARCH_ESP32
#include "esp_task_wdt.h"
#include "mesh/wifi/WiFiAPClient.h"
#include "modules/esp32/StoreForwardModule.h"
#endif

Expand Down Expand Up @@ -1294,7 +1297,7 @@ void Screen::setFrames()
// call a method on debugInfoScreen object (for more details)
normalFrames[numframes++] = &Screen::drawDebugInfoSettingsTrampoline;

#ifdef ARCH_ESP32
#if HAS_WIFI && !defined(ARCH_RASPBERRY_PI)
if (isWifiAvailable()) {
// call a method on debugInfoScreen object (for more details)
normalFrames[numframes++] = &Screen::drawDebugInfoWiFiTrampoline;
Expand Down
7 changes: 6 additions & 1 deletion src/input/TouchScreenImpl1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "InputBroker.h"
#include "PowerFSM.h"
#include "configuration.h"
#include "modules/ExternalNotificationModule.h"

TouchScreenImpl1 *touchScreenImpl1;

Expand Down Expand Up @@ -63,7 +64,11 @@ void TouchScreenImpl1::onEvent(const TouchEvent &event)
break;
}
case TOUCH_ACTION_TAP: {
powerFSM.trigger(EVENT_INPUT);
if (moduleConfig.external_notification.enabled && (externalNotificationModule->nagCycleCutoff != UINT32_MAX)) {
externalNotificationModule->stopNow();
} else {
powerFSM.trigger(EVENT_INPUT);
}
break;
}
default:
Expand Down
Loading

0 comments on commit b2a3137

Please sign in to comment.