Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions src/FSCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,44 +30,6 @@ SPIClass SPI_HSPI(HSPI);

#endif // HAS_SDCARD

/**
* @brief Copies a file from one location to another.
*
* @param from The path of the source file.
* @param to The path of the destination file.
* @return true if the file was successfully copied, false otherwise.
*/
bool copyFile(const char *from, const char *to)
{
#ifdef FSCom
// take SPI Lock
concurrency::LockGuard g(spiLock);
unsigned char cbuffer[16];

File f1 = FSCom.open(from, FILE_O_READ);
if (!f1) {
LOG_ERROR("Failed to open source file %s", from);
return false;
}

File f2 = FSCom.open(to, FILE_O_WRITE);
if (!f2) {
LOG_ERROR("Failed to open destination file %s", to);
return false;
}

while (f1.available() > 0) {
byte i = f1.read(cbuffer, 16);
f2.write(cbuffer, i);
}

f2.flush();
f2.close();
f1.close();
return true;
#endif
}

/**
* Renames a file from pathFrom to pathTo.
*
Expand Down
1 change: 0 additions & 1 deletion src/FSCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ using namespace Adafruit_LittleFS_Namespace;
#endif

void fsInit();
bool copyFile(const char *from, const char *to);
bool renameFile(const char *pathFrom, const char *pathTo);
bool fsFormat();
std::vector<meshtastic_FileInfo> getFiles(const char *dirname, uint8_t levels, size_t maxCount = 64, bool *wasLimited = nullptr);
Expand Down
35 changes: 0 additions & 35 deletions src/MessageStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "SafeFile.h"
#include "gps/RTC.h"
#include "memory/MemAudit.h"
#include <cassert>
#include <cstring> // memcpy

#ifndef MESSAGE_TEXT_POOL_SIZE
Expand Down Expand Up @@ -244,40 +243,6 @@ const StoredMessage *MessageStore::tryAddFromPacket(const meshtastic_MeshPacket
return &liveMessages.back();
}

const StoredMessage &MessageStore::addFromPacket(const meshtastic_MeshPacket &packet)
{
const StoredMessage *stored = tryAddFromPacket(packet);
assert(stored);
return *stored;
}

// Outgoing/manual message
void MessageStore::addFromString(uint32_t sender, uint8_t channelIndex, const std::string &text)
{
StoredMessage sm;

// Always use our local time (helper handles RTC vs boot time)
assignTimestamp(sm);

sm.sender = sender;
sm.channelIndex = channelIndex;
sm.textOffset = storeTextInPool(text.c_str(), text.size());
sm.textLength = text.size();

// Use the provided destination
sm.dest = sender;
sm.type = MessageType::DM_TO_US;

// Outgoing messages always start with unknown ack status
sm.ackStatus = AckStatus::NONE;

addLiveMessage(sm);

#if ENABLE_MESSAGE_PERSISTENCE
markMessageStoreUnsaved();
#endif
}

#if ENABLE_MESSAGE_PERSISTENCE

// Compact, fixed-size on-flash representation using offset + length
Expand Down
4 changes: 1 addition & 3 deletions src/MessageStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,8 @@ class MessageStore
void addLiveMessage(StoredMessage &&msg);
void addLiveMessage(const StoredMessage &msg); // convenience overload
const std::deque<StoredMessage> &getLiveMessages() const { return liveMessages; }
// Add new messages from packets. Returns nullptr if the packet is filtered out.
const StoredMessage *tryAddFromPacket(const meshtastic_MeshPacket &mp); // Incoming/outgoing -> RAM only
Comment thread
coderabbitai[bot] marked this conversation as resolved.
// Add new messages from packets or manual input
const StoredMessage &addFromPacket(const meshtastic_MeshPacket &mp); // Incoming/outgoing → RAM only
void addFromString(uint32_t sender, uint8_t channelIndex, const std::string &text); // Manual add

// Persistence methods (used only on boot/shutdown)
void saveToFlash(); // Save messages to flash
Expand Down
10 changes: 0 additions & 10 deletions src/SerialConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,6 @@ void consoleInit()
DEBUG_PORT.rpInit(); // Simply sets up semaphore
}

/// Print and flush an unclassified formatted console message.
void consolePrintf(const char *format, ...)
{
va_list arg;
va_start(arg, format);
console->vprintf(nullptr, format, arg);
va_end(arg);
console->flush();
}

/// Initialize console, protobuf transport, serial port, and worker thread state.
SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port), concurrency::OSThread("SerialConsole")
{
Expand Down
1 change: 0 additions & 1 deletion src/SerialConsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ class SerialConsole : public StreamAPI, public RedirectablePrint, private concur
};

// A simple wrapper to allow non class aware code write to the console
void consolePrintf(const char *format, ...);
void consoleInit();

extern SerialConsole *console;
12 changes: 0 additions & 12 deletions src/buzz/buzz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,18 +194,6 @@ void playBoop()
playTones(melody, sizeof(melody) / sizeof(ToneDuration));
}

void playLongPressLeadUp()
{
// An ascending lead-up sequence for long press - builds anticipation
ToneDuration melody[] = {
{NOTE_C3, 100}, // Start low
{NOTE_E3, 100}, // Step up
{NOTE_G3, 100}, // Keep climbing
{NOTE_B3, 150} // Peak with longer note for emphasis
};
playTones(melody, sizeof(melody) / sizeof(ToneDuration));
}

// Static state for progressive lead-up notes
static int leadUpNoteIndex = 0;
static const ToneDuration leadUpNotes[] = {
Expand Down
1 change: 0 additions & 1 deletion src/buzz/buzz.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ void play4ClickUp();
void playBoop();
void playChirp();
void playClick();
void playLongPressLeadUp();
bool playNextLeadUpNote(); // Play the next note in the lead-up sequence
void resetLeadUpSequence(); // Reset the lead-up sequence to start from beginning
5 changes: 0 additions & 5 deletions src/gps/GPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2201,11 +2201,6 @@ bool GPS::hasLock()
return false;
}

bool GPS::hasFlow()
{
return reader.passedChecksum() > 0;
}

bool GPS::whileActive()
{
unsigned int charsInBuf = 0;
Expand Down
3 changes: 0 additions & 3 deletions src/gps/GPS.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ class GPS : private concurrency::OSThread
/// 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; }

Expand Down
28 changes: 0 additions & 28 deletions src/gps/GeoCoord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,34 +496,6 @@ float GeoCoord::rangeMetersToRadians(double range_meters)
return (PI / (180 * 60)) * distance_nm;
}

/**
* Ported from http://www.edwilliams.org/avform147.htm#Intro
* @brief Convert from radians to range in meters on a great circle
* @param range_radians
* The range in radians
* @return Range in meters on a great circle
*/
float GeoCoord::rangeRadiansToMeters(double range_radians)
{
double distance_nm = ((180 * 60) / PI) * range_radians;
// 1 meter is 0.000539957 nm
return distance_nm * 0.000539957;
}

// Find distance from point to passed in point
int32_t GeoCoord::distanceTo(const GeoCoord &pointB)
{
return latLongToMeter(this->getLatitude() * 1e-7, this->getLongitude() * 1e-7, pointB.getLatitude() * 1e-7,
pointB.getLongitude() * 1e-7);
}

// Find bearing from point to passed in point
int32_t GeoCoord::bearingTo(const GeoCoord &pointB)
{
return bearing(this->getLatitude() * 1e-7, this->getLongitude() * 1e-7, pointB.getLatitude() * 1e-7,
pointB.getLongitude() * 1e-7);
}

/**
* Create a new point based on the passed-in point
* Ported from http://www.edwilliams.org/avform147.htm#LL
Expand Down
3 changes: 0 additions & 3 deletions src/gps/GeoCoord.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ class GeoCoord
static void convertWGS84ToOSGB36(const double lat, const double lon, double &osgb_Latitude, double &osgb_Longitude);
static float latLongToMeter(double lat_a, double lng_a, double lat_b, double lng_b);
static float bearing(double lat1, double lon1, double lat2, double lon2);
static float rangeRadiansToMeters(double range_radians);
static float rangeMetersToRadians(double range_meters);
static unsigned int bearingToDegrees(const char *bearing);
static const char *degreesToBearing(unsigned int degrees);
Expand All @@ -114,8 +113,6 @@ class GeoCoord
static double toDegrees(double r);

// Point to point conversions
int32_t distanceTo(const GeoCoord &pointB);
int32_t bearingTo(const GeoCoord &pointB);
std::shared_ptr<GeoCoord> pointAtDistance(double bearing, double range);

// Lat lon alt getters
Expand Down
34 changes: 0 additions & 34 deletions src/graphics/Screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1846,40 +1846,6 @@ void Screen::handleStartFirmwareUpdateScreen()
setFrameImmediateDraw(frames);
}

void Screen::blink()
{
#ifdef MESHTASTIC_LOCKDOWN
// L4: defensive guard. blink() paints arbitrary geometry, not node
// data, so it doesn't actually leak today. But it bypasses the normal
// ui->update() path that the lockdown short-circuit gates, so any
// future change that puts content into blink would silently leak past
// redaction. Refuse to draw when the redaction latch is set.
if (meshtastic_security::shouldRedactDisplay())
return;
#endif
setFastFramerate();
uint8_t count = 10;
dispdev->setBrightness(254);
while (count > 0) {
dispdev->fillRect(0, 0, dispdev->getWidth(), dispdev->getHeight());
#if GRAPHICS_TFT_COLORING_ENABLED
prepareFrameColorRegions();
#endif
dispdev->display();
delay(50);
dispdev->clear();
#if GRAPHICS_TFT_COLORING_ENABLED
prepareFrameColorRegions();
#endif
dispdev->display();
delay(50);
count = count - 1;
}
// The dispdev->setBrightness does not work for t-deck display, it seems to run the setBrightness function in
// OLEDDisplay.
dispdev->setBrightness(brightness);
}

void Screen::increaseBrightness()
{
brightness = ((brightness + 62) > 254) ? brightness : (brightness + 62);
Expand Down
2 changes: 0 additions & 2 deletions src/graphics/Screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,6 @@ class Screen : public concurrency::OSThread
*/
void doDeepSleep();

void blink();

// Draw north
float estimatedHeading(double lat, double lon);

Expand Down
5 changes: 0 additions & 5 deletions src/graphics/VirtualKeyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,11 +718,6 @@ void VirtualKeyboard::setInputText(const std::string &text)
inputText = text;
}

std::string VirtualKeyboard::getInputText() const
{
return inputText;
}

void VirtualKeyboard::setHeader(const std::string &header)
{
headerText = header;
Expand Down
1 change: 0 additions & 1 deletion src/graphics/VirtualKeyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class VirtualKeyboard

void draw(OLEDDisplay *display, int16_t offsetX, int16_t offsetY);
void setInputText(const std::string &text);
std::string getInputText() const;
void setHeader(const std::string &header);
void setCallback(std::function<void(const std::string &)> callback);

Expand Down
Loading
Loading