mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-06 03:29:17 +00:00
Compare commits
17 Commits
954859c2aa
...
d0f0305a72
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d0f0305a72 | ||
![]() |
2d4d36c605 | ||
![]() |
d8eb139570 | ||
![]() |
cbe74009a9 | ||
![]() |
701421b50a | ||
![]() |
336cdc0efe | ||
![]() |
ee391ebea8 | ||
![]() |
a1ac358b0a | ||
![]() |
616f0be719 | ||
![]() |
8462d65f76 | ||
![]() |
10dd8af614 | ||
![]() |
9c06c492d9 | ||
![]() |
7e3c369e87 | ||
![]() |
732cf4832a | ||
![]() |
545ebf9b17 | ||
![]() |
7912c214c7 | ||
![]() |
600208ab0b |
3
.github/workflows/main_matrix.yml
vendored
3
.github/workflows/main_matrix.yml
vendored
@ -245,7 +245,8 @@ jobs:
|
|||||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||||
outputs:
|
outputs:
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
needs: [
|
needs:
|
||||||
|
[
|
||||||
gather-artifacts,
|
gather-artifacts,
|
||||||
package-raspbian,
|
package-raspbian,
|
||||||
package-raspbian-armv7l,
|
package-raspbian-armv7l,
|
||||||
|
43
.github/workflows/trunk_format_pr.yml
vendored
Normal file
43
.github/workflows/trunk_format_pr.yml
vendored
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
name: Run Trunk Fmt on PR Comment
|
||||||
|
|
||||||
|
on:
|
||||||
|
issue_comment:
|
||||||
|
types: [created]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
trunk-fmt:
|
||||||
|
if: github.event.issue.pull_request != null && contains(github.event.comment.body, 'trunk fmt')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
|
||||||
|
- name: Install trunk
|
||||||
|
run: curl https://get.trunk.io -fsSL | bash
|
||||||
|
|
||||||
|
- name: Run Trunk Fmt
|
||||||
|
run: trunk fmt
|
||||||
|
|
||||||
|
- name: Commit and push changes
|
||||||
|
run: |
|
||||||
|
git config --global user.name "github-actions[bot]"
|
||||||
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git add .
|
||||||
|
git commit -m "Add firmware version ${{ steps.version.outputs.version }}"
|
||||||
|
git push
|
||||||
|
|
||||||
|
- name: Comment on PR
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
script: |
|
||||||
|
github.issues.createComment({
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
body: '`trunk fmt` has been run on this PR.'
|
||||||
|
})
|
@ -8,10 +8,10 @@ plugins:
|
|||||||
uri: https://github.com/trunk-io/plugins
|
uri: https://github.com/trunk-io/plugins
|
||||||
lint:
|
lint:
|
||||||
enabled:
|
enabled:
|
||||||
- trufflehog@3.82.13
|
- trufflehog@3.83.2
|
||||||
- yamllint@1.35.1
|
- yamllint@1.35.1
|
||||||
- bandit@1.7.10
|
- bandit@1.7.10
|
||||||
- checkov@3.2.269
|
- checkov@3.2.276
|
||||||
- terrascan@1.19.9
|
- terrascan@1.19.9
|
||||||
- trivy@0.56.2
|
- trivy@0.56.2
|
||||||
#- trufflehog@3.63.2-rc0
|
#- trufflehog@3.63.2-rc0
|
||||||
|
@ -31,7 +31,7 @@ build_flags =
|
|||||||
-DCONFIG_BT_NIMBLE_ENABLED
|
-DCONFIG_BT_NIMBLE_ENABLED
|
||||||
-DCONFIG_NIMBLE_CPP_LOG_LEVEL=2
|
-DCONFIG_NIMBLE_CPP_LOG_LEVEL=2
|
||||||
-DCONFIG_BT_NIMBLE_MAX_CCCDS=20
|
-DCONFIG_BT_NIMBLE_MAX_CCCDS=20
|
||||||
-DCONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=5120
|
-DCONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=8192
|
||||||
-DESP_OPENSSL_SUPPRESS_LEGACY_WARNING
|
-DESP_OPENSSL_SUPPRESS_LEGACY_WARNING
|
||||||
-DSERIAL_BUFFER_SIZE=4096
|
-DSERIAL_BUFFER_SIZE=4096
|
||||||
-DLIBPAX_ARDUINO
|
-DLIBPAX_ARDUINO
|
||||||
|
@ -154,9 +154,16 @@ static void adcEnable()
|
|||||||
#ifdef ADC_CTRL // enable adc voltage divider when we need to read
|
#ifdef ADC_CTRL // enable adc voltage divider when we need to read
|
||||||
#ifdef ADC_USE_PULLUP
|
#ifdef ADC_USE_PULLUP
|
||||||
pinMode(ADC_CTRL, INPUT_PULLUP);
|
pinMode(ADC_CTRL, INPUT_PULLUP);
|
||||||
|
#else
|
||||||
|
#ifdef HELTEC_V3
|
||||||
|
pinMode(ADC_CTRL, INPUT);
|
||||||
|
uint8_t adc_ctl_enable_value = !(digitalRead(ADC_CTRL));
|
||||||
|
pinMode(ADC_CTRL, OUTPUT);
|
||||||
|
digitalWrite(ADC_CTRL, adc_ctl_enable_value);
|
||||||
#else
|
#else
|
||||||
pinMode(ADC_CTRL, OUTPUT);
|
pinMode(ADC_CTRL, OUTPUT);
|
||||||
digitalWrite(ADC_CTRL, ADC_CTRL_ENABLED);
|
digitalWrite(ADC_CTRL, ADC_CTRL_ENABLED);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
delay(10);
|
delay(10);
|
||||||
#endif
|
#endif
|
||||||
@ -167,10 +174,14 @@ static void adcDisable()
|
|||||||
#ifdef ADC_CTRL // disable adc voltage divider when we need to read
|
#ifdef ADC_CTRL // disable adc voltage divider when we need to read
|
||||||
#ifdef ADC_USE_PULLUP
|
#ifdef ADC_USE_PULLUP
|
||||||
pinMode(ADC_CTRL, INPUT_PULLDOWN);
|
pinMode(ADC_CTRL, INPUT_PULLDOWN);
|
||||||
|
#else
|
||||||
|
#ifdef HELTEC_V3
|
||||||
|
pinMode(ADC_CTRL, ANALOG);
|
||||||
#else
|
#else
|
||||||
digitalWrite(ADC_CTRL, !ADC_CTRL_ENABLED);
|
digitalWrite(ADC_CTRL, !ADC_CTRL_ENABLED);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -421,7 +421,7 @@ bool GPS::setup()
|
|||||||
if (tx_gpio && gnssModel == GNSS_MODEL_UNKNOWN) {
|
if (tx_gpio && gnssModel == GNSS_MODEL_UNKNOWN) {
|
||||||
|
|
||||||
// if GPS_BAUDRATE is specified in variant (i.e. not 9600), skip to the specified rate.
|
// if GPS_BAUDRATE is specified in variant (i.e. not 9600), skip to the specified rate.
|
||||||
if (speedSelect == 0 && GPS_BAUDRATE != serialSpeeds[speedSelect]) {
|
if (speedSelect == 0 && probeTries == 2 && GPS_BAUDRATE != serialSpeeds[speedSelect]) {
|
||||||
speedSelect = std::find(serialSpeeds, std::end(serialSpeeds), GPS_BAUDRATE) - serialSpeeds;
|
speedSelect = std::find(serialSpeeds, std::end(serialSpeeds), GPS_BAUDRATE) - serialSpeeds;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -431,7 +431,7 @@ bool GPS::setup()
|
|||||||
if (++speedSelect == sizeof(serialSpeeds) / sizeof(int)) {
|
if (++speedSelect == sizeof(serialSpeeds) / sizeof(int)) {
|
||||||
speedSelect = 0;
|
speedSelect = 0;
|
||||||
if (--probeTries == 0) {
|
if (--probeTries == 0) {
|
||||||
LOG_WARN("Giving up on GPS probe and setting to 9600.");
|
LOG_WARN("Giving up on GPS probe and setting to %d", GPS_BAUDRATE);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ class GPS : private concurrency::OSThread
|
|||||||
uint8_t fixType = 0; // fix type from GPGSA
|
uint8_t fixType = 0; // fix type from GPGSA
|
||||||
#endif
|
#endif
|
||||||
private:
|
private:
|
||||||
const int serialSpeeds[6] = {9600, 115200, 38400, 4800, 57600, 9600};
|
const int serialSpeeds[6] = {9600, 115200, 38400, 4800, 57600, GPS_BAUDRATE};
|
||||||
uint32_t lastWakeStartMsec = 0, lastSleepStartMsec = 0, lastFixStartMsec = 0;
|
uint32_t lastWakeStartMsec = 0, lastSleepStartMsec = 0, lastFixStartMsec = 0;
|
||||||
uint32_t rx_gpio = 0;
|
uint32_t rx_gpio = 0;
|
||||||
uint32_t tx_gpio = 0;
|
uint32_t tx_gpio = 0;
|
||||||
|
@ -137,11 +137,12 @@ NodeDB::NodeDB()
|
|||||||
memcpy(myNodeInfo.device_id.bytes, &device_id_start, sizeof(device_id_start));
|
memcpy(myNodeInfo.device_id.bytes, &device_id_start, sizeof(device_id_start));
|
||||||
memcpy(myNodeInfo.device_id.bytes + sizeof(device_id_start), &device_id_end, sizeof(device_id_end));
|
memcpy(myNodeInfo.device_id.bytes + sizeof(device_id_start), &device_id_end, sizeof(device_id_end));
|
||||||
myNodeInfo.device_id.size = 16;
|
myNodeInfo.device_id.size = 16;
|
||||||
hasUniqueId = true;
|
// Uncomment below to print the device id
|
||||||
|
// hasUniqueId = true;
|
||||||
#else
|
#else
|
||||||
// FIXME - implement for other platforms
|
// FIXME - implement for other platforms
|
||||||
#endif
|
#endif
|
||||||
// Uncomment below to print the device id
|
|
||||||
// if (hasUniqueId) {
|
// if (hasUniqueId) {
|
||||||
// std::string deviceIdHex;
|
// std::string deviceIdHex;
|
||||||
// for (size_t i = 0; i < myNodeInfo.device_id.size; ++i) {
|
// for (size_t i = 0; i < myNodeInfo.device_id.size; ++i) {
|
||||||
|
@ -282,11 +282,14 @@ void RadioLibInterface::onNotify(uint32_t notification)
|
|||||||
// Send any outgoing packets we have ready
|
// Send any outgoing packets we have ready
|
||||||
meshtastic_MeshPacket *txp = txQueue.dequeue();
|
meshtastic_MeshPacket *txp = txQueue.dequeue();
|
||||||
assert(txp);
|
assert(txp);
|
||||||
|
bool isLoraTx = txp->to != NODENUM_BROADCAST_NO_LORA;
|
||||||
startSend(txp);
|
startSend(txp);
|
||||||
|
|
||||||
// Packet has been sent, count it toward our TX airtime utilization.
|
if (isLoraTx) {
|
||||||
uint32_t xmitMsec = getPacketTime(txp);
|
// Packet has been sent, count it toward our TX airtime utilization.
|
||||||
airTime->logAirtime(TX_LOG, xmitMsec);
|
uint32_t xmitMsec = getPacketTime(txp);
|
||||||
|
airTime->logAirtime(TX_LOG, xmitMsec);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -81,14 +81,17 @@ int32_t Router::runOnce()
|
|||||||
*/
|
*/
|
||||||
void Router::enqueueReceivedMessage(meshtastic_MeshPacket *p)
|
void Router::enqueueReceivedMessage(meshtastic_MeshPacket *p)
|
||||||
{
|
{
|
||||||
if (fromRadioQueue.enqueue(p, 0)) { // NOWAIT - fixme, if queue is full, delete older messages
|
// Try enqueue until successful
|
||||||
|
while (!fromRadioQueue.enqueue(p, 0)) {
|
||||||
// Nasty hack because our threading is primitive. interfaces shouldn't need to know about routers FIXME
|
meshtastic_MeshPacket *old_p;
|
||||||
setReceivedMessage();
|
old_p = fromRadioQueue.dequeuePtr(0); // Dequeue and discard the oldest packet
|
||||||
} else {
|
if (old_p) {
|
||||||
printPacket("BUG! fromRadioQueue is full! Discarding!", p);
|
printPacket("fromRadioQ full, drop oldest!", old_p);
|
||||||
packetPool.release(p);
|
packetPool.release(old_p);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// Nasty hack because our threading is primitive. interfaces shouldn't need to know about routers FIXME
|
||||||
|
setReceivedMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Generate a unique packet id
|
/// Generate a unique packet id
|
||||||
|
@ -121,9 +121,7 @@ Will be used for broadcast.
|
|||||||
*/
|
*/
|
||||||
int32_t NeighborInfoModule::runOnce()
|
int32_t NeighborInfoModule::runOnce()
|
||||||
{
|
{
|
||||||
if (airTime->isTxAllowedChannelUtil(true) && airTime->isTxAllowedAirUtil()) {
|
sendNeighborInfo(NODENUM_BROADCAST_NO_LORA, false);
|
||||||
sendNeighborInfo(NODENUM_BROADCAST_NO_LORA, false);
|
|
||||||
}
|
|
||||||
return Default::getConfiguredOrDefaultMs(moduleConfig.neighbor_info.update_interval, default_neighbor_info_broadcast_secs);
|
return Default::getConfiguredOrDefaultMs(moduleConfig.neighbor_info.update_interval, default_neighbor_info_broadcast_secs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,11 @@ void updateBatteryLevel(uint8_t level) {}
|
|||||||
|
|
||||||
void getMacAddr(uint8_t *dmac)
|
void getMacAddr(uint8_t *dmac)
|
||||||
{
|
{
|
||||||
|
#if defined(CONFIG_IDF_TARGET_ESP32C6) && defined(CONFIG_SOC_IEEE802154_SUPPORTED)
|
||||||
|
assert(esp_base_mac_addr_get(dmac) == ESP_OK);
|
||||||
|
#else
|
||||||
assert(esp_efuse_mac_get_default(dmac) == ESP_OK);
|
assert(esp_efuse_mac_get_default(dmac) == ESP_OK);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAS_32768HZ
|
#ifdef HAS_32768HZ
|
||||||
|
@ -19,4 +19,3 @@ static const uint8_t MOSI = 38;
|
|||||||
static const uint8_t SS = 17;
|
static const uint8_t SS = 17;
|
||||||
|
|
||||||
#endif /* Pins_Arduino_h */
|
#endif /* Pins_Arduino_h */
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
[VERSION]
|
[VERSION]
|
||||||
major = 2
|
major = 2
|
||||||
minor = 5
|
minor = 5
|
||||||
build = 9
|
build = 10
|
||||||
|
Loading…
Reference in New Issue
Block a user