mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-08 14:12:05 +00:00
Merge branch 'master' into big-brain-baud-bash
This commit is contained in:
commit
fd19200c0f
@ -1 +1 @@
|
|||||||
Subproject commit 807236815d61cc0ebd89472c2a2aa76758bc92ac
|
Subproject commit 015202aead5f6807d63537c58f4cb6525f19e56f
|
@ -59,7 +59,7 @@ int32_t ScanAndSelectInput::runOnce()
|
|||||||
// If: "no messages added" alert screen currently shown
|
// If: "no messages added" alert screen currently shown
|
||||||
if (alertingNoMessage) {
|
if (alertingNoMessage) {
|
||||||
// Dismiss the alert screen several seconds after it appears
|
// Dismiss the alert screen several seconds after it appears
|
||||||
if (now > alertingSinceMs + durationAlertMs) {
|
if (!Throttle::isWithinTimespanMs(alertingSinceMs, durationAlertMs)) {
|
||||||
alertingNoMessage = false;
|
alertingNoMessage = false;
|
||||||
screen->endAlert();
|
screen->endAlert();
|
||||||
}
|
}
|
||||||
@ -74,9 +74,9 @@ int32_t ScanAndSelectInput::runOnce()
|
|||||||
|
|
||||||
// Existing press
|
// Existing press
|
||||||
else {
|
else {
|
||||||
// Duration enough for long press
|
// Longer than shortpress window
|
||||||
// Long press not yet fired (prevent repeat firing while held)
|
// Long press not yet fired (prevent repeat firing while held)
|
||||||
if (!longPressFired && Throttle::isWithinTimespanMs(downSinceMs, durationLongMs)) {
|
if (!longPressFired && !Throttle::isWithinTimespanMs(downSinceMs, durationLongMs)) {
|
||||||
longPressFired = true;
|
longPressFired = true;
|
||||||
longPress();
|
longPress();
|
||||||
}
|
}
|
||||||
@ -91,7 +91,9 @@ int32_t ScanAndSelectInput::runOnce()
|
|||||||
// Button newly released
|
// Button newly released
|
||||||
// Long press event didn't already fire
|
// Long press event didn't already fire
|
||||||
if (held && !longPressFired) {
|
if (held && !longPressFired) {
|
||||||
// Duration enough for short press
|
// Duration within shortpress window
|
||||||
|
// - longer than durationShortPress (debounce)
|
||||||
|
// - shorter than durationLongPress
|
||||||
if (!Throttle::isWithinTimespanMs(downSinceMs, durationShortMs)) {
|
if (!Throttle::isWithinTimespanMs(downSinceMs, durationShortMs)) {
|
||||||
shortPress();
|
shortPress();
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,10 @@
|
|||||||
#include <pb_decode.h>
|
#include <pb_decode.h>
|
||||||
#include <pb_encode.h>
|
#include <pb_encode.h>
|
||||||
|
|
||||||
|
#if ARCH_PORTDUINO
|
||||||
|
#include "PortduinoGlue.h"
|
||||||
|
#include "meshUtils.h"
|
||||||
|
#endif
|
||||||
void LockingArduinoHal::spiBeginTransaction()
|
void LockingArduinoHal::spiBeginTransaction()
|
||||||
{
|
{
|
||||||
spiLock->lock();
|
spiLock->lock();
|
||||||
@ -393,6 +397,11 @@ void RadioLibInterface::handleReceiveInterrupt()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int state = iface->readData((uint8_t *)&radioBuffer, length);
|
int state = iface->readData((uint8_t *)&radioBuffer, length);
|
||||||
|
#if ARCH_PORTDUINO
|
||||||
|
if (settingsMap[logoutputlevel] == level_trace) {
|
||||||
|
printBytes("Raw incoming packet: ", (uint8_t *)&radioBuffer, length);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (state != RADIOLIB_ERR_NONE) {
|
if (state != RADIOLIB_ERR_NONE) {
|
||||||
LOG_ERROR("ignoring received packet due to error=%d", state);
|
LOG_ERROR("ignoring received packet due to error=%d", state);
|
||||||
rxBad++;
|
rxBad++;
|
||||||
|
@ -408,7 +408,7 @@ typedef enum _meshtastic_LogRecord_Level {
|
|||||||
} meshtastic_LogRecord_Level;
|
} meshtastic_LogRecord_Level;
|
||||||
|
|
||||||
/* Struct definitions */
|
/* Struct definitions */
|
||||||
/* a gps position */
|
/* A GPS Position */
|
||||||
typedef struct _meshtastic_Position {
|
typedef struct _meshtastic_Position {
|
||||||
/* The new preferred location encoding, multiply by 1e-7 to get degrees
|
/* The new preferred location encoding, multiply by 1e-7 to get degrees
|
||||||
in floating point */
|
in floating point */
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
#include "FSCommon.h"
|
#include "FSCommon.h"
|
||||||
#include "mesh-pb-constants.h"
|
#include "mesh-pb-constants.h"
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <assert.h>
|
|
||||||
#include <pb_decode.h>
|
#include <pb_decode.h>
|
||||||
#include <pb_encode.h>
|
#include <pb_encode.h>
|
||||||
|
|
||||||
@ -14,8 +13,6 @@ size_t pb_encode_to_bytes(uint8_t *destbuf, size_t destbufsize, const pb_msgdesc
|
|||||||
pb_ostream_t stream = pb_ostream_from_buffer(destbuf, destbufsize);
|
pb_ostream_t stream = pb_ostream_from_buffer(destbuf, destbufsize);
|
||||||
if (!pb_encode(&stream, fields, src_struct)) {
|
if (!pb_encode(&stream, fields, src_struct)) {
|
||||||
LOG_ERROR("Panic: can't encode protobuf reason='%s'", PB_GET_ERROR(&stream));
|
LOG_ERROR("Panic: can't encode protobuf reason='%s'", PB_GET_ERROR(&stream));
|
||||||
assert(
|
|
||||||
0); // If this assert fails it probably means you made a field too large for the max limits specified in mesh.options
|
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return stream.bytes_written;
|
return stream.bytes_written;
|
||||||
@ -71,4 +68,4 @@ bool is_in_helper(uint32_t n, const uint32_t *array, pb_size_t count)
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -61,15 +61,13 @@ char *strnstr(const char *s, const char *find, size_t slen)
|
|||||||
void printBytes(const char *label, const uint8_t *p, size_t numbytes)
|
void printBytes(const char *label, const uint8_t *p, size_t numbytes)
|
||||||
{
|
{
|
||||||
int labelSize = strlen(label);
|
int labelSize = strlen(label);
|
||||||
if (labelSize < 100 && numbytes < 64) {
|
char *messageBuffer = new char[labelSize + (numbytes * 3) + 2];
|
||||||
char *messageBuffer = new char[labelSize + (numbytes * 3) + 2];
|
strncpy(messageBuffer, label, labelSize);
|
||||||
strncpy(messageBuffer, label, labelSize);
|
for (size_t i = 0; i < numbytes; i++)
|
||||||
for (size_t i = 0; i < numbytes; i++)
|
snprintf(messageBuffer + labelSize + i * 3, 4, " %02x", p[i]);
|
||||||
snprintf(messageBuffer + labelSize + i * 3, 4, " %02x", p[i]);
|
strcpy(messageBuffer + labelSize + numbytes * 3, "\n");
|
||||||
strcpy(messageBuffer + labelSize + numbytes * 3, "\n");
|
LOG_DEBUG(messageBuffer);
|
||||||
LOG_DEBUG(messageBuffer);
|
delete[] messageBuffer;
|
||||||
delete[] messageBuffer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool memfll(const uint8_t *mem, uint8_t find, size_t numbytes)
|
bool memfll(const uint8_t *mem, uint8_t find, size_t numbytes)
|
||||||
|
Loading…
Reference in New Issue
Block a user