mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Merge branch 'meshcore-dev:dev' into dev
This commit is contained in:
commit
f822d067a3
12 changed files with 74 additions and 23 deletions
55
build.sh
55
build.sh
|
|
@ -64,6 +64,8 @@ case $1 in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# cache project config json for use in get_platform_for_env()
|
||||||
|
PIO_CONFIG_JSON=$(pio project config --json-output)
|
||||||
|
|
||||||
# $1 should be the string to find (case insensitive)
|
# $1 should be the string to find (case insensitive)
|
||||||
get_pio_envs_containing_string() {
|
get_pio_envs_containing_string() {
|
||||||
|
|
@ -87,6 +89,25 @@ get_pio_envs_ending_with_string() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# get platform flag for a given environment
|
||||||
|
# $1 should be the environment name
|
||||||
|
get_platform_for_env() {
|
||||||
|
local env_name=$1
|
||||||
|
echo "$PIO_CONFIG_JSON" | python3 -c "
|
||||||
|
import sys, json, re
|
||||||
|
data = json.load(sys.stdin)
|
||||||
|
for section, options in data:
|
||||||
|
if section == 'env:$env_name':
|
||||||
|
for key, value in options:
|
||||||
|
if key == 'build_flags':
|
||||||
|
for flag in value:
|
||||||
|
match = re.search(r'(ESP32_PLATFORM|NRF52_PLATFORM|STM32_PLATFORM|RP2040_PLATFORM)', flag)
|
||||||
|
if match:
|
||||||
|
print(match.group(1))
|
||||||
|
sys.exit(0)
|
||||||
|
"
|
||||||
|
}
|
||||||
|
|
||||||
# disable all debug logging flags if DISABLE_DEBUG=1 is set
|
# disable all debug logging flags if DISABLE_DEBUG=1 is set
|
||||||
disable_debug_flags() {
|
disable_debug_flags() {
|
||||||
if [ "$DISABLE_DEBUG" == "1" ]; then
|
if [ "$DISABLE_DEBUG" == "1" ]; then
|
||||||
|
|
@ -96,6 +117,8 @@ disable_debug_flags() {
|
||||||
|
|
||||||
# build firmware for the provided pio env in $1
|
# build firmware for the provided pio env in $1
|
||||||
build_firmware() {
|
build_firmware() {
|
||||||
|
# get env platform for post build actions
|
||||||
|
ENV_PLATFORM=($(get_platform_for_env $1))
|
||||||
|
|
||||||
# get git commit sha
|
# get git commit sha
|
||||||
COMMIT_HASH=$(git rev-parse --short HEAD)
|
COMMIT_HASH=$(git rev-parse --short HEAD)
|
||||||
|
|
@ -126,27 +149,31 @@ build_firmware() {
|
||||||
# build firmware target
|
# build firmware target
|
||||||
pio run -e $1
|
pio run -e $1
|
||||||
|
|
||||||
# build merge-bin for esp32 fresh install
|
# build merge-bin for esp32 fresh install, copy .bins to out folder (e.g: Heltec_v3_room_server-v1.0.0-SHA.bin)
|
||||||
if [ -f .pio/build/$1/firmware.bin ]; then
|
if [ "$ENV_PLATFORM" == "ESP32_PLATFORM" ]; then
|
||||||
pio run -t mergebin -e $1
|
pio run -t mergebin -e $1
|
||||||
|
cp .pio/build/$1/firmware.bin out/${FIRMWARE_FILENAME}.bin 2>/dev/null || true
|
||||||
|
cp .pio/build/$1/firmware-merged.bin out/${FIRMWARE_FILENAME}-merged.bin 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# build .uf2 for nrf52 boards
|
# build .uf2 for nrf52 boards, copy .uf2 and .zip to out folder (e.g: RAK_4631_Repeater-v1.0.0-SHA.uf2)
|
||||||
if [[ -f .pio/build/$1/firmware.zip && -f .pio/build/$1/firmware.hex ]]; then
|
if [ "$ENV_PLATFORM" == "NRF52_PLATFORM" ]; then
|
||||||
python3 bin/uf2conv/uf2conv.py .pio/build/$1/firmware.hex -c -o .pio/build/$1/firmware.uf2 -f 0xADA52840
|
python3 bin/uf2conv/uf2conv.py .pio/build/$1/firmware.hex -c -o .pio/build/$1/firmware.uf2 -f 0xADA52840
|
||||||
|
cp .pio/build/$1/firmware.uf2 out/${FIRMWARE_FILENAME}.uf2 2>/dev/null || true
|
||||||
|
cp .pio/build/$1/firmware.zip out/${FIRMWARE_FILENAME}.zip 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# copy .bin, .uf2, and .zip to out folder
|
# for stm32, copy .bin and .hex to out folder
|
||||||
# e.g: Heltec_v3_room_server-v1.0.0-SHA.bin
|
if [ "$ENV_PLATFORM" == "STM32_PLATFORM" ]; then
|
||||||
# e.g: RAK_4631_Repeater-v1.0.0-SHA.uf2
|
cp .pio/build/$1/firmware.bin out/${FIRMWARE_FILENAME}.bin 2>/dev/null || true
|
||||||
|
cp .pio/build/$1/firmware.hex out/${FIRMWARE_FILENAME}.hex 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
# copy .bin for esp32 boards
|
# for rp2040, copy .bin and .uf2 to out folder
|
||||||
cp .pio/build/$1/firmware.bin out/${FIRMWARE_FILENAME}.bin 2>/dev/null || true
|
if [ "$ENV_PLATFORM" == "RP2040_PLATFORM" ]; then
|
||||||
cp .pio/build/$1/firmware-merged.bin out/${FIRMWARE_FILENAME}-merged.bin 2>/dev/null || true
|
cp .pio/build/$1/firmware.bin out/${FIRMWARE_FILENAME}.bin 2>/dev/null || true
|
||||||
|
cp .pio/build/$1/firmware.uf2 out/${FIRMWARE_FILENAME}.uf2 2>/dev/null || true
|
||||||
# copy .zip and .uf2 of nrf52 boards
|
fi
|
||||||
cp .pio/build/$1/firmware.uf2 out/${FIRMWARE_FILENAME}.uf2 2>/dev/null || true
|
|
||||||
cp .pio/build/$1/firmware.zip out/${FIRMWARE_FILENAME}.zip 2>/dev/null || true
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,11 @@
|
||||||
#define FIRMWARE_VER_CODE 9
|
#define FIRMWARE_VER_CODE 9
|
||||||
|
|
||||||
#ifndef FIRMWARE_BUILD_DATE
|
#ifndef FIRMWARE_BUILD_DATE
|
||||||
#define FIRMWARE_BUILD_DATE "29 Jan 2026"
|
#define FIRMWARE_BUILD_DATE "15 Feb 2026"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FIRMWARE_VERSION
|
#ifndef FIRMWARE_VERSION
|
||||||
#define FIRMWARE_VERSION "v1.12.0"
|
#define FIRMWARE_VERSION "v1.13.0"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
|
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
|
||||||
|
|
|
||||||
|
|
@ -151,6 +151,14 @@ class HomeScreen : public UIScreen {
|
||||||
// fill the battery based on the percentage
|
// fill the battery based on the percentage
|
||||||
int fillWidth = (batteryPercentage * (iconWidth - 4)) / 100;
|
int fillWidth = (batteryPercentage * (iconWidth - 4)) / 100;
|
||||||
display.fillRect(iconX + 2, iconY + 2, fillWidth, iconHeight - 4);
|
display.fillRect(iconX + 2, iconY + 2, fillWidth, iconHeight - 4);
|
||||||
|
|
||||||
|
// show muted icon if buzzer is muted
|
||||||
|
#ifdef PIN_BUZZER
|
||||||
|
if (_task->isBuzzerQuiet()) {
|
||||||
|
display.setColor(DisplayDriver::RED);
|
||||||
|
display.drawXbm(iconX - 9, iconY + 1, muted_icon, 8, 8);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
CayenneLPP sensors_lpp;
|
CayenneLPP sensors_lpp;
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,14 @@ public:
|
||||||
bool hasDisplay() const { return _display != NULL; }
|
bool hasDisplay() const { return _display != NULL; }
|
||||||
bool isButtonPressed() const;
|
bool isButtonPressed() const;
|
||||||
|
|
||||||
|
bool isBuzzerQuiet() {
|
||||||
|
#ifdef PIN_BUZZER
|
||||||
|
return buzzer.isQuiet();
|
||||||
|
#else
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void toggleBuzzer();
|
void toggleBuzzer();
|
||||||
bool getGPSState();
|
bool getGPSState();
|
||||||
void toggleGPS();
|
void toggleGPS();
|
||||||
|
|
|
||||||
|
|
@ -116,3 +116,7 @@ static const uint8_t advert_icon[] = {
|
||||||
0x04, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x04, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const uint8_t muted_icon[] = {
|
||||||
|
0x20, 0x6a, 0xea, 0xe4, 0xe4, 0xea, 0x6a, 0x20
|
||||||
|
};
|
||||||
|
|
@ -69,11 +69,11 @@ struct NeighbourInfo {
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef FIRMWARE_BUILD_DATE
|
#ifndef FIRMWARE_BUILD_DATE
|
||||||
#define FIRMWARE_BUILD_DATE "29 Jan 2026"
|
#define FIRMWARE_BUILD_DATE "15 Feb 2026"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FIRMWARE_VERSION
|
#ifndef FIRMWARE_VERSION
|
||||||
#define FIRMWARE_VERSION "v1.12.0"
|
#define FIRMWARE_VERSION "v1.13.0"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define FIRMWARE_ROLE "repeater"
|
#define FIRMWARE_ROLE "repeater"
|
||||||
|
|
|
||||||
|
|
@ -26,11 +26,11 @@
|
||||||
/* ------------------------------ Config -------------------------------- */
|
/* ------------------------------ Config -------------------------------- */
|
||||||
|
|
||||||
#ifndef FIRMWARE_BUILD_DATE
|
#ifndef FIRMWARE_BUILD_DATE
|
||||||
#define FIRMWARE_BUILD_DATE "29 Jan 2026"
|
#define FIRMWARE_BUILD_DATE "15 Feb 2026"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FIRMWARE_VERSION
|
#ifndef FIRMWARE_VERSION
|
||||||
#define FIRMWARE_VERSION "v1.12.0"
|
#define FIRMWARE_VERSION "v1.13.0"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef LORA_FREQ
|
#ifndef LORA_FREQ
|
||||||
|
|
|
||||||
|
|
@ -33,11 +33,11 @@
|
||||||
#define PERM_RECV_ALERTS_HI (1 << 7) // high priority alerts
|
#define PERM_RECV_ALERTS_HI (1 << 7) // high priority alerts
|
||||||
|
|
||||||
#ifndef FIRMWARE_BUILD_DATE
|
#ifndef FIRMWARE_BUILD_DATE
|
||||||
#define FIRMWARE_BUILD_DATE "29 Jan 2026"
|
#define FIRMWARE_BUILD_DATE "15 Feb 2026"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FIRMWARE_VERSION
|
#ifndef FIRMWARE_VERSION
|
||||||
#define FIRMWARE_VERSION "v1.12.0"
|
#define FIRMWARE_VERSION "v1.13.0"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define FIRMWARE_ROLE "sensor"
|
#define FIRMWARE_ROLE "sensor"
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@ platform = platformio/espressif32@6.11.0
|
||||||
monitor_filters = esp32_exception_decoder
|
monitor_filters = esp32_exception_decoder
|
||||||
extra_scripts = merge-bin.py
|
extra_scripts = merge-bin.py
|
||||||
build_flags = ${arduino_base.build_flags}
|
build_flags = ${arduino_base.build_flags}
|
||||||
|
-D ESP32_PLATFORM
|
||||||
; -D ESP32_CPU_FREQ=80 ; change it to your need
|
; -D ESP32_CPU_FREQ=80 ; change it to your need
|
||||||
build_src_filter = ${arduino_base.build_src_filter}
|
build_src_filter = ${arduino_base.build_src_filter}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#include "SerialBLEInterface.h"
|
#include "SerialBLEInterface.h"
|
||||||
|
#include "esp_mac.h"
|
||||||
|
|
||||||
// See the following for generating UUIDs:
|
// See the following for generating UUIDs:
|
||||||
// https://www.uuidgenerator.net/
|
// https://www.uuidgenerator.net/
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ board_build.partitions = min_spiffs.csv ; get around 4mb flash limit
|
||||||
build_flags =
|
build_flags =
|
||||||
${esp32c6_base.build_flags}
|
${esp32c6_base.build_flags}
|
||||||
${sensor_base.build_flags}
|
${sensor_base.build_flags}
|
||||||
-I variants/M5Stack_Unit_C6L
|
-I variants/m5stack_unit_c6l
|
||||||
-D P_LORA_TX_LED=15
|
-D P_LORA_TX_LED=15
|
||||||
-D P_LORA_SCLK=20
|
-D P_LORA_SCLK=20
|
||||||
-D P_LORA_MISO=22
|
-D P_LORA_MISO=22
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,8 @@ build_flags = ${WioTrackerL1.build_flags}
|
||||||
-D PIN_BUZZER=12
|
-D PIN_BUZZER=12
|
||||||
-D QSPIFLASH=1
|
-D QSPIFLASH=1
|
||||||
-D ADVERT_NAME='"@@MAC"'
|
-D ADVERT_NAME='"@@MAC"'
|
||||||
|
-D ENV_PIN_SDA=PIN_WIRE1_SDA
|
||||||
|
-D ENV_PIN_SCL=PIN_WIRE1_SCL
|
||||||
; -D MESH_PACKET_LOGGING=1
|
; -D MESH_PACKET_LOGGING=1
|
||||||
; -D MESH_DEBUG=1
|
; -D MESH_DEBUG=1
|
||||||
build_src_filter = ${WioTrackerL1.build_src_filter}
|
build_src_filter = ${WioTrackerL1.build_src_filter}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue