Skip to content

Commit

Permalink
Fix various typos (#2607)
Browse files Browse the repository at this point in the history
* Fix various typos

Found via `codespell -q 3 -L acount,clen,dout`

* Trunk reformatting

---------

Co-authored-by: code8buster <communismisgreat@national.shitposting.agency>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
  • Loading branch information
3 people committed Jul 14, 2023
1 parent 4ace59f commit 003047b
Show file tree
Hide file tree
Showing 58 changed files with 110 additions and 109 deletions.
2 changes: 1 addition & 1 deletion src/AccelerometerThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class AccelerometerThread : public concurrency::OSThread
} else if (accleremoter_type == ScanI2C::DeviceType::LIS3DH && lis.begin(accelerometer_found.address)) {
LOG_DEBUG("LIS3DH initializing\n");
lis.setRange(LIS3DH_RANGE_2_G);
// Adjust threshhold, higher numbers are less sensitive
// Adjust threshold, higher numbers are less sensitive
lis.setClick(config.device.double_tap_as_button_press ? 2 : 1, ACCELEROMETER_CLICK_THRESHOLD);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ButtonThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class ButtonThread : public concurrency::OSThread
userButtonTouch.tick();
canSleep &= userButtonTouch.isIdle();
#endif
// if (!canSleep) LOG_DEBUG("Supressing sleep!\n");
// if (!canSleep) LOG_DEBUG("Suppressing sleep!\n");
// else LOG_DEBUG("sleep ok\n");

return 5;
Expand Down
3 changes: 2 additions & 1 deletion src/OSTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
* Schedule a callback to run. The callback must _not_ block, though it is called from regular thread level (not ISR)
*
* NOTE! xTimerPend... seems to ignore the time passed in on ESP32 and on NRF52
* The reason this didn't work is bcause xTimerPednFunctCall really isn't a timer function at all - it just means run the callback
* The reason this didn't work is because xTimerPednFunctCall really isn't a timer function at all - it just means run the
callback
* from the timer thread the next time you have spare cycles.
*
* @return true if successful, false if the timer fifo is too full.
Expand Down
4 changes: 2 additions & 2 deletions src/Power.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ XPowersLibInterface *PMU = NULL;
#else

// Copy of the base class defined in axp20x.h.
// I'd rather not inlude axp20x.h as it brings Wire dependency.
// I'd rather not include axp20x.h as it brings Wire dependency.
class HasBatteryLevel
{
public:
Expand Down Expand Up @@ -712,7 +712,7 @@ bool Power::axpChipInit()
PMU->setPowerChannelVoltage(XPOWERS_ALDO1, 3300);
PMU->enablePowerOutput(XPOWERS_ALDO1);

// sdcard power channle
// sdcard power channel
PMU->setPowerChannelVoltage(XPOWERS_BLDO1, 3300);
PMU->enablePowerOutput(XPOWERS_BLDO1);

Expand Down
2 changes: 1 addition & 1 deletion src/PowerFSM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,5 +352,5 @@ void PowerFSM_setup()
"mesh timeout");
#endif

powerFSM.run_machine(); // run one interation of the state machine, so we run our on enter tasks for the initial DARK state
powerFSM.run_machine(); // run one iteration of the state machine, so we run our on enter tasks for the initial DARK state
}
4 changes: 2 additions & 2 deletions src/airtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
Example analytics:
TX_LOG + RX_LOG = Total air time for a perticular meshtastic channel.
TX_LOG + RX_LOG = Total air time for a particular meshtastic channel.
TX_LOG + RX_LOG = Total air time for a perticular meshtastic channel, including
TX_LOG + RX_LOG = Total air time for a particular meshtastic channel, including
other lora radios.
RX_ALL_LOG - RX_LOG = Other lora radios on our frequency channel.
Expand Down
2 changes: 1 addition & 1 deletion src/concurrency/InterruptableDelay.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace concurrency
*
* Useful for they top level loop() delay call to keep the CPU powered down until our next scheduled event or some external event.
*
* This is implmented for FreeRTOS but should be easy to port to other operating systems.
* This is implemented for FreeRTOS but should be easy to port to other operating systems.
*/
class InterruptableDelay
{
Expand Down
10 changes: 5 additions & 5 deletions src/gps/GPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ int GPS::getAck(uint8_t *buffer, uint16_t size, uint8_t requestedClass, uint8_t
}
break;
case 4:
// Payload lenght lsb
// Payload length lsb
needRead = c;
ubxFrameCounter++;
break;
case 5:
// Payload lenght msb
// Payload length msb
needRead |= (c << 8);
ubxFrameCounter++;
break;
Expand All @@ -147,7 +147,7 @@ int GPS::getAck(uint8_t *buffer, uint16_t size, uint8_t requestedClass, uint8_t
if (_serial_gps->readBytes(buffer, needRead) != needRead) {
ubxFrameCounter = 0;
} else {
// return payload lenght
// return payload length
return needRead;
}
break;
Expand Down Expand Up @@ -258,7 +258,7 @@ bool GPS::setupGPS()
return true;
}

// Enable interference resistance, because we are using LoRa, WiFi and Bluetoot on same board,
// Enable interference resistance, because we are using LoRa, WiFi and Bluetooth on same board,
// and we need to reduce interference from them
byte _message_JAM[16] = {
0xB5, 0x62, // UBX protocol sync characters
Expand Down Expand Up @@ -674,7 +674,7 @@ void GPS::setAwake(bool on)
}
}

/** Get how long we should stay looking for each aquisition in msecs
/** Get how long we should stay looking for each acquisition in msecs
*/
uint32_t GPS::getWakeTime() const
{
Expand Down
2 changes: 1 addition & 1 deletion src/gps/GPS.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class GPS : private concurrency::OSThread
*/
void setAwake(bool on);

/** Get how long we should stay looking for each aquisition
/** Get how long we should stay looking for each acquisition
*/
uint32_t getWakeTime() const;

Expand Down
12 changes: 6 additions & 6 deletions src/gps/GeoCoord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ 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)
{
// Change decimial reprsentation to int32_t. I.e., 12.345 becomes 123450000
// Change decimial representation to int32_t. I.e., 12.345 becomes 123450000
_latitude = int32_t(lat * 1e+7);
_longitude = int32_t(lon * 1e+7);
GeoCoord::setCoords();
}

GeoCoord::GeoCoord(double lat, double lon, int32_t alt) : _altitude(alt)
{
// Change decimial reprsentation to int32_t. I.e., 12.345 becomes 123450000
// Change decimial representation to int32_t. I.e., 12.345 becomes 123450000
_latitude = int32_t(lat * 1e+7);
_longitude = int32_t(lon * 1e+7);
GeoCoord::setCoords();
Expand All @@ -41,7 +41,7 @@ void GeoCoord::setCoords()

void GeoCoord::updateCoords(int32_t lat, int32_t lon, int32_t alt)
{
// If marked dirty or new coordiantes
// If marked dirty or new coordinates
if (_dirty || _latitude != lat || _longitude != lon || _altitude != alt) {
_dirty = true;
_latitude = lat;
Expand All @@ -55,7 +55,7 @@ void GeoCoord::updateCoords(const double lat, const double lon, const int32_t al
{
int32_t iLat = lat * 1e+7;
int32_t iLon = lon * 1e+7;
// If marked dirty or new coordiantes
// If marked dirty or new coordinates
if (_dirty || _latitude != iLat || _longitude != iLon || _altitude != alt) {
_dirty = true;
_latitude = iLat;
Expand All @@ -69,7 +69,7 @@ void GeoCoord::updateCoords(const float lat, const float lon, const int32_t alt)
{
int32_t iLat = lat * 1e+7;
int32_t iLon = lon * 1e+7;
// If marked dirty or new coordiantes
// If marked dirty or new coordinates
if (_dirty || _latitude != iLat || _longitude != iLon || _altitude != alt) {
_dirty = true;
_latitude = iLat;
Expand Down Expand Up @@ -217,7 +217,7 @@ void GeoCoord::latLongToOSGR(const double lat, const double lon, OSGR &osgr)
double eta2 = v / rho - 1;
double mA = (1 + n + (5 / 4) * n * n + (5 / 4) * n * n * n) * (phi - phi0);
double mB = (3 * n + 3 * n * n + (21 / 8) * n * n * n) * sin(phi - phi0) * cos(phi + phi0);
// loss of precision in mC & mD due to floating point rounding can cause innaccuracy of northing by a few meters
// loss of precision in mC & mD due to floating point rounding can cause inaccuracy of northing by a few meters
double mC = (15 / 8 * n * n + 15 / 8 * n * n * n) * sin(2 * (phi - phi0)) * cos(2 * (phi + phi0));
double mD = (35 / 24) * n * n * n * sin(3 * (phi - phi0)) * cos(3 * (phi + phi0));
double m = b * f0 * (mA - mB + mC - mD);
Expand Down
2 changes: 1 addition & 1 deletion src/gps/GeoCoord.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct MGRS {
uint32_t northing;
};

// A struct to hold the data for a OSGR coordiante
// A struct to hold the data for a OSGR coordinate
struct OSGR {
char e100k;
char n100k;
Expand Down
2 changes: 1 addition & 1 deletion src/gps/RTC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static uint64_t zeroOffsetSecs; // GPS based time in secs since 1970 - only upda

void readFromRTC()
{
struct timeval tv; /* btw settimeofday() is helpfull here too*/
struct timeval tv; /* btw settimeofday() is helpful here too*/
#ifdef RV3028_RTC
if (rtc_found.address == RV3028_RTC) {
uint32_t now = millis();
Expand Down
2 changes: 1 addition & 1 deletion src/graphics/EInkDisplay2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ bool EInkDisplay::forceDisplay(uint32_t msecLimit)
for (uint32_t y = 0; y < displayHeight; y++) {
for (uint32_t x = 0; x < displayWidth; x++) {

// get src pixel in the page based ordering the OLED lib uses FIXME, super inefficent
// get src pixel in the page based ordering the OLED lib uses FIXME, super inefficient
auto b = buffer[x + (y / 8) * displayWidth];
auto isset = b & (1 << (y & 7));
adafruitDisplay->drawPixel(x, y, isset ? COLORED : UNCOLORED);
Expand Down
6 changes: 3 additions & 3 deletions src/graphics/Screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ static void drawCriticalFaultFrame(OLEDDisplay *display, OLEDDisplayUiState *sta
display->drawString(0 + x, FONT_HEIGHT_MEDIUM + y, "For help, please visit \nmeshtastic.org");
}

// Ignore messages orginating from phone (from the current node 0x0) unless range test or store and forward module are enabled
// Ignore messages originating from phone (from the current node 0x0) unless range test or store and forward module are enabled
static bool shouldDrawMessage(const meshtastic_MeshPacket *packet)
{
return packet->from != 0 && !moduleConfig.range_test.enabled && !moduleConfig.store_forward.enabled;
Expand Down Expand Up @@ -442,7 +442,7 @@ static void drawWaypointFrame(OLEDDisplay *display, OLEDDisplayUiState *state, i
}
}

/// Draw a series of fields in a column, wrapping to multiple colums if needed
/// Draw a series of fields in a column, wrapping to multiple columns if needed
static void drawColumns(OLEDDisplay *display, int16_t x, int16_t y, const char **fields)
{
// The coordinates define the left starting point of the text
Expand Down Expand Up @@ -1789,7 +1789,7 @@ void DebugInfo::drawFrameSettings(OLEDDisplay *display, OLEDDisplayUiState *stat
heartbeat = !heartbeat;
#endif
}
// adjust Brightness cycle trough 1 to 254 as long as attachDuringLongPress is true
// adjust Brightness cycle through 1 to 254 as long as attachDuringLongPress is true
void Screen::adjustBrightness()
{
if (!useDisplay)
Expand Down
2 changes: 1 addition & 1 deletion src/graphics/TFTDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void TFTDisplay::display(void)

for (y = 0; y < displayHeight; y++) {
for (x = 0; x < displayWidth; x++) {
// get src pixel in the page based ordering the OLED lib uses FIXME, super inefficent
// get src pixel in the page based ordering the OLED lib uses FIXME, super inefficient
auto isset = buffer[x + (y / 8) * displayWidth] & (1 << (y & 7));
auto dblbuf_isset = buffer_back[x + (y / 8) * displayWidth] & (1 << (y & 7));
if (isset != dblbuf_isset) {
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ SPISettings spiSettings(4000000, MSBFIRST, SPI_MODE0);
RadioInterface *rIf = NULL;

/**
* Some platforms (nrf52) might provide an alterate version that supresses calling delay from sleep.
* Some platforms (nrf52) might provide an alterate version that suppresses calling delay from sleep.
*/
__attribute__((weak, noinline)) bool loopCanSleep()
{
Expand Down Expand Up @@ -710,7 +710,7 @@ uint32_t rebootAtMsec; // If not zero we will reboot at this time (used to reb
uint32_t shutdownAtMsec; // If not zero we will shutdown at this time (used to shutdown from python or mobile client)

// If a thread does something that might need for it to be rescheduled ASAP it can set this flag
// This will supress the current delay and instead try to run ASAP.
// This will suppress the current delay and instead try to run ASAP.
bool runASAP;

extern meshtastic_DeviceMetadata getDeviceMetadata()
Expand Down
2 changes: 1 addition & 1 deletion src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ extern uint32_t shutdownAtMsec;
extern uint32_t serialSinceMsec;

// If a thread does something that might need for it to be rescheduled ASAP it can set this flag
// This will supress the current delay and instead try to run ASAP.
// This will suppress the current delay and instead try to run ASAP.
extern bool runASAP;

void nrf52Setup(), esp32Setup(), nrf52Loop(), esp32Loop(), clearBonds();
Expand Down
2 changes: 1 addition & 1 deletion src/mesh/Channels.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Channels
/// The index of the primary channel
ChannelIndex primaryIndex = 0;

/** The channel index that was requested for sending/receving. Note: if this channel is a secondary
/** The channel index that was requested for sending/receiving. Note: if this channel is a secondary
channel and does not have a PSK, we will use the PSK from the primary channel. If this channel is disabled
no sending or receiving will be allowed */
ChannelIndex activeChannelIndex = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/mesh/FloodingRouter.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class FloodingRouter : public Router, protected PacketHistory
/**
* Should this incoming filter be dropped?
*
* Called immedately on receiption, before any further processing.
* Called immediately on reception, before any further processing.
* @return true to abandon the packet
*/
virtual bool shouldFilterReceived(const meshtastic_MeshPacket *p) override;
Expand Down
6 changes: 3 additions & 3 deletions src/mesh/MeshModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ meshtastic_MeshPacket *MeshModule::currentReply;

MeshModule::MeshModule(const char *_name) : name(_name)
{
// Can't trust static initalizer order, so we check each time
// Can't trust static initializer order, so we check each time
if (!modules)
modules = new std::vector<MeshModule *>();

Expand All @@ -39,7 +39,7 @@ meshtastic_MeshPacket *MeshModule::allocAckNak(meshtastic_Routing_Error err, Nod
c.error_reason = err;
c.which_variant = meshtastic_Routing_error_reason_tag;

// Now that we have moded sendAckNak up one level into the class heirarchy we can no longer assume we are a RoutingPlugin
// Now that we have moded sendAckNak up one level into the class hierarchy we can no longer assume we are a RoutingPlugin
// So we manually call pb_encode_to_bytes and specify routing port number
// auto p = allocDataProtobuf(c);
meshtastic_MeshPacket *p = router->allocForSending();
Expand Down Expand Up @@ -169,7 +169,7 @@ void MeshModule::callPlugins(const meshtastic_MeshPacket &mp, RxSource src)
// Note: if the message started with the local node or a module asked to ignore the request, we don't want to send a
// no response reply

// No one wanted to reply to this requst, tell the requster that happened
// No one wanted to reply to this request, tell the requster that happened
LOG_DEBUG("No one responded, send a nak\n");

// SECURITY NOTE! I considered sending back a different error code if we didn't find the psk (i.e. !isDecoded)
Expand Down
2 changes: 1 addition & 1 deletion src/mesh/MeshModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ typedef struct _UIFrameEvent {
* A key concept for this is that your module should use a particular "portnum" for each message type you want to receive
* and handle.
*
* Interally we use modules to implement the core meshtastic text messaging and gps position sharing features. You
* Internally we use modules to implement the core meshtastic text messaging and gps position sharing features. You
* can use these classes as examples for how to write your own custom module. See here: (FIXME)
*/
class MeshModule
Expand Down
2 changes: 1 addition & 1 deletion src/mesh/MeshService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ arbitrating to select a node number and keeping the current nodedb.

/* Broadcast when a newly powered mesh node wants to find a node num it can use
The algoritm is as follows:
The algorithm is as follows:
* when a node starts up, it broadcasts their user and the normal flow is for all other nodes to reply with their User as well (so
the new node can build its node db)
* If a node ever receives a User (not just the first broadcast) message where the sender node number equals our node number, that
Expand Down
2 changes: 1 addition & 1 deletion src/mesh/MeshService.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class MeshService

private:
/// Called when our gps position has changed - updates nodedb and sends Location message out into the mesh
/// returns 0 to allow futher processing
/// returns 0 to allow further processing
int onGPSChanged(const meshtastic::GPSStatus *arg);

/// Handle a packet that just arrived from the radio. This method does _ReliableRouternot_ free the provided packet. If it
Expand Down
2 changes: 1 addition & 1 deletion src/mesh/MeshTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ typedef uint32_t PacketId; // A packet sequence number
#define ERRNO_OK 0
#define ERRNO_NO_INTERFACES 33
#define ERRNO_UNKNOWN 32 // pick something that doesn't conflict with RH_ROUTER_ERROR_UNABLE_TO_DELIVER
#define ERRNO_DISABLED 34 // the itnerface is disabled
#define ERRNO_DISABLED 34 // the interface is disabled

/*
* Source of a received message
Expand Down
4 changes: 2 additions & 2 deletions src/mesh/NodeDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ bool NodeDB::factoryReset()
// third, write everything to disk
saveToDisk();
#ifdef ARCH_ESP32
// This will erase what's in NVS including ssl keys, persistant variables and ble pairing
// This will erase what's in NVS including ssl keys, persistent variables and ble pairing
nvs_flash_erase();
#endif
#ifdef ARCH_NRF52
Expand Down Expand Up @@ -911,7 +911,7 @@ void recordCriticalError(meshtastic_CriticalErrorCode code, uint32_t address, co
error_code = code;
error_address = address;

// Currently portuino is mostly used for simulation. Make sue the user notices something really bad happend
// Currently portuino is mostly used for simulation. Make sure the user notices something really bad happened
#ifdef ARCH_PORTDUINO
LOG_ERROR("A critical failure occurred, portduino is exiting...");
exit(2);
Expand Down
2 changes: 1 addition & 1 deletion src/mesh/NodeDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class NodeDB
meshtastic_NodeInfoLite *updateGUIforNode = NULL; // if currently showing this node, we think you should update the GUI
Observable<const meshtastic::NodeStatus *> newStatus;

/// don't do mesh based algoritm for node id assignment (initially)
/// don't do mesh based algorithm for node id assignment (initially)
/// instead just store in flash - possibly even in the initial alpha release do this hack
NodeDB();

Expand Down
4 changes: 2 additions & 2 deletions src/mesh/RF95Interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ bool RF95Interface::isChannelActive()
return false;
}

/** Could we send right now (i.e. either not actively receving or transmitting)? */
/** Could we send right now (i.e. either not actively receiving or transmitting)? */
bool RF95Interface::isActivelyReceiving()
{
return lora->isReceiving();
Expand All @@ -201,7 +201,7 @@ bool RF95Interface::isActivelyReceiving()
bool RF95Interface::sleep()
{
// put chipset into sleep mode
setStandby(); // First cancel any active receving/sending
setStandby(); // First cancel any active receiving/sending
lora->sleep();

return true;
Expand Down
Loading

0 comments on commit 003047b

Please sign in to comment.