mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2025-12-18 15:17:42 +03:00
Small cleanup
This commit is contained in:
parent
4ecfdea1a1
commit
ad8cee12ab
@ -5,7 +5,6 @@
|
|||||||
inline int min(const int a, const int b) { return a < b ? a : b; }
|
inline int min(const int a, const int b) { return a < b ? a : b; }
|
||||||
inline int max(const int a, const int b) { return a < b ? b : a; }
|
inline int max(const int a, const int b) { return a < b ? b : a; }
|
||||||
|
|
||||||
// TODO: Text properties??
|
|
||||||
void EpdFont::getTextBounds(const char* string, const int startX, const int startY, int* minX, int* minY, int* maxX,
|
void EpdFont::getTextBounds(const char* string, const int startX, const int startY, int* minX, int* minY, int* maxX,
|
||||||
int* maxY) const {
|
int* maxY) const {
|
||||||
*minX = startX;
|
*minX = startX;
|
||||||
|
|||||||
@ -12,8 +12,6 @@ void Section::onPageComplete(const Page* page) {
|
|||||||
Serial.printf("Page %d complete\n", pageCount);
|
Serial.printf("Page %d complete\n", pageCount);
|
||||||
|
|
||||||
const auto filePath = cachePath + "/page_" + std::to_string(pageCount) + ".bin";
|
const auto filePath = cachePath + "/page_" + std::to_string(pageCount) + ".bin";
|
||||||
// TODO can this be removed?
|
|
||||||
SD.open(filePath.c_str(), FILE_WRITE).close();
|
|
||||||
|
|
||||||
std::ofstream outputFile("/sd" + filePath);
|
std::ofstream outputFile("/sd" + filePath);
|
||||||
page->serialize(outputFile);
|
page->serialize(outputFile);
|
||||||
|
|||||||
@ -205,7 +205,7 @@ void loop() {
|
|||||||
delay(10);
|
delay(10);
|
||||||
|
|
||||||
static unsigned long lastMemPrint = 0;
|
static unsigned long lastMemPrint = 0;
|
||||||
if (Serial && millis() - lastMemPrint >= 2000) {
|
if (Serial && millis() - lastMemPrint >= 5000) {
|
||||||
Serial.printf("[%lu] Memory - Free: %d bytes, Total: %d bytes, Min Free: %d bytes\n", millis(), ESP.getFreeHeap(),
|
Serial.printf("[%lu] Memory - Free: %d bytes, Total: %d bytes, Min Free: %d bytes\n", millis(), ESP.getFreeHeap(),
|
||||||
ESP.getHeapSize(), ESP.getMinFreeHeap());
|
ESP.getHeapSize(), ESP.getMinFreeHeap());
|
||||||
lastMemPrint = millis();
|
lastMemPrint = millis();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user