spelling fixes (#9801)
45 corrections in c++ source comments limited to 27 files in src/gps src/graphics src/input
This commit is contained in:
co-authored by
GitHub
parent
1e34c1ef1b
commit
deb45e471c
+6
-6
@@ -93,7 +93,7 @@ static const char *getGPSPowerStateString(GPSPowerState state)
|
|||||||
|
|
||||||
#ifdef PIN_GPS_SWITCH
|
#ifdef PIN_GPS_SWITCH
|
||||||
// If we have a hardware switch, define a periodic watcher outside of the GPS runOnce thread, since this can be sleeping
|
// If we have a hardware switch, define a periodic watcher outside of the GPS runOnce thread, since this can be sleeping
|
||||||
// idefinitely
|
// indefinitely
|
||||||
|
|
||||||
int lastState = LOW;
|
int lastState = LOW;
|
||||||
bool firstrun = true;
|
bool firstrun = true;
|
||||||
@@ -586,14 +586,14 @@ bool GPS::setup()
|
|||||||
_serial_gps->write("$PMTK301,2*2E\r\n");
|
_serial_gps->write("$PMTK301,2*2E\r\n");
|
||||||
delay(250);
|
delay(250);
|
||||||
} else if (gnssModel == GNSS_MODEL_ATGM336H) {
|
} else if (gnssModel == GNSS_MODEL_ATGM336H) {
|
||||||
// Set the intial configuration of the device - these _should_ work for most AT6558 devices
|
// Set the initial configuration of the device - these _should_ work for most AT6558 devices
|
||||||
msglen = makeCASPacket(0x06, 0x07, sizeof(_message_CAS_CFG_NAVX_CONF), _message_CAS_CFG_NAVX_CONF);
|
msglen = makeCASPacket(0x06, 0x07, sizeof(_message_CAS_CFG_NAVX_CONF), _message_CAS_CFG_NAVX_CONF);
|
||||||
_serial_gps->write(UBXscratch, msglen);
|
_serial_gps->write(UBXscratch, msglen);
|
||||||
if (getACKCas(0x06, 0x07, 250) != GNSS_RESPONSE_OK) {
|
if (getACKCas(0x06, 0x07, 250) != GNSS_RESPONSE_OK) {
|
||||||
LOG_WARN("ATGM336H: Could not set Config");
|
LOG_WARN("ATGM336H: Could not set Config");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the update frequence to 1Hz
|
// Set the update frequency to 1Hz
|
||||||
msglen = makeCASPacket(0x06, 0x04, sizeof(_message_CAS_CFG_RATE_1HZ), _message_CAS_CFG_RATE_1HZ);
|
msglen = makeCASPacket(0x06, 0x04, sizeof(_message_CAS_CFG_RATE_1HZ), _message_CAS_CFG_RATE_1HZ);
|
||||||
_serial_gps->write(UBXscratch, msglen);
|
_serial_gps->write(UBXscratch, msglen);
|
||||||
if (getACKCas(0x06, 0x04, 250) != GNSS_RESPONSE_OK) {
|
if (getACKCas(0x06, 0x04, 250) != GNSS_RESPONSE_OK) {
|
||||||
@@ -700,7 +700,7 @@ bool GPS::setup()
|
|||||||
} else { // 8,9
|
} else { // 8,9
|
||||||
LOG_INFO("GPS+SBAS+GLONASS+Galileo configured");
|
LOG_INFO("GPS+SBAS+GLONASS+Galileo configured");
|
||||||
}
|
}
|
||||||
// Documentation say, we need wait atleast 0.5s after reconfiguration of GNSS module, before sending next
|
// Documentation say, we need wait at least 0.5s after reconfiguration of GNSS module, before sending next
|
||||||
// commands for the M8 it tends to be more... 1 sec should be enough ;>)
|
// commands for the M8 it tends to be more... 1 sec should be enough ;>)
|
||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
||||||
@@ -733,7 +733,7 @@ bool GPS::setup()
|
|||||||
SEND_UBX_PACKET(0x06, 0x86, _message_PMS, "enable powersave for GPS", 500);
|
SEND_UBX_PACKET(0x06, 0x86, _message_PMS, "enable powersave for GPS", 500);
|
||||||
SEND_UBX_PACKET(0x06, 0x3B, _message_CFG_PM2, "enable powersave details for GPS", 500);
|
SEND_UBX_PACKET(0x06, 0x3B, _message_CFG_PM2, "enable powersave details for GPS", 500);
|
||||||
|
|
||||||
// For M8 we want to enable NMEA vserion 4.10 so we can see the additional sats.
|
// For M8 we want to enable NMEA version 4.10 so we can see the additional sats.
|
||||||
if (gnssModel == GNSS_MODEL_UBLOX8) {
|
if (gnssModel == GNSS_MODEL_UBLOX8) {
|
||||||
clearBuffer();
|
clearBuffer();
|
||||||
SEND_UBX_PACKET(0x06, 0x17, _message_NMEA, "enable NMEA 4.10", 500);
|
SEND_UBX_PACKET(0x06, 0x17, _message_NMEA, "enable NMEA 4.10", 500);
|
||||||
@@ -1211,7 +1211,7 @@ int32_t GPS::runOnce()
|
|||||||
return disable(); // This should trigger when we have a fixed position, and get that first position
|
return disable(); // This should trigger when we have a fixed position, and get that first position
|
||||||
|
|
||||||
// 9600bps is approx 1 byte per msec, so considering our buffer size we never need to wake more often than 200ms
|
// 9600bps is approx 1 byte per msec, so considering our buffer size we never need to wake more often than 200ms
|
||||||
// if not awake we can run super infrquently (once every 5 secs?) to see if we need to wake.
|
// if not awake we can run super infrequently (once every 5 secs?) to see if we need to wake.
|
||||||
return (powerState == GPS_ACTIVE) ? GPS_THREAD_INTERVAL : 5000;
|
return (powerState == GPS_ACTIVE) ? GPS_THREAD_INTERVAL : 5000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ GeoCoord::GeoCoord(int32_t lat, int32_t lon, int32_t alt) : _latitude(lat), _lon
|
|||||||
|
|
||||||
GeoCoord::GeoCoord(float lat, float lon, int32_t alt) : _altitude(alt)
|
GeoCoord::GeoCoord(float lat, float lon, int32_t alt) : _altitude(alt)
|
||||||
{
|
{
|
||||||
// Change decimial representation to int32_t. I.e., 12.345 becomes 123450000
|
// Change decimal representation to int32_t. I.e., 12.345 becomes 123450000
|
||||||
_latitude = int32_t(lat * 1e+7);
|
_latitude = int32_t(lat * 1e+7);
|
||||||
_longitude = int32_t(lon * 1e+7);
|
_longitude = int32_t(lon * 1e+7);
|
||||||
GeoCoord::setCoords();
|
GeoCoord::setCoords();
|
||||||
@@ -20,7 +20,7 @@ GeoCoord::GeoCoord(float lat, float lon, int32_t alt) : _altitude(alt)
|
|||||||
|
|
||||||
GeoCoord::GeoCoord(double lat, double lon, int32_t alt) : _altitude(alt)
|
GeoCoord::GeoCoord(double lat, double lon, int32_t alt) : _altitude(alt)
|
||||||
{
|
{
|
||||||
// Change decimial representation to int32_t. I.e., 12.345 becomes 123450000
|
// Change decimal representation to int32_t. I.e., 12.345 becomes 123450000
|
||||||
_latitude = int32_t(lat * 1e+7);
|
_latitude = int32_t(lat * 1e+7);
|
||||||
_longitude = int32_t(lon * 1e+7);
|
_longitude = int32_t(lon * 1e+7);
|
||||||
GeoCoord::setCoords();
|
GeoCoord::setCoords();
|
||||||
@@ -467,10 +467,10 @@ int32_t GeoCoord::bearingTo(const GeoCoord &pointB)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new point bassed on the passed in poin
|
* Create a new point based on the passed-in point
|
||||||
* Ported from http://www.edwilliams.org/avform147.htm#LL
|
* Ported from http://www.edwilliams.org/avform147.htm#LL
|
||||||
* @param bearing
|
* @param bearing
|
||||||
* The bearing in raidans
|
* The bearing in radians
|
||||||
* @param range_meters
|
* @param range_meters
|
||||||
* range in meters
|
* range in meters
|
||||||
* @return GeoCoord object of point at bearing and range from initial point
|
* @return GeoCoord object of point at bearing and range from initial point
|
||||||
|
|||||||
+2
-2
@@ -223,7 +223,7 @@ RTCSetResult perhapsSetRTC(RTCQuality q, const struct timeval *tv, bool forceUpd
|
|||||||
// This delta value works on all platforms
|
// This delta value works on all platforms
|
||||||
timeStartMsec = now;
|
timeStartMsec = now;
|
||||||
zeroOffsetSecs = tv->tv_sec;
|
zeroOffsetSecs = tv->tv_sec;
|
||||||
// If this platform has a setable RTC, set it
|
// If this platform has a settable RTC, set it
|
||||||
#ifdef RV3028_RTC
|
#ifdef RV3028_RTC
|
||||||
if (rtc_found.address == RV3028_RTC) {
|
if (rtc_found.address == RV3028_RTC) {
|
||||||
Melopero_RV3028 rtc;
|
Melopero_RV3028 rtc;
|
||||||
@@ -402,7 +402,7 @@ time_t gm_mktime(const struct tm *tm)
|
|||||||
#if !MESHTASTIC_EXCLUDE_TZ
|
#if !MESHTASTIC_EXCLUDE_TZ
|
||||||
time_t result = 0;
|
time_t result = 0;
|
||||||
|
|
||||||
// First, get us to the start of tm->year, by calcuating the number of days since the Unix epoch.
|
// First, get us to the start of tm->year, by calculating the number of days since the Unix epoch.
|
||||||
int year = 1900 + tm->tm_year; // tm_year is years since 1900
|
int year = 1900 + tm->tm_year; // tm_year is years since 1900
|
||||||
int year_minus_one = year - 1;
|
int year_minus_one = year - 1;
|
||||||
int days_before_this_year = 0;
|
int days_before_this_year = 0;
|
||||||
|
|||||||
+1
-1
@@ -37,7 +37,7 @@ static const uint8_t _message_CAS_CFG_RATE_1HZ[] = {
|
|||||||
|
|
||||||
// CFG-NAVX (0x06, 0x07)
|
// CFG-NAVX (0x06, 0x07)
|
||||||
// Initial ATGM33H-5N configuration, Updates for Dynamic Mode, Fix Mode, and SV system
|
// Initial ATGM33H-5N configuration, Updates for Dynamic Mode, Fix Mode, and SV system
|
||||||
// Qwirk: The ATGM33H-5N-31 should only support GPS+BDS, however it will happily enable
|
// Quirk: The ATGM33H-5N-31 should only support GPS+BDS, however it will happily enable
|
||||||
// and use GPS+BDS+GLONASS iff the correct CFG_NAVX command is used.
|
// and use GPS+BDS+GLONASS iff the correct CFG_NAVX command is used.
|
||||||
static const uint8_t _message_CAS_CFG_NAVX_CONF[] = {
|
static const uint8_t _message_CAS_CFG_NAVX_CONF[] = {
|
||||||
0x03, 0x01, 0x00, 0x00, // Update Mask: Dynamic Mode, Fix Mode, Nav Settings
|
0x03, 0x01, 0x00, 0x00, // Update Mask: Dynamic Mode, Fix Mode, Nav Settings
|
||||||
|
|||||||
+6
-6
@@ -57,7 +57,7 @@ static const uint8_t _message_CFG_PM2[] PROGMEM = {
|
|||||||
0x00, 0x00, 0x00, 0x00 // 0x64, 0x40, 0x01, 0x00 // reserved 11
|
0x00, 0x00, 0x00, 0x00 // 0x64, 0x40, 0x01, 0x00 // reserved 11
|
||||||
};
|
};
|
||||||
|
|
||||||
// Constallation setup, none required for Neo-6
|
// Constellation setup, none required for Neo-6
|
||||||
|
|
||||||
// For Neo-7 GPS & SBAS
|
// For Neo-7 GPS & SBAS
|
||||||
static const uint8_t _message_GNSS_7[] = {
|
static const uint8_t _message_GNSS_7[] = {
|
||||||
@@ -157,7 +157,7 @@ static const uint8_t _message_NAVX5[] = {
|
|||||||
0x00, 0x00, 0x00, 0x00, // Reserved 9
|
0x00, 0x00, 0x00, 0x00, // Reserved 9
|
||||||
0x00, // Reserved 10
|
0x00, // Reserved 10
|
||||||
0x00, // Reserved 11
|
0x00, // Reserved 11
|
||||||
0x00, // usePPP (Precice Point Positioning) (0 = false, 1 = true)
|
0x00, // usePPP (Precise Point Positioning) (0 = false, 1 = true)
|
||||||
0x01, // useAOP (AssistNow Autonomous configuration) = 1 (enabled)
|
0x01, // useAOP (AssistNow Autonomous configuration) = 1 (enabled)
|
||||||
0x00, // Reserved 12
|
0x00, // Reserved 12
|
||||||
0x00, // Reserved 13
|
0x00, // Reserved 13
|
||||||
@@ -185,7 +185,7 @@ static const uint8_t _message_NAVX5_8[] = {
|
|||||||
0x00, // Reserved 4
|
0x00, // Reserved 4
|
||||||
0x00, 0x00, // Reserved 5
|
0x00, 0x00, // Reserved 5
|
||||||
0x00, 0x00, // Reserved 6
|
0x00, 0x00, // Reserved 6
|
||||||
0x00, // usePPP (Precice Point Positioning) (0 = false, 1 = true)
|
0x00, // usePPP (Precise Point Positioning) (0 = false, 1 = true)
|
||||||
0x01, // aopCfg (AssistNow Autonomous configuration) = 1 (enabled)
|
0x01, // aopCfg (AssistNow Autonomous configuration) = 1 (enabled)
|
||||||
0x00, 0x00, // Reserved 7
|
0x00, 0x00, // Reserved 7
|
||||||
0x00, 0x00, // aopOrbMaxErr = 0 to reset to firmware default
|
0x00, 0x00, // aopOrbMaxErr = 0 to reset to firmware default
|
||||||
@@ -314,7 +314,7 @@ static const uint8_t _message_DISABLE_TXT_INFO[] = {
|
|||||||
// This command applies to M8 products
|
// This command applies to M8 products
|
||||||
static const uint8_t _message_PMS[] = {
|
static const uint8_t _message_PMS[] = {
|
||||||
0x00, // Version (0)
|
0x00, // Version (0)
|
||||||
0x03, // Power setup value 3 = Agresssive 1Hz
|
0x03, // Power setup value 3 = Agressive 1Hz
|
||||||
0x00, 0x00, // period: not applicable, set to 0
|
0x00, 0x00, // period: not applicable, set to 0
|
||||||
0x00, 0x00, // onTime: not applicable, set to 0
|
0x00, 0x00, // onTime: not applicable, set to 0
|
||||||
0x00, 0x00 // reserved, generated by u-center
|
0x00, 0x00 // reserved, generated by u-center
|
||||||
@@ -337,7 +337,7 @@ static const uint8_t _message_SAVE_10[] = {
|
|||||||
// As the M10 has no flash, the best we can do to preserve the config is to set it in RAM and BBR.
|
// As the M10 has no flash, the best we can do to preserve the config is to set it in RAM and BBR.
|
||||||
// BBR will survive a restart, and power off for a while, but modules with small backup
|
// BBR will survive a restart, and power off for a while, but modules with small backup
|
||||||
// batteries or super caps will not retain the config for a long power off time.
|
// batteries or super caps will not retain the config for a long power off time.
|
||||||
// for all configurations using sleep / low power modes, V_BCKP needs to be hooked to permanent power for fast aquisition after
|
// for all configurations using sleep / low power modes, V_BCKP needs to be hooked to permanent power for fast acquisition after
|
||||||
// sleep
|
// sleep
|
||||||
|
|
||||||
// VALSET Commands for M10
|
// VALSET Commands for M10
|
||||||
@@ -462,7 +462,7 @@ Default GNSS configuration is: GPS, Galileo, BDS B1l, with QZSS and SBAS enabled
|
|||||||
The PMREQ puts the receiver to sleep and wakeup re-acquires really fast and seems to not need
|
The PMREQ puts the receiver to sleep and wakeup re-acquires really fast and seems to not need
|
||||||
the PM config. Lets try without it.
|
the PM config. Lets try without it.
|
||||||
PMREQ sort of works with SBAS, but the awake time is too short to re-acquire any SBAS sats.
|
PMREQ sort of works with SBAS, but the awake time is too short to re-acquire any SBAS sats.
|
||||||
The defination of "Got Fix" doesn't seem to include SBAS. Much more too this...
|
The definition of "Got Fix" doesn't seem to include SBAS. Much more too this...
|
||||||
Even if it was, it can take minutes (up to 12.5),
|
Even if it was, it can take minutes (up to 12.5),
|
||||||
even under good sat visibility conditions to re-acquire the SBAS data.
|
even under good sat visibility conditions to re-acquire the SBAS data.
|
||||||
|
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ bool EInkDisplay::forceDisplay(uint32_t msecLimit)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// End the update process - virtual method, overriden in derived class
|
// End the update process - virtual method, overridden in derived class
|
||||||
void EInkDisplay::endUpdate()
|
void EInkDisplay::endUpdate()
|
||||||
{
|
{
|
||||||
// Power off display hardware, then deep-sleep (Except Wireless Paper V1.1, no deep-sleep)
|
// Power off display hardware, then deep-sleep (Except Wireless Paper V1.1, no deep-sleep)
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ void EInkDynamicDisplay::adjustRefreshCounters()
|
|||||||
// Trigger the display update by calling base class
|
// Trigger the display update by calling base class
|
||||||
bool EInkDynamicDisplay::update()
|
bool EInkDynamicDisplay::update()
|
||||||
{
|
{
|
||||||
// Detemine the refresh mode to use, and start the update
|
// Determine the refresh mode to use, and start the update
|
||||||
bool refreshApproved = determineMode();
|
bool refreshApproved = determineMode();
|
||||||
if (refreshApproved) {
|
if (refreshApproved) {
|
||||||
EInkDisplay::forceDisplay(0); // Bypass base class' own rate-limiting system
|
EInkDisplay::forceDisplay(0); // Bypass base class' own rate-limiting system
|
||||||
@@ -317,7 +317,7 @@ void EInkDynamicDisplay::checkFrameMatchesPrevious()
|
|||||||
LOG_DEBUG("refresh=SKIPPED, reason=FRAME_MATCHED_PREVIOUS, frameFlags=0x%x", frameFlags);
|
LOG_DEBUG("refresh=SKIPPED, reason=FRAME_MATCHED_PREVIOUS, frameFlags=0x%x", frameFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Have too many fast-refreshes occured consecutively, since last full refresh?
|
// Have too many fast-refreshes occurred consecutively, since last full refresh?
|
||||||
void EInkDynamicDisplay::checkConsecutiveFastRefreshes()
|
void EInkDynamicDisplay::checkConsecutiveFastRefreshes()
|
||||||
{
|
{
|
||||||
// If a decision was already reached, don't run the check
|
// If a decision was already reached, don't run the check
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ InputEvent NotificationRenderer::inEvent;
|
|||||||
int8_t NotificationRenderer::curSelected = 0;
|
int8_t NotificationRenderer::curSelected = 0;
|
||||||
char NotificationRenderer::alertBannerMessage[256] = {0};
|
char NotificationRenderer::alertBannerMessage[256] = {0};
|
||||||
uint32_t NotificationRenderer::alertBannerUntil = 0; // 0 is a special case meaning forever
|
uint32_t NotificationRenderer::alertBannerUntil = 0; // 0 is a special case meaning forever
|
||||||
uint8_t NotificationRenderer::alertBannerOptions = 0; // last x lines are seelctable options
|
uint8_t NotificationRenderer::alertBannerOptions = 0; // last x lines are selectable options
|
||||||
const char **NotificationRenderer::optionsArrayPtr = nullptr;
|
const char **NotificationRenderer::optionsArrayPtr = nullptr;
|
||||||
const int *NotificationRenderer::optionsEnumPtr = nullptr;
|
const int *NotificationRenderer::optionsEnumPtr = nullptr;
|
||||||
std::function<void(int)> NotificationRenderer::alertBannerCallback = NULL;
|
std::function<void(int)> NotificationRenderer::alertBannerCallback = NULL;
|
||||||
@@ -95,7 +95,7 @@ void NotificationRenderer::resetBanner()
|
|||||||
inEvent.inputEvent = INPUT_BROKER_NONE;
|
inEvent.inputEvent = INPUT_BROKER_NONE;
|
||||||
inEvent.kbchar = 0;
|
inEvent.kbchar = 0;
|
||||||
curSelected = 0;
|
curSelected = 0;
|
||||||
alertBannerOptions = 0; // last x lines are seelctable options
|
alertBannerOptions = 0; // last x lines are selectable options
|
||||||
optionsArrayPtr = nullptr;
|
optionsArrayPtr = nullptr;
|
||||||
optionsEnumPtr = nullptr;
|
optionsEnumPtr = nullptr;
|
||||||
alertBannerCallback = NULL;
|
alertBannerCallback = NULL;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class NotificationRenderer
|
|||||||
static uint32_t alertBannerUntil; // 0 is a special case meaning forever
|
static uint32_t alertBannerUntil; // 0 is a special case meaning forever
|
||||||
static const char **optionsArrayPtr;
|
static const char **optionsArrayPtr;
|
||||||
static const int *optionsEnumPtr;
|
static const int *optionsEnumPtr;
|
||||||
static uint8_t alertBannerOptions; // last x lines are seelctable options
|
static uint8_t alertBannerOptions; // last x lines are selectable options
|
||||||
static std::function<void(int)> alertBannerCallback;
|
static std::function<void(int)> alertBannerCallback;
|
||||||
static uint32_t numDigits;
|
static uint32_t numDigits;
|
||||||
static uint32_t currentNumber;
|
static uint32_t currentNumber;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class DEPG0213BNS800 : public SSD16XX
|
|||||||
void configWaveform() override;
|
void configWaveform() override;
|
||||||
void configUpdateSequence() override;
|
void configUpdateSequence() override;
|
||||||
void detachFromUpdate() override;
|
void detachFromUpdate() override;
|
||||||
void finalizeUpdate() override; // Only overriden for a slight optimization
|
void finalizeUpdate() override; // Only overridden for a slight optimization
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace NicheGraphics::Drivers
|
} // namespace NicheGraphics::Drivers
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class DEPG0290BNS800 : public SSD16XX
|
|||||||
void configWaveform() override;
|
void configWaveform() override;
|
||||||
void configUpdateSequence() override;
|
void configUpdateSequence() override;
|
||||||
void detachFromUpdate() override;
|
void detachFromUpdate() override;
|
||||||
void finalizeUpdate() override; // Only overriden for a slight optimization
|
void finalizeUpdate() override; // Only overridden for a slight optimization
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace NicheGraphics::Drivers
|
} // namespace NicheGraphics::Drivers
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Base class for InkHUD applets
|
Base class for InkHUD applets
|
||||||
Must be overriden
|
Must be overridden
|
||||||
|
|
||||||
An applet is one "program" which may show info on the display.
|
An applet is one "program" which may show info on the display.
|
||||||
|
|
||||||
|
|||||||
@@ -525,7 +525,7 @@ void InkHUD::MapApplet::calculateAllMarkers()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Determine the conversion factor between metres, and pixels on screen
|
// Determine the conversion factor between metres, and pixels on screen
|
||||||
// May be overriden by derived applet, if custom scale required (fixed map size?)
|
// May be overridden by derived applet, if custom scale required (fixed map size?)
|
||||||
void InkHUD::MapApplet::calculateMapScale()
|
void InkHUD::MapApplet::calculateMapScale()
|
||||||
{
|
{
|
||||||
// Aspect ratio of map and screen
|
// Aspect ratio of map and screen
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using namespace NicheGraphics;
|
|||||||
|
|
||||||
InkHUD::BatteryIconApplet::BatteryIconApplet()
|
InkHUD::BatteryIconApplet::BatteryIconApplet()
|
||||||
{
|
{
|
||||||
alwaysRender = true; // render everytime the screen is updated
|
alwaysRender = true; // render every time the screen is updated
|
||||||
|
|
||||||
// Show at boot, if user has previously enabled the feature
|
// Show at boot, if user has previously enabled the feature
|
||||||
if (settings->optionalFeatures.batteryIcon)
|
if (settings->optionalFeatures.batteryIcon)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
System Applet to render an on-screeen keyboard
|
System Applet to render an on-screen keyboard
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ void InkHUD::LogoApplet::onRender(bool full)
|
|||||||
int16_t logoCY = Y(0.5 - 0.05);
|
int16_t logoCY = Y(0.5 - 0.05);
|
||||||
|
|
||||||
// Invert colors if black-on-white
|
// Invert colors if black-on-white
|
||||||
// Used during shutdown, to resport display health
|
// Used during shutdown, to report display health
|
||||||
// Todo: handle this in InkHUD::Renderer instead
|
// Todo: handle this in InkHUD::Renderer instead
|
||||||
if (inverted) {
|
if (inverted) {
|
||||||
fillScreen(BLACK);
|
fillScreen(BLACK);
|
||||||
|
|||||||
@@ -2028,7 +2028,7 @@ void InkHUD::MenuApplet::sendText(NodeNum dest, ChannelIndex channel, const char
|
|||||||
service->sendToMesh(p, RX_SRC_LOCAL, true); // Send to mesh, cc to phone
|
service->sendToMesh(p, RX_SRC_LOCAL, true); // Send to mesh, cc to phone
|
||||||
}
|
}
|
||||||
|
|
||||||
// Free up any heap mmemory we'd used while selecting / sending canned messages
|
// Free up any heap memory we'd used while selecting / sending canned messages
|
||||||
void InkHUD::MenuApplet::freeCannedMessageResources()
|
void InkHUD::MenuApplet::freeCannedMessageResources()
|
||||||
{
|
{
|
||||||
cm.selectedMessageItem = nullptr;
|
cm.selectedMessageItem = nullptr;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Displays a thread-view of incoming and outgoing message for a specific channel
|
|||||||
The channel for this applet is set in the constructor,
|
The channel for this applet is set in the constructor,
|
||||||
when the applet is added to WindowManager in the setupNicheGraphics method.
|
when the applet is added to WindowManager in the setupNicheGraphics method.
|
||||||
|
|
||||||
Several messages are saved to flash at shutdown, to preseve applet between reboots.
|
Several messages are saved to flash at shutdown, to preserve applet between reboots.
|
||||||
This class has its own internal method for saving and loading to fs, which interacts directly with the FSCommon layer.
|
This class has its own internal method for saving and loading to fs, which interacts directly with the FSCommon layer.
|
||||||
If the amount of flash usage is unacceptable, we could keep these in RAM only.
|
If the amount of flash usage is unacceptable, we could keep these in RAM only.
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class Renderer : protected concurrency::OSThread
|
|||||||
uint16_t height();
|
uint16_t height();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Make attemps to render / update, once triggered by requestUpdate or forceUpdate
|
// Make attempts to render / update, once triggered by requestUpdate or forceUpdate
|
||||||
int32_t runOnce() override;
|
int32_t runOnce() override;
|
||||||
|
|
||||||
// Apply the display rotation to handled pixels
|
// Apply the display rotation to handled pixels
|
||||||
|
|||||||
@@ -649,7 +649,7 @@ void InkHUD::WindowManager::refocusTile()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Seach for any applets which believe they are foreground, but no longer have a valid tile
|
// Search for any applets which believe they are foreground, but no longer have a valid tile
|
||||||
// Tidies up after layout changes at runtime
|
// Tidies up after layout changes at runtime
|
||||||
void InkHUD::WindowManager::findOrphanApplets()
|
void InkHUD::WindowManager::findOrphanApplets()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ void TwoButton::stop()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Attempt to resolve a GPIO pin for the user button, honoring userPrefs.jsonc and device settings
|
// Attempt to resolve a GPIO pin for the user button, honoring userPrefs.jsonc and device settings
|
||||||
// This helper method isn't used by the TweButton class itself, it could be moved elsewhere.
|
// This helper method isn't used by the TwoButton class itself, it could be moved elsewhere.
|
||||||
// Intention is to pass this value to TwoButton::setWiring in the setupNicheGraphics method.
|
// Intention is to pass this value to TwoButton::setWiring in the setupNicheGraphics method.
|
||||||
uint8_t TwoButton::getUserButtonPin()
|
uint8_t TwoButton::getUserButtonPin()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -271,8 +271,8 @@ int32_t ButtonThread::runOnce()
|
|||||||
break;
|
break;
|
||||||
} // end multipress event
|
} // end multipress event
|
||||||
|
|
||||||
// Do actual shutdown when button released, otherwise the button release
|
// Do actual shutdown when button released, otherwise the button release
|
||||||
// may wake the board immediatedly.
|
// may wake the board immediately.
|
||||||
case BUTTON_EVENT_LONG_RELEASED: {
|
case BUTTON_EVENT_LONG_RELEASED: {
|
||||||
|
|
||||||
LOG_INFO("LONG PRESS RELEASE AFTER %u MILLIS", millis() - buttonPressStartTime);
|
LOG_INFO("LONG PRESS RELEASE AFTER %u MILLIS", millis() - buttonPressStartTime);
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ void MPR121Keyboard::reset()
|
|||||||
delay(20);
|
delay(20);
|
||||||
writeRegister(_MPR121_REG_CONFIG2, 0x21);
|
writeRegister(_MPR121_REG_CONFIG2, 0x21);
|
||||||
delay(20);
|
delay(20);
|
||||||
// Enter run mode by Seting partial filter calibration tracking, disable proximity detection, enable 12 channels
|
// Enter run mode by setting partial filter calibration tracking, disable proximity detection, enable 12 channels
|
||||||
writeRegister(_MPR121_REG_ELECTRODE_CONFIG,
|
writeRegister(_MPR121_REG_ELECTRODE_CONFIG,
|
||||||
ECR_CALIBRATION_TRACK_FROM_FULL_FILTER | ECR_PROXIMITY_DETECTION_OFF | ECR_TOUCH_DETECTION_12CH);
|
ECR_CALIBRATION_TRACK_FROM_FULL_FILTER | ECR_PROXIMITY_DETECTION_OFF | ECR_TOUCH_DETECTION_12CH);
|
||||||
delay(100);
|
delay(100);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ int32_t SeesawRotary::runOnce()
|
|||||||
wasPressed = currentlyPressed;
|
wasPressed = currentlyPressed;
|
||||||
|
|
||||||
int32_t new_position = ss.getEncoderPosition();
|
int32_t new_position = ss.getEncoderPosition();
|
||||||
// did we move arounde?
|
// did we move around?
|
||||||
if (encoder_position != new_position) {
|
if (encoder_position != new_position) {
|
||||||
if (encoder_position == 0 && new_position != 1) {
|
if (encoder_position == 0 && new_position != 1) {
|
||||||
e.inputEvent = INPUT_BROKER_ALT_PRESS;
|
e.inputEvent = INPUT_BROKER_ALT_PRESS;
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ void TCA8418Keyboard::pressed(uint8_t key)
|
|||||||
// Check if the key is the same as the last one or if the time interval has passed
|
// Check if the key is the same as the last one or if the time interval has passed
|
||||||
if (next_key != last_key || tap_interval > _TCA8418_MULTI_TAP_THRESHOLD) {
|
if (next_key != last_key || tap_interval > _TCA8418_MULTI_TAP_THRESHOLD) {
|
||||||
char_idx = 0; // Reset char index if new key or long press
|
char_idx = 0; // Reset char index if new key or long press
|
||||||
should_backspace = false; // dont backspace on new key
|
should_backspace = false; // don't backspace on new key
|
||||||
} else {
|
} else {
|
||||||
char_idx += 1; // Cycle through characters if same key pressed
|
char_idx += 1; // Cycle through characters if same key pressed
|
||||||
should_backspace = true; // allow backspace on same key
|
should_backspace = true; // allow backspace on same key
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ int32_t TouchScreenBase::runOnce()
|
|||||||
// process touch events
|
// process touch events
|
||||||
int16_t x, y;
|
int16_t x, y;
|
||||||
bool touched = getTouch(x, y);
|
bool touched = getTouch(x, y);
|
||||||
if (x < 0 || y < 0) // T-deck can emit phantom touch events with a negative value when turing off the screen
|
if (x < 0 || y < 0) // T-deck can emit phantom touch events with a negative value when turning off the screen
|
||||||
touched = false;
|
touched = false;
|
||||||
if (touched) {
|
if (touched) {
|
||||||
this->setInterval(20);
|
this->setInterval(20);
|
||||||
@@ -123,7 +123,7 @@ int32_t TouchScreenBase::runOnce()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
// fire TAP event when no 2nd tap occured within time
|
// fire TAP event when no 2nd tap occurred within time
|
||||||
if (_tapped) {
|
if (_tapped) {
|
||||||
_tapped = false;
|
_tapped = false;
|
||||||
e.touchEvent = static_cast<char>(TOUCH_ACTION_TAP);
|
e.touchEvent = static_cast<char>(TOUCH_ACTION_TAP);
|
||||||
|
|||||||
@@ -487,7 +487,7 @@ int32_t KbI2cBase::runOnce()
|
|||||||
e.kbchar = 0;
|
e.kbchar = 0;
|
||||||
break;
|
break;
|
||||||
case 0xc: // Modifier key: 0xc is alt+c (Other options could be: 0xea = shift+mic button or 0x4 shift+$(speaker))
|
case 0xc: // Modifier key: 0xc is alt+c (Other options could be: 0xea = shift+mic button or 0x4 shift+$(speaker))
|
||||||
// toggle moddifiers button.
|
// toggle modifiers button.
|
||||||
is_sym = !is_sym;
|
is_sym = !is_sym;
|
||||||
e.inputEvent = INPUT_BROKER_ANYKEY;
|
e.inputEvent = INPUT_BROKER_ANYKEY;
|
||||||
e.kbchar = is_sym ? INPUT_BROKER_MSG_FN_SYMBOL_ON // send 0xf1 to tell CannedMessages to display that the
|
e.kbchar = is_sym ? INPUT_BROKER_MSG_FN_SYMBOL_ON // send 0xf1 to tell CannedMessages to display that the
|
||||||
|
|||||||
Reference in New Issue
Block a user