mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-05 05:04:46 +00:00
Merge branch 'master' into CannedMessagePlugin
This commit is contained in:
commit
38dd5612fd
@ -11,7 +11,7 @@ Usage: $(basename $0) [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME|FILENAME]
|
|||||||
Flash image file to device, but first erasing and writing system information"
|
Flash image file to device, but first erasing and writing system information"
|
||||||
|
|
||||||
-h Display this help and exit
|
-h Display this help and exit
|
||||||
-p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerrous).
|
-p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerous).
|
||||||
-P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: "$PYTHON")
|
-P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: "$PYTHON")
|
||||||
-f FILENAME The .bin file to flash. Custom to your device type and region.
|
-f FILENAME The .bin file to flash. Custom to your device type and region.
|
||||||
EOF
|
EOF
|
||||||
@ -44,12 +44,15 @@ shift "$((OPTIND-1))"
|
|||||||
shift
|
shift
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# check that esptool is installed
|
||||||
|
"$PYTHON" -m esptool -h >/dev/null 2>&1 || echo "Error: esptool was not found."; exit 1
|
||||||
|
|
||||||
if [ -f "${FILENAME}" ]; then
|
if [ -f "${FILENAME}" ]; then
|
||||||
echo "Trying to flash ${FILENAME}, but first erasing and writing system information"
|
echo "Trying to flash ${FILENAME}, but first erasing and writing system information"
|
||||||
$PYTHON -m esptool erase_flash
|
"$PYTHON" -m esptool erase_flash
|
||||||
$PYTHON -m esptool write_flash 0x1000 system-info.bin
|
"$PYTHON" -m esptool write_flash 0x1000 system-info.bin
|
||||||
$PYTHON -m esptool write_flash 0x00390000 spiffs-*.bin
|
"$PYTHON" -m esptool write_flash 0x00390000 spiffs-*.bin
|
||||||
$PYTHON -m esptool write_flash 0x10000 ${FILENAME}
|
"$PYTHON" -m esptool write_flash 0x10000 ${FILENAME}
|
||||||
else
|
else
|
||||||
echo "Invalid file: ${FILENAME}"
|
echo "Invalid file: ${FILENAME}"
|
||||||
show_help
|
show_help
|
||||||
|
@ -46,8 +46,8 @@ void AirTime::airtimeRotatePeriod()
|
|||||||
this->airtimes.periodRX[i + 1] = this->airtimes.periodRX[i];
|
this->airtimes.periodRX[i + 1] = this->airtimes.periodRX[i];
|
||||||
this->airtimes.periodRX_ALL[i + 1] = this->airtimes.periodRX_ALL[i];
|
this->airtimes.periodRX_ALL[i + 1] = this->airtimes.periodRX_ALL[i];
|
||||||
|
|
||||||
myNodeInfo.air_period_tx[i + 1] = myNodeInfo.air_period_tx[i];
|
myNodeInfo.air_period_tx[i + 1] = this->airtimes.periodTX[i];
|
||||||
myNodeInfo.air_period_rx[i + 1] = myNodeInfo.air_period_rx[i];
|
myNodeInfo.air_period_rx[i + 1] = this->airtimes.periodRX[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
this->airtimes.periodTX[0] = 0;
|
this->airtimes.periodTX[0] = 0;
|
||||||
@ -111,10 +111,21 @@ int32_t AirTime::runOnce()
|
|||||||
if (firstTime) {
|
if (firstTime) {
|
||||||
airtimeRotatePeriod();
|
airtimeRotatePeriod();
|
||||||
|
|
||||||
|
// Init channelUtilization window to all 0
|
||||||
for (uint32_t i = 0; i < CHANNEL_UTILIZATION_PERIODS; i++) {
|
for (uint32_t i = 0; i < CHANNEL_UTILIZATION_PERIODS; i++) {
|
||||||
this->channelUtilization[i] = 0;
|
this->channelUtilization[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Init airtime windows to all 0
|
||||||
|
for (int i = 0; i < PERIODS_TO_LOG; i++) {
|
||||||
|
this->airtimes.periodTX[i] = 0;
|
||||||
|
this->airtimes.periodRX[i] = 0;
|
||||||
|
this->airtimes.periodRX_ALL[i] = 0;
|
||||||
|
|
||||||
|
//myNodeInfo.air_period_tx[i] = 0;
|
||||||
|
//myNodeInfo.air_period_rx[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
firstTime = false;
|
firstTime = false;
|
||||||
lastUtilPeriod = utilPeriod;
|
lastUtilPeriod = utilPeriod;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user