Skip to content

Commit

Permalink
Merge branch 'master' into stm32wl
Browse files Browse the repository at this point in the history
  • Loading branch information
thebentern authored Dec 13, 2023
2 parents 2c6e2bb + dd96848 commit 41cbf30
Show file tree
Hide file tree
Showing 43 changed files with 1,144 additions and 280 deletions.
7 changes: 5 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 @@ -212,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 @@ -285,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
5 changes: 2 additions & 3 deletions arch/portduino/portduino.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; The Portduino based sim environment on top of any host OS, all hardware will be simulated
[portduino_base]
platform = https://github.com/meshtastic/platform-native.git#05255283879a0c65a7d3eba6c468b9186438bb14
platform = https://github.com/meshtastic/platform-native.git#ff5da1d203b5c1163cfcda858d5f84920187f030
framework = arduino

build_src_filter =
Expand Down Expand Up @@ -28,5 +28,4 @@ build_flags =
${arduino_base.build_flags}
-fPIC
-Isrc/platform/portduino
-DRADIOLIB_EEPROM_UNSUPPORTED

-DRADIOLIB_EEPROM_UNSUPPORTED
36 changes: 30 additions & 6 deletions bin/config-dist.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Define your devices here using Broadcom pin numbering
# Uncomment the block that corresponds to your hardware
### Define your devices here using Broadcom pin numbering
### Uncomment the block that corresponds to your hardware
---
Lora:
# Module: sx1262 # Waveshare SX126X XXXM
Expand All @@ -25,16 +25,40 @@ Lora:
# CS: 7
# IRQ: 25

# Set gpio chip to use in /dev/. Defaults to 0.
# Notably the Raspberry Pi 5 puts the GPIO header on gpiochip4
### Set gpio chip to use in /dev/. Defaults to 0.
### Notably the Raspberry Pi 5 puts the GPIO header on gpiochip4
# gpiochip: 4

# Define GPIO buttons here:
### Define GPIO buttons here:

GPIO:
# User: 6

# Define GPS
### Define GPS

GPS:
# SerialPath: /dev/ttyS0

### Set up SPI displays here. Note that I2C displays are generally auto-detected.

Display:

### Waveshare 2.8inch RPi LCD
# Panel: ST7789
# CS: 8
# DC: 22 # Data/Command pin
# Backlight: 18
# Width: 240
# Height: 320
# Reset: 27
# Rotate: true

Touchscreen:
# Module: XPT2046
# CS: 7
# IRQ: 17

### Configure device for direct keyboard input

Input:
# KeyboardDevice: /dev/input/event0
9 changes: 6 additions & 3 deletions bin/meshtasticd.service
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
[unit]
description=Meshtastic Native Daemon
[Unit]
Description=Meshtastic Native Daemon
After=network-online.target

[Service]
User=root
Group=root
Type=simple
ExecStart=/usr/sbin/meshtasticd

[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target
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
14 changes: 13 additions & 1 deletion src/gps/GPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,22 @@ bool GPS::setup()
_serial_gps->write("$PCAS11,3*1E\r\n");
delay(250);
} 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
Loading

0 comments on commit 41cbf30

Please sign in to comment.