mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-12 14:05:58 +00:00
Merge branch 'master' into master
This commit is contained in:
commit
9b0f08db3e
@ -27,5 +27,4 @@ rm -r $OUTDIR/* || true
|
|||||||
platformio pkg update --environment native || platformioFailed
|
platformio pkg update --environment native || platformioFailed
|
||||||
pio run --environment native || platformioFailed
|
pio run --environment native || platformioFailed
|
||||||
cp .pio/build/native/program "$OUTDIR/meshtasticd_linux_$(uname -m)"
|
cp .pio/build/native/program "$OUTDIR/meshtasticd_linux_$(uname -m)"
|
||||||
cp bin/device-install.* $OUTDIR
|
cp bin/native-install.* $OUTDIR
|
||||||
cp bin/device-update.* $OUTDIR
|
|
||||||
|
1
release/latest/.gitignore
vendored
1
release/latest/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
curfirmwareversion.xml
|
|
@ -64,7 +64,7 @@ class AudioThread : public concurrency::OSThread
|
|||||||
void initOutput()
|
void initOutput()
|
||||||
{
|
{
|
||||||
audioOut = new AudioOutputI2S(1, AudioOutputI2S::EXTERNAL_I2S);
|
audioOut = new AudioOutputI2S(1, AudioOutputI2S::EXTERNAL_I2S);
|
||||||
audioOut->SetPinout(DAC_I2S_BCK, DAC_I2S_WS, DAC_I2S_DOUT);
|
audioOut->SetPinout(DAC_I2S_BCK, DAC_I2S_WS, DAC_I2S_DOUT, DAC_I2S_MCLK);
|
||||||
audioOut->SetGain(0.2);
|
audioOut->SetGain(0.2);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
196
src/gps/GPS.h
196
src/gps/GPS.h
@ -64,6 +64,95 @@ const char *getDOPString(uint32_t dop);
|
|||||||
*/
|
*/
|
||||||
class GPS : private concurrency::OSThread
|
class GPS : private concurrency::OSThread
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
meshtastic_Position p = meshtastic_Position_init_default;
|
||||||
|
|
||||||
|
/** This is normally bound to config.position.gps_en_gpio but some rare boards (like heltec tracker) need more advanced
|
||||||
|
* implementations. Those boards will set this public variable to a custom implementation.
|
||||||
|
*
|
||||||
|
* Normally set by GPS::createGPS()
|
||||||
|
*/
|
||||||
|
GpioVirtPin *enablePin = NULL;
|
||||||
|
|
||||||
|
virtual ~GPS();
|
||||||
|
|
||||||
|
/** We will notify this observable anytime GPS state has changed meaningfully */
|
||||||
|
Observable<const meshtastic::GPSStatus *> newStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if we succeeded
|
||||||
|
*/
|
||||||
|
virtual bool setup();
|
||||||
|
|
||||||
|
// re-enable the thread
|
||||||
|
void enable();
|
||||||
|
|
||||||
|
// Disable the thread
|
||||||
|
int32_t disable() override;
|
||||||
|
|
||||||
|
// toggle between enabled/disabled
|
||||||
|
void toggleGpsMode();
|
||||||
|
|
||||||
|
// Change the power state of the GPS - for power saving / shutdown
|
||||||
|
void setPowerState(GPSPowerState newState, uint32_t sleepMs = 0);
|
||||||
|
|
||||||
|
/// Returns true if we have acquired GPS lock.
|
||||||
|
virtual bool hasLock();
|
||||||
|
|
||||||
|
/// Returns true if there's valid data flow with the chip.
|
||||||
|
virtual bool hasFlow();
|
||||||
|
|
||||||
|
/// Return true if we are connected to a GPS
|
||||||
|
bool isConnected() const { return hasGPS; }
|
||||||
|
|
||||||
|
bool isPowerSaving() const { return config.position.gps_mode != meshtastic_Config_PositionConfig_GpsMode_ENABLED; }
|
||||||
|
|
||||||
|
// Empty the input buffer as quickly as possible
|
||||||
|
void clearBuffer();
|
||||||
|
|
||||||
|
virtual bool factoryReset();
|
||||||
|
|
||||||
|
// Creates an instance of the GPS class.
|
||||||
|
// Returns the new instance or null if the GPS is not present.
|
||||||
|
static GPS *createGps();
|
||||||
|
|
||||||
|
// Wake the GPS hardware - ready for an update
|
||||||
|
void up();
|
||||||
|
|
||||||
|
// Let the GPS hardware save power between updates
|
||||||
|
void down();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/// Record that we have a GPS
|
||||||
|
void setConnected();
|
||||||
|
|
||||||
|
/** Subclasses should look for serial rx characters here and feed it to their GPS parser
|
||||||
|
*
|
||||||
|
* Return true if we received a valid message from the GPS
|
||||||
|
*/
|
||||||
|
virtual bool whileActive();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Perform any processing that should be done only while the GPS is awake and looking for a fix.
|
||||||
|
* Override this method to check for new locations
|
||||||
|
*
|
||||||
|
* @return true if we've acquired a time
|
||||||
|
*/
|
||||||
|
virtual bool lookForTime();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Perform any processing that should be done only while the GPS is awake and looking for a fix.
|
||||||
|
* Override this method to check for new locations
|
||||||
|
*
|
||||||
|
* @return true if we've acquired a new location
|
||||||
|
*/
|
||||||
|
virtual bool lookForLocation();
|
||||||
|
|
||||||
|
GnssModel_t gnssModel = GNSS_MODEL_UNKNOWN;
|
||||||
|
|
||||||
|
private:
|
||||||
|
GPS() : concurrency::OSThread("GPS") {}
|
||||||
|
|
||||||
TinyGPSPlus reader;
|
TinyGPSPlus reader;
|
||||||
uint8_t fixQual = 0; // fix quality from GPGGA
|
uint8_t fixQual = 0; // fix quality from GPGGA
|
||||||
uint32_t lastChecksumFailCount = 0;
|
uint32_t lastChecksumFailCount = 0;
|
||||||
@ -75,7 +164,6 @@ class GPS : private concurrency::OSThread
|
|||||||
TinyGPSCustom gsapdop; // custom extract PDOP from GPGSA
|
TinyGPSCustom gsapdop; // custom extract PDOP from GPGSA
|
||||||
uint8_t fixType = 0; // fix type from GPGSA
|
uint8_t fixType = 0; // fix type from GPGSA
|
||||||
#endif
|
#endif
|
||||||
private:
|
|
||||||
#if GPS_BAUDRATE_FIXED
|
#if GPS_BAUDRATE_FIXED
|
||||||
// if GPS_BAUDRATE is specified in variant, only try that.
|
// if GPS_BAUDRATE is specified in variant, only try that.
|
||||||
const int serialSpeeds[1] = {GPS_BAUDRATE};
|
const int serialSpeeds[1] = {GPS_BAUDRATE};
|
||||||
@ -113,7 +201,6 @@ class GPS : private concurrency::OSThread
|
|||||||
|
|
||||||
CallbackObserver<GPS, void *> notifyDeepSleepObserver = CallbackObserver<GPS, void *>(this, &GPS::prepareDeepSleep);
|
CallbackObserver<GPS, void *> notifyDeepSleepObserver = CallbackObserver<GPS, void *>(this, &GPS::prepareDeepSleep);
|
||||||
|
|
||||||
public:
|
|
||||||
/** If !NULL we will use this serial port to construct our GPS */
|
/** If !NULL we will use this serial port to construct our GPS */
|
||||||
#if defined(ARCH_RP2040)
|
#if defined(ARCH_RP2040)
|
||||||
static SerialUART *_serial_gps;
|
static SerialUART *_serial_gps;
|
||||||
@ -167,53 +254,6 @@ class GPS : private concurrency::OSThread
|
|||||||
|
|
||||||
const char *ACK_SUCCESS_MESSAGE = "Get ack success!";
|
const char *ACK_SUCCESS_MESSAGE = "Get ack success!";
|
||||||
|
|
||||||
meshtastic_Position p = meshtastic_Position_init_default;
|
|
||||||
|
|
||||||
/** This is normally bound to config.position.gps_en_gpio but some rare boards (like heltec tracker) need more advanced
|
|
||||||
* implementations. Those boards will set this public variable to a custom implementation.
|
|
||||||
*
|
|
||||||
* Normally set by GPS::createGPS()
|
|
||||||
*/
|
|
||||||
GpioVirtPin *enablePin = NULL;
|
|
||||||
|
|
||||||
GPS() : concurrency::OSThread("GPS") {}
|
|
||||||
|
|
||||||
virtual ~GPS();
|
|
||||||
|
|
||||||
/** We will notify this observable anytime GPS state has changed meaningfully */
|
|
||||||
Observable<const meshtastic::GPSStatus *> newStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if we succeeded
|
|
||||||
*/
|
|
||||||
virtual bool setup();
|
|
||||||
|
|
||||||
// re-enable the thread
|
|
||||||
void enable();
|
|
||||||
|
|
||||||
// Disable the thread
|
|
||||||
int32_t disable() override;
|
|
||||||
|
|
||||||
// toggle between enabled/disabled
|
|
||||||
void toggleGpsMode();
|
|
||||||
|
|
||||||
// Change the power state of the GPS - for power saving / shutdown
|
|
||||||
void setPowerState(GPSPowerState newState, uint32_t sleepMs = 0);
|
|
||||||
|
|
||||||
/// Returns true if we have acquired GPS lock.
|
|
||||||
virtual bool hasLock();
|
|
||||||
|
|
||||||
/// Returns true if there's valid data flow with the chip.
|
|
||||||
virtual bool hasFlow();
|
|
||||||
|
|
||||||
/// Return true if we are connected to a GPS
|
|
||||||
bool isConnected() const { return hasGPS; }
|
|
||||||
|
|
||||||
bool isPowerSaving() const { return config.position.gps_mode != meshtastic_Config_PositionConfig_GpsMode_ENABLED; }
|
|
||||||
|
|
||||||
// Empty the input buffer as quickly as possible
|
|
||||||
void clearBuffer();
|
|
||||||
|
|
||||||
// Create a ublox packet for editing in memory
|
// Create a ublox packet for editing in memory
|
||||||
uint8_t makeUBXPacket(uint8_t class_id, uint8_t msg_id, uint8_t payload_size, const uint8_t *msg);
|
uint8_t makeUBXPacket(uint8_t class_id, uint8_t msg_id, uint8_t payload_size, const uint8_t *msg);
|
||||||
uint8_t makeCASPacket(uint8_t class_id, uint8_t msg_id, uint8_t payload_size, const uint8_t *msg);
|
uint8_t makeCASPacket(uint8_t class_id, uint8_t msg_id, uint8_t payload_size, const uint8_t *msg);
|
||||||
@ -229,59 +269,6 @@ class GPS : private concurrency::OSThread
|
|||||||
|
|
||||||
GPS_RESPONSE getACKCas(uint8_t class_id, uint8_t msg_id, uint32_t waitMillis);
|
GPS_RESPONSE getACKCas(uint8_t class_id, uint8_t msg_id, uint32_t waitMillis);
|
||||||
|
|
||||||
virtual bool factoryReset();
|
|
||||||
|
|
||||||
// Creates an instance of the GPS class.
|
|
||||||
// Returns the new instance or null if the GPS is not present.
|
|
||||||
static GPS *createGps();
|
|
||||||
|
|
||||||
// Wake the GPS hardware - ready for an update
|
|
||||||
void up();
|
|
||||||
|
|
||||||
// Let the GPS hardware save power between updates
|
|
||||||
void down();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/**
|
|
||||||
* Perform any processing that should be done only while the GPS is awake and looking for a fix.
|
|
||||||
* Override this method to check for new locations
|
|
||||||
*
|
|
||||||
* @return true if we've acquired a time
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Perform any processing that should be done only while the GPS is awake and looking for a fix.
|
|
||||||
* Override this method to check for new locations
|
|
||||||
*
|
|
||||||
* @return true if we've acquired a new location
|
|
||||||
*/
|
|
||||||
|
|
||||||
/// Record that we have a GPS
|
|
||||||
void setConnected();
|
|
||||||
|
|
||||||
/** Subclasses should look for serial rx characters here and feed it to their GPS parser
|
|
||||||
*
|
|
||||||
* Return true if we received a valid message from the GPS
|
|
||||||
*/
|
|
||||||
virtual bool whileActive();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Perform any processing that should be done only while the GPS is awake and looking for a fix.
|
|
||||||
* Override this method to check for new locations
|
|
||||||
*
|
|
||||||
* @return true if we've acquired a time
|
|
||||||
*/
|
|
||||||
virtual bool lookForTime();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Perform any processing that should be done only while the GPS is awake and looking for a fix.
|
|
||||||
* Override this method to check for new locations
|
|
||||||
*
|
|
||||||
* @return true if we've acquired a new location
|
|
||||||
*/
|
|
||||||
virtual bool lookForLocation();
|
|
||||||
|
|
||||||
private:
|
|
||||||
/// Prepare the GPS for the cpu entering deep sleep, expect to be gone for at least 100s of msecs
|
/// Prepare the GPS for the cpu entering deep sleep, expect to be gone for at least 100s of msecs
|
||||||
/// always returns 0 to indicate okay to sleep
|
/// always returns 0 to indicate okay to sleep
|
||||||
int prepareDeepSleep(void *unused);
|
int prepareDeepSleep(void *unused);
|
||||||
@ -320,10 +307,7 @@ class GPS : private concurrency::OSThread
|
|||||||
uint8_t fixeddelayCtr = 0;
|
uint8_t fixeddelayCtr = 0;
|
||||||
|
|
||||||
const char *powerStateToString();
|
const char *powerStateToString();
|
||||||
|
|
||||||
protected:
|
|
||||||
GnssModel_t gnssModel = GNSS_MODEL_UNKNOWN;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern GPS *gps;
|
extern GPS *gps;
|
||||||
#endif // Exclude GPS
|
#endif // Exclude GPS
|
||||||
|
@ -396,7 +396,7 @@ static void drawBattery(OLEDDisplay *display, int16_t x, int16_t y, uint8_t *img
|
|||||||
display->drawFastImage(x, y, 16, 8, imgBuffer);
|
display->drawFastImage(x, y, 16, 8, imgBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef T_WATCH_S3
|
#if defined(DISPLAY_CLOCK_FRAME)
|
||||||
|
|
||||||
void Screen::drawWatchFaceToggleButton(OLEDDisplay *display, int16_t x, int16_t y, bool digitalMode, float scale)
|
void Screen::drawWatchFaceToggleButton(OLEDDisplay *display, int16_t x, int16_t y, bool digitalMode, float scale)
|
||||||
{
|
{
|
||||||
@ -2068,7 +2068,7 @@ void Screen::setFrames(FrameFocus focus)
|
|||||||
focus = FOCUS_FAULT; // Change our "focus" parameter, to ensure we show the fault frame
|
focus = FOCUS_FAULT; // Change our "focus" parameter, to ensure we show the fault frame
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef T_WATCH_S3
|
#if defined(DISPLAY_CLOCK_FRAME)
|
||||||
normalFrames[numframes++] = screen->digitalWatchFace ? &Screen::drawDigitalClockFrame : &Screen::drawAnalogClockFrame;
|
normalFrames[numframes++] = screen->digitalWatchFace ? &Screen::drawDigitalClockFrame : &Screen::drawAnalogClockFrame;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -2699,7 +2699,7 @@ int Screen::handleUIFrameEvent(const UIFrameEvent *event)
|
|||||||
int Screen::handleInputEvent(const InputEvent *event)
|
int Screen::handleInputEvent(const InputEvent *event)
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef T_WATCH_S3
|
#if defined(DISPLAY_CLOCK_FRAME)
|
||||||
// For the T-Watch, intercept touches to the 'toggle digital/analog watch face' button
|
// For the T-Watch, intercept touches to the 'toggle digital/analog watch face' button
|
||||||
uint8_t watchFaceFrame = error_code ? 1 : 0;
|
uint8_t watchFaceFrame = error_code ? 1 : 0;
|
||||||
|
|
||||||
|
@ -554,7 +554,7 @@ class Screen : public concurrency::OSThread
|
|||||||
|
|
||||||
static void drawDebugInfoWiFiTrampoline(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
static void drawDebugInfoWiFiTrampoline(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
||||||
|
|
||||||
#ifdef T_WATCH_S3
|
#if defined(DISPLAY_CLOCK_FRAME)
|
||||||
static void drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
static void drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
||||||
|
|
||||||
static void drawDigitalClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
static void drawDigitalClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
||||||
|
@ -14,7 +14,7 @@ const uint8_t imgUser[] PROGMEM = {0x3C, 0x42, 0x99, 0xA5, 0xA5, 0x99, 0x42, 0x3
|
|||||||
const uint8_t imgPositionEmpty[] PROGMEM = {0x20, 0x30, 0x28, 0x24, 0x42, 0xFF};
|
const uint8_t imgPositionEmpty[] PROGMEM = {0x20, 0x30, 0x28, 0x24, 0x42, 0xFF};
|
||||||
const uint8_t imgPositionSolid[] PROGMEM = {0x20, 0x30, 0x38, 0x3C, 0x7E, 0xFF};
|
const uint8_t imgPositionSolid[] PROGMEM = {0x20, 0x30, 0x38, 0x3C, 0x7E, 0xFF};
|
||||||
|
|
||||||
#ifdef T_WATCH_S3
|
#if defined(DISPLAY_CLOCK_FRAME)
|
||||||
const uint8_t bluetoothConnectedIcon[36] PROGMEM = {0xfe, 0x01, 0xff, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, 0xe3, 0x1f,
|
const uint8_t bluetoothConnectedIcon[36] PROGMEM = {0xfe, 0x01, 0xff, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, 0xe3, 0x1f,
|
||||||
0xf3, 0x3f, 0x33, 0x30, 0x33, 0x33, 0x33, 0x33, 0x03, 0x33, 0xff, 0x33,
|
0xf3, 0x3f, 0x33, 0x30, 0x33, 0x33, 0x33, 0x33, 0x03, 0x33, 0xff, 0x33,
|
||||||
0xfe, 0x31, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0xf0, 0x3f, 0xe0, 0x1f};
|
0xfe, 0x31, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0xf0, 0x3f, 0xe0, 0x1f};
|
||||||
|
@ -518,7 +518,7 @@ void NodeDB::installDefaultConfig(bool preserveKey = false)
|
|||||||
#ifdef RAK4630
|
#ifdef RAK4630
|
||||||
config.display.wake_on_tap_or_motion = true;
|
config.display.wake_on_tap_or_motion = true;
|
||||||
#endif
|
#endif
|
||||||
#ifdef T_WATCH_S3
|
#if defined(T_WATCH_S3) || defined(SENSECAP_INDICATOR)
|
||||||
config.display.screen_on_secs = 30;
|
config.display.screen_on_secs = 30;
|
||||||
config.display.wake_on_tap_or_motion = true;
|
config.display.wake_on_tap_or_motion = true;
|
||||||
#endif
|
#endif
|
||||||
@ -542,7 +542,7 @@ void NodeDB::initConfigIntervals()
|
|||||||
|
|
||||||
config.display.screen_on_secs = default_screen_on_secs;
|
config.display.screen_on_secs = default_screen_on_secs;
|
||||||
|
|
||||||
#if defined(T_WATCH_S3) || defined(T_DECK) || defined(RAK14014)
|
#if defined(T_WATCH_S3) || defined(T_DECK) || defined(RAK14014) || defined(SENSECAP_INDICATOR)
|
||||||
config.power.is_power_saving = true;
|
config.power.is_power_saving = true;
|
||||||
config.display.screen_on_secs = 30;
|
config.display.screen_on_secs = 30;
|
||||||
config.power.wait_bluetooth_secs = 30;
|
config.power.wait_bluetooth_secs = 30;
|
||||||
|
@ -55,7 +55,7 @@ CannedMessageModule::CannedMessageModule()
|
|||||||
LOG_INFO("CannedMessageModule is enabled");
|
LOG_INFO("CannedMessageModule is enabled");
|
||||||
|
|
||||||
// T-Watch interface currently has no way to select destination type, so default to 'node'
|
// T-Watch interface currently has no way to select destination type, so default to 'node'
|
||||||
#if defined(T_WATCH_S3) || defined(RAK14014)
|
#if defined(USE_VIRTUAL_KEYBOARD)
|
||||||
this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NODE;
|
this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NODE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ int CannedMessageModule::splitConfiguredMessages()
|
|||||||
|
|
||||||
String canned_messages = cannedMessageModuleConfig.messages;
|
String canned_messages = cannedMessageModuleConfig.messages;
|
||||||
|
|
||||||
#if defined(T_WATCH_S3) || defined(RAK14014)
|
#if defined(USE_VIRTUAL_KEYBOARD)
|
||||||
String separator = canned_messages.length() ? "|" : "";
|
String separator = canned_messages.length() ? "|" : "";
|
||||||
|
|
||||||
canned_messages = "[---- Free Text ----]" + separator + canned_messages;
|
canned_messages = "[---- Free Text ----]" + separator + canned_messages;
|
||||||
@ -150,7 +150,7 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event)
|
|||||||
}
|
}
|
||||||
if (event->inputEvent == static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT)) {
|
if (event->inputEvent == static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT)) {
|
||||||
|
|
||||||
#if defined(T_WATCH_S3) || defined(RAK14014)
|
#if defined(USE_VIRTUAL_KEYBOARD)
|
||||||
if (this->currentMessageIndex == 0) {
|
if (this->currentMessageIndex == 0) {
|
||||||
this->runState = CANNED_MESSAGE_RUN_STATE_FREETEXT;
|
this->runState = CANNED_MESSAGE_RUN_STATE_FREETEXT;
|
||||||
|
|
||||||
@ -177,7 +177,7 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event)
|
|||||||
e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; // We want to change the list of frames shown on-screen
|
e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; // We want to change the list of frames shown on-screen
|
||||||
this->currentMessageIndex = -1;
|
this->currentMessageIndex = -1;
|
||||||
|
|
||||||
#if !defined(T_WATCH_S3) && !defined(RAK14014)
|
#if !defined(T_WATCH_S3) && !defined(RAK14014) && !defined(USE_VIRTUAL_KEYBOARD)
|
||||||
this->freetext = ""; // clear freetext
|
this->freetext = ""; // clear freetext
|
||||||
this->cursor = 0;
|
this->cursor = 0;
|
||||||
this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NONE;
|
this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NONE;
|
||||||
@ -190,7 +190,7 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event)
|
|||||||
(event->inputEvent == static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT)) ||
|
(event->inputEvent == static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT)) ||
|
||||||
(event->inputEvent == static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT))) {
|
(event->inputEvent == static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT))) {
|
||||||
|
|
||||||
#if defined(T_WATCH_S3) || defined(RAK14014)
|
#if defined(USE_VIRTUAL_KEYBOARD)
|
||||||
if (event->inputEvent == static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT)) {
|
if (event->inputEvent == static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT)) {
|
||||||
this->payload = INPUT_BROKER_MSG_LEFT;
|
this->payload = INPUT_BROKER_MSG_LEFT;
|
||||||
} else if (event->inputEvent == static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT)) {
|
} else if (event->inputEvent == static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT)) {
|
||||||
@ -312,7 +312,7 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(T_WATCH_S3) || defined(RAK14014)
|
#if defined(USE_VIRTUAL_KEYBOARD)
|
||||||
if (this->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT) {
|
if (this->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT) {
|
||||||
String keyTapped = keyForCoordinates(event->touchX, event->touchY);
|
String keyTapped = keyForCoordinates(event->touchX, event->touchY);
|
||||||
|
|
||||||
@ -446,7 +446,7 @@ int32_t CannedMessageModule::runOnce()
|
|||||||
this->freetext = ""; // clear freetext
|
this->freetext = ""; // clear freetext
|
||||||
this->cursor = 0;
|
this->cursor = 0;
|
||||||
|
|
||||||
#if !defined(T_WATCH_S3) && !defined(RAK14014)
|
#if !defined(T_WATCH_S3) && !defined(RAK14014) && !defined(SENSECAP_INDICATOR)
|
||||||
this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NONE;
|
this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NONE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -459,7 +459,7 @@ int32_t CannedMessageModule::runOnce()
|
|||||||
this->freetext = ""; // clear freetext
|
this->freetext = ""; // clear freetext
|
||||||
this->cursor = 0;
|
this->cursor = 0;
|
||||||
|
|
||||||
#if !defined(T_WATCH_S3) && !defined(RAK14014)
|
#if !defined(T_WATCH_S3) && !defined(RAK14014) && !defined(USE_VIRTUAL_KEYBOARD)
|
||||||
this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NONE;
|
this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NONE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -479,7 +479,7 @@ int32_t CannedMessageModule::runOnce()
|
|||||||
powerFSM.trigger(EVENT_PRESS);
|
powerFSM.trigger(EVENT_PRESS);
|
||||||
return INT32_MAX;
|
return INT32_MAX;
|
||||||
} else {
|
} else {
|
||||||
#if defined(T_WATCH_S3) || defined(RAK14014)
|
#if defined(USE_VIRTUAL_KEYBOARD)
|
||||||
sendText(this->dest, indexChannels[this->channel], this->messages[this->currentMessageIndex], true);
|
sendText(this->dest, indexChannels[this->channel], this->messages[this->currentMessageIndex], true);
|
||||||
#else
|
#else
|
||||||
sendText(NODENUM_BROADCAST, channels.getPrimaryIndex(), this->messages[this->currentMessageIndex], true);
|
sendText(NODENUM_BROADCAST, channels.getPrimaryIndex(), this->messages[this->currentMessageIndex], true);
|
||||||
@ -496,7 +496,7 @@ int32_t CannedMessageModule::runOnce()
|
|||||||
this->freetext = ""; // clear freetext
|
this->freetext = ""; // clear freetext
|
||||||
this->cursor = 0;
|
this->cursor = 0;
|
||||||
|
|
||||||
#if !defined(T_WATCH_S3) && !defined(RAK14014)
|
#if !defined(T_WATCH_S3) && !defined(RAK14014) && !defined(USE_VIRTUAL_KEYBOARD)
|
||||||
this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NONE;
|
this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NONE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -513,7 +513,7 @@ int32_t CannedMessageModule::runOnce()
|
|||||||
this->freetext = ""; // clear freetext
|
this->freetext = ""; // clear freetext
|
||||||
this->cursor = 0;
|
this->cursor = 0;
|
||||||
|
|
||||||
#if !defined(T_WATCH_S3) && !defined(RAK14014)
|
#if !defined(T_WATCH_S3) && !defined(RAK14014) && !defined(USE_VIRTUAL_KEYBOARD)
|
||||||
this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NONE;
|
this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NONE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -526,7 +526,7 @@ int32_t CannedMessageModule::runOnce()
|
|||||||
this->freetext = ""; // clear freetext
|
this->freetext = ""; // clear freetext
|
||||||
this->cursor = 0;
|
this->cursor = 0;
|
||||||
|
|
||||||
#if !defined(T_WATCH_S3) && !defined(RAK14014)
|
#if !defined(T_WATCH_S3) && !defined(RAK14014) && !defined(USE_VIRTUAL_KEYBOARD)
|
||||||
this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NONE;
|
this->destSelect = CANNED_MESSAGE_DESTINATION_TYPE_NONE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -769,7 +769,7 @@ void CannedMessageModule::showTemporaryMessage(const String &message)
|
|||||||
setIntervalFromNow(2000);
|
setIntervalFromNow(2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(T_WATCH_S3) || defined(RAK14014)
|
#if defined(USE_VIRTUAL_KEYBOARD)
|
||||||
|
|
||||||
String CannedMessageModule::keyForCoordinates(uint x, uint y)
|
String CannedMessageModule::keyForCoordinates(uint x, uint y)
|
||||||
{
|
{
|
||||||
@ -1055,7 +1055,7 @@ void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *st
|
|||||||
display->drawString(10 + x, 0 + y + FONT_HEIGHT_SMALL, "Canned Message\nModule disabled.");
|
display->drawString(10 + x, 0 + y + FONT_HEIGHT_SMALL, "Canned Message\nModule disabled.");
|
||||||
} else if (cannedMessageModule->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT) {
|
} else if (cannedMessageModule->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT) {
|
||||||
requestFocus(); // Tell Screen::setFrames to move to our module's frame
|
requestFocus(); // Tell Screen::setFrames to move to our module's frame
|
||||||
#if defined(T_WATCH_S3) || defined(RAK14014)
|
#if defined(USE_VIRTUAL_KEYBOARD)
|
||||||
drawKeyboard(display, state, 0, 0);
|
drawKeyboard(display, state, 0, 0);
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ class CannedMessageModule : public SinglePortModule, public Observable<const UIF
|
|||||||
int getNextIndex();
|
int getNextIndex();
|
||||||
int getPrevIndex();
|
int getPrevIndex();
|
||||||
|
|
||||||
#if defined(T_WATCH_S3) || defined(RAK14014)
|
#if defined(USE_VIRTUAL_KEYBOARD)
|
||||||
void drawKeyboard(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
void drawKeyboard(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
||||||
String keyForCoordinates(uint x, uint y);
|
String keyForCoordinates(uint x, uint y);
|
||||||
bool shift = false;
|
bool shift = false;
|
||||||
@ -156,7 +156,7 @@ class CannedMessageModule : public SinglePortModule, public Observable<const UIF
|
|||||||
unsigned long lastTouchMillis = 0;
|
unsigned long lastTouchMillis = 0;
|
||||||
String temporaryMessage;
|
String temporaryMessage;
|
||||||
|
|
||||||
#if defined(T_WATCH_S3) || defined(RAK14014)
|
#if defined(USE_VIRTUAL_KEYBOARD)
|
||||||
Letter keyboard[2][4][10] = {{{{"Q", 20, 0, 0, 0, 0},
|
Letter keyboard[2][4][10] = {{{{"Q", 20, 0, 0, 0, 0},
|
||||||
{"W", 22, 0, 0, 0, 0},
|
{"W", 22, 0, 0, 0, 0},
|
||||||
{"E", 17, 0, 0, 0, 0},
|
{"E", 17, 0, 0, 0, 0},
|
||||||
|
@ -11,7 +11,7 @@ build_flags =
|
|||||||
-DARDUINO_USB_CDC_ON_BOOT=1
|
-DARDUINO_USB_CDC_ON_BOOT=1
|
||||||
|
|
||||||
lib_deps = ${esp32s3_base.lib_deps}
|
lib_deps = ${esp32s3_base.lib_deps}
|
||||||
earlephilhower/ESP8266Audio@^1.9.7
|
earlephilhower/ESP8266Audio@^1.9.9
|
||||||
earlephilhower/ESP8266SAM@^1.0.1
|
earlephilhower/ESP8266SAM@^1.0.1
|
||||||
|
|
||||||
[env:dreamcatcher-2206]
|
[env:dreamcatcher-2206]
|
||||||
|
@ -60,6 +60,7 @@
|
|||||||
#define DAC_I2S_BCK 21
|
#define DAC_I2S_BCK 21
|
||||||
#define DAC_I2S_WS 9
|
#define DAC_I2S_WS 9
|
||||||
#define DAC_I2S_DOUT 48
|
#define DAC_I2S_DOUT 48
|
||||||
|
#define DAC_I2S_MCLK 44
|
||||||
|
|
||||||
#define BIAS_T_ENABLE 7 // needs to be low
|
#define BIAS_T_ENABLE 7 // needs to be low
|
||||||
#define BIAS_T_VALUE 0
|
#define BIAS_T_VALUE 0
|
||||||
|
@ -306,7 +306,7 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
|||||||
#define SCREEN_TOUCH_INT WB_IO6
|
#define SCREEN_TOUCH_INT WB_IO6
|
||||||
|
|
||||||
#define CANNED_MESSAGE_MODULE_ENABLE 1
|
#define CANNED_MESSAGE_MODULE_ENABLE 1
|
||||||
|
#define USE_VIRTUAL_KEYBOARD 1
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Arduino objects - C++ only
|
* Arduino objects - C++ only
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
|
@ -63,3 +63,6 @@
|
|||||||
#define SX126X_BUSY LORA_DIO2
|
#define SX126X_BUSY LORA_DIO2
|
||||||
#define SX126X_RESET LORA_RESET
|
#define SX126X_RESET LORA_RESET
|
||||||
#define SX126X_DIO2_AS_RF_SWITCH
|
#define SX126X_DIO2_AS_RF_SWITCH
|
||||||
|
|
||||||
|
#define USE_VIRTUAL_KEYBOARD 1
|
||||||
|
#define DISPLAY_CLOCK_FRAME 1
|
||||||
|
@ -15,5 +15,5 @@ build_flags = ${esp32_base.build_flags}
|
|||||||
|
|
||||||
lib_deps = ${esp32s3_base.lib_deps}
|
lib_deps = ${esp32s3_base.lib_deps}
|
||||||
lovyan03/LovyanGFX@^1.1.9
|
lovyan03/LovyanGFX@^1.1.9
|
||||||
earlephilhower/ESP8266Audio@^1.9.7
|
earlephilhower/ESP8266Audio@^1.9.9
|
||||||
earlephilhower/ESP8266SAM@^1.0.1
|
earlephilhower/ESP8266SAM@^1.0.1
|
@ -73,6 +73,7 @@
|
|||||||
#define DAC_I2S_BCK 7
|
#define DAC_I2S_BCK 7
|
||||||
#define DAC_I2S_WS 5
|
#define DAC_I2S_WS 5
|
||||||
#define DAC_I2S_DOUT 6
|
#define DAC_I2S_DOUT 6
|
||||||
|
#define DAC_I2S_MCLK 21 // GPIO lrck mic
|
||||||
|
|
||||||
// LoRa
|
// LoRa
|
||||||
#define USE_SX1262
|
#define USE_SX1262
|
||||||
|
@ -14,5 +14,5 @@ lib_deps = ${esp32s3_base.lib_deps}
|
|||||||
lovyan03/LovyanGFX@^1.1.9
|
lovyan03/LovyanGFX@^1.1.9
|
||||||
lewisxhe/PCF8563_Library@1.0.1
|
lewisxhe/PCF8563_Library@1.0.1
|
||||||
adafruit/Adafruit DRV2605 Library@^1.2.2
|
adafruit/Adafruit DRV2605 Library@^1.2.2
|
||||||
earlephilhower/ESP8266Audio@^1.9.7
|
earlephilhower/ESP8266Audio@^1.9.9
|
||||||
earlephilhower/ESP8266SAM@^1.0.1
|
earlephilhower/ESP8266SAM@^1.0.1
|
@ -34,6 +34,7 @@
|
|||||||
#define DAC_I2S_BCK 48
|
#define DAC_I2S_BCK 48
|
||||||
#define DAC_I2S_WS 15
|
#define DAC_I2S_WS 15
|
||||||
#define DAC_I2S_DOUT 46
|
#define DAC_I2S_DOUT 46
|
||||||
|
#define DAC_I2S_MCLK 0
|
||||||
|
|
||||||
#define HAS_AXP2101
|
#define HAS_AXP2101
|
||||||
|
|
||||||
@ -71,3 +72,6 @@
|
|||||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||||
// Internally the TTGO module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for
|
// Internally the TTGO module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for
|
||||||
// the sx1262interface code)
|
// the sx1262interface code)
|
||||||
|
|
||||||
|
#define USE_VIRTUAL_KEYBOARD 1
|
||||||
|
#define DISPLAY_CLOCK_FRAME 1
|
||||||
|
Loading…
Reference in New Issue
Block a user