Skip to content

Commit 44a2b2f

Browse files
authored
Merge branch 'develop' into gps-reset-detect
2 parents c9cdc8e + 034d2dd commit 44a2b2f

File tree

83 files changed

+753
-833
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+753
-833
lines changed

.github/workflows/stale_bot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@ jobs:
2020
uses: actions/[email protected]
2121
with:
2222
days-before-stale: 45
23+
stale-issue-message: This issue has not had any comment or update in the last month. If it is still relevant, please post update comments. If no comments are made, this issue will be closed automagically in 7 days.
24+
close-issue-message: This issue has not had any comment since the last notice. It has been closed automatically. If this is incorrect, or the issue becomes relevant again, please request that it is reopened.
2325
exempt-issue-labels: pinned,3.0
2426
exempt-pr-labels: pinned,3.0

bin/kill-github-actions.sh

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
#!/bin/bash
2+
3+
# Script to cancel all running GitHub Actions workflows
4+
# Requires GitHub CLI (gh) to be installed and authenticated
5+
6+
set -e
7+
8+
# Colors for output
9+
RED='\033[0;31m'
10+
GREEN='\033[0;32m'
11+
YELLOW='\033[1;33m'
12+
NC='\033[0m' # No Color
13+
14+
# Function to print colored output
15+
print_status() {
16+
echo -e "${GREEN}[INFO]${NC} $1"
17+
}
18+
19+
print_warning() {
20+
echo -e "${YELLOW}[WARN]${NC} $1"
21+
}
22+
23+
print_error() {
24+
echo -e "${RED}[ERROR]${NC} $1"
25+
}
26+
27+
# Check if gh CLI is installed
28+
if ! command -v gh &> /dev/null; then
29+
print_error "GitHub CLI (gh) is not installed. Please install it first:"
30+
echo " brew install gh"
31+
echo " Or visit: https://cli.github.com/"
32+
exit 1
33+
fi
34+
35+
# Check if authenticated
36+
if ! gh auth status &> /dev/null; then
37+
print_error "GitHub CLI is not authenticated. Please run:"
38+
echo " gh auth login"
39+
exit 1
40+
fi
41+
42+
# Get repository info
43+
REPO=$(gh repo view --json owner,name -q '.owner.login + "/" + .name')
44+
if [[ -z "$REPO" ]]; then
45+
print_error "Could not determine repository. Make sure you're in a GitHub repository."
46+
exit 1
47+
fi
48+
49+
print_status "Working with repository: $REPO"
50+
51+
# Get all active workflows (both queued and in-progress)
52+
print_status "Fetching active workflows (queued and in-progress)..."
53+
QUEUED_WORKFLOWS=$(gh run list --status queued --json databaseId,displayTitle,headBranch,status --limit 100)
54+
IN_PROGRESS_WORKFLOWS=$(gh run list --status in_progress --json databaseId,displayTitle,headBranch,status --limit 100)
55+
56+
# Combine both lists
57+
ALL_WORKFLOWS=$(echo "$QUEUED_WORKFLOWS $IN_PROGRESS_WORKFLOWS" | jq -s 'add | unique_by(.databaseId)')
58+
59+
if [[ "$ALL_WORKFLOWS" == "[]" ]]; then
60+
print_status "No active workflows found."
61+
exit 0
62+
fi
63+
64+
# Parse and display active workflows
65+
echo
66+
print_warning "Found active workflows:"
67+
echo "$ALL_WORKFLOWS" | jq -r '.[] | " - \(.displayTitle) (Branch: \(.headBranch), Status: \(.status), ID: \(.databaseId))"'
68+
69+
echo
70+
read -p "Do you want to cancel ALL these workflows? (y/N): " -n 1 -r
71+
echo
72+
73+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
74+
print_status "Cancelled by user."
75+
exit 0
76+
fi
77+
78+
# Cancel each workflow
79+
print_status "Cancelling workflows..."
80+
CANCELLED_COUNT=0
81+
FAILED_COUNT=0
82+
83+
while IFS= read -r WORKFLOW_ID; do
84+
if [[ -n "$WORKFLOW_ID" ]]; then
85+
print_status "Cancelling workflow ID: $WORKFLOW_ID"
86+
if gh run cancel "$WORKFLOW_ID" 2>/dev/null; then
87+
((CANCELLED_COUNT++))
88+
else
89+
print_error "Failed to cancel workflow ID: $WORKFLOW_ID"
90+
((FAILED_COUNT++))
91+
fi
92+
fi
93+
done < <(echo "$ALL_WORKFLOWS" | jq -r '.[].databaseId')
94+
95+
echo
96+
print_status "Summary:"
97+
echo " - Cancelled: $CANCELLED_COUNT workflows"
98+
if [[ $FAILED_COUNT -gt 0 ]]; then
99+
echo " - Failed: $FAILED_COUNT workflows"
100+
fi
101+
102+
print_status "Done!"
103+
104+
# Optional: Show remaining active workflows
105+
echo
106+
print_status "Checking for any remaining active workflows..."
107+
REMAINING_QUEUED=$(gh run list --status queued --json databaseId --limit 10)
108+
REMAINING_IN_PROGRESS=$(gh run list --status in_progress --json databaseId --limit 10)
109+
REMAINING_ALL=$(echo "$REMAINING_QUEUED $REMAINING_IN_PROGRESS" | jq -s 'add | unique_by(.databaseId)')
110+
111+
if [[ "$REMAINING_ALL" == "[]" ]]; then
112+
print_status "All workflows successfully cancelled."
113+
else
114+
REMAINING_COUNT=$(echo "$REMAINING_ALL" | jq '. | length')
115+
print_warning "Still $REMAINING_COUNT workflows active (may take a moment to update status)"
116+
fi

platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ lib_deps =
120120
[device-ui_base]
121121
lib_deps =
122122
# renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master
123-
https://github.com/meshtastic/device-ui/archive/6d8cc228298a1ecd9913aed757187e9527c1facc.zip
123+
https://github.com/meshtastic/device-ui/archive/3fb7c0e28e8e51fc0a7d56facacf3411f1d29fe0.zip
124124

125125
; Common libs for environmental measurements in telemetry module
126126
[environmental_base]

src/Power.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,7 @@ class AnalogBatteryLevel : public HasBatteryLevel
562562
config.power.device_battery_ina_address) {
563563
if (!ina226Sensor.isInitialized())
564564
return ina226Sensor.runOnce() > 0;
565+
return ina226Sensor.isRunning();
565566
} else if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA260].first ==
566567
config.power.device_battery_ina_address) {
567568
if (!ina260Sensor.isInitialized())

src/detect/ScanI2CConsumer.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include "ScanI2CConsumer.h"
2+
#include <forward_list>
3+
4+
static std::forward_list<ScanI2CConsumer *> ScanI2CConsumers;
5+
6+
ScanI2CConsumer::ScanI2CConsumer()
7+
{
8+
ScanI2CConsumers.push_front(this);
9+
}
10+
11+
void ScanI2CCompleted(ScanI2C *i2cScanner)
12+
{
13+
for (ScanI2CConsumer *consumer : ScanI2CConsumers) {
14+
consumer->i2cScanFinished(i2cScanner);
15+
}
16+
}

src/detect/ScanI2CConsumer.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#pragma once
2+
3+
#include "ScanI2C.h"
4+
#include <stddef.h>
5+
6+
class ScanI2CConsumer
7+
{
8+
public:
9+
ScanI2CConsumer();
10+
virtual void i2cScanFinished(ScanI2C *i2cScanner) = 0;
11+
};
12+
13+
void ScanI2CCompleted(ScanI2C *i2cScanner);

src/detect/ScanI2CTwoWire.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ void ScanI2CTwoWire::scanPort(I2CPort port)
581581
scanPort(port, nullptr, 0);
582582
}
583583

584-
TwoWire *ScanI2CTwoWire::fetchI2CBus(ScanI2C::DeviceAddress address) const
584+
TwoWire *ScanI2CTwoWire::fetchI2CBus(ScanI2C::DeviceAddress address)
585585
{
586586
if (address.port == ScanI2C::I2CPort::WIRE) {
587587
return &Wire;

src/detect/ScanI2CTwoWire.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ class ScanI2CTwoWire : public ScanI2C
2323

2424
ScanI2C::FoundDevice find(ScanI2C::DeviceType) const override;
2525

26-
TwoWire *fetchI2CBus(ScanI2C::DeviceAddress) const;
27-
2826
bool exists(ScanI2C::DeviceType) const override;
2927

3028
size_t countDevices() const override;
3129

30+
static TwoWire *fetchI2CBus(ScanI2C::DeviceAddress);
31+
3232
protected:
3333
FoundDevice firstOfOrNONE(size_t, DeviceType[]) const override;
3434

src/graphics/Screen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1490,7 +1490,7 @@ int Screen::handleTextMessage(const meshtastic_MeshPacket *packet)
14901490
strcpy(banner, "Alert Received");
14911491
}
14921492
screen->showSimpleBanner(banner, 3000);
1493-
} else if (!channel.settings.mute) {
1493+
} else if (!channel.settings.has_module_settings || !channel.settings.module_settings.is_muted) {
14941494
if (longName && longName[0]) {
14951495
#if defined(M5STACK_UNITC6L)
14961496
strcpy(banner, "New Message");

0 commit comments

Comments
 (0)