mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 22:57:50 +03:00
style: apply clang-format
This commit is contained in:
parent
f611cc9615
commit
f3ec7b8800
@ -1,12 +1,14 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../Activity.h"
|
|
||||||
#include "../../extension/AppLoader.h"
|
|
||||||
#include <GfxRenderer.h>
|
#include <GfxRenderer.h>
|
||||||
#include <MappedInputManager.h>
|
#include <MappedInputManager.h>
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "../../extension/AppLoader.h"
|
||||||
|
#include "../Activity.h"
|
||||||
|
|
||||||
class AppsActivity : public Activity {
|
class AppsActivity : public Activity {
|
||||||
public:
|
public:
|
||||||
using ExitCallback = std::function<void()>;
|
using ExitCallback = std::function<void()>;
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
#include <EpdFontFamily.h>
|
#include <EpdFontFamily.h>
|
||||||
#include <GfxRenderer.h>
|
#include <GfxRenderer.h>
|
||||||
#include <builtinFonts/all.h>
|
#include <builtinFonts/all.h>
|
||||||
|
|
||||||
#include <esp_attr.h>
|
#include <esp_attr.h>
|
||||||
#include <esp_ota_ops.h>
|
#include <esp_ota_ops.h>
|
||||||
#include <esp_system.h>
|
#include <esp_system.h>
|
||||||
@ -17,7 +16,7 @@ namespace {
|
|||||||
EpdFont ui12RegularFont(&ubuntu_12_regular);
|
EpdFont ui12RegularFont(&ubuntu_12_regular);
|
||||||
EpdFont ui12BoldFont(&ubuntu_12_bold);
|
EpdFont ui12BoldFont(&ubuntu_12_bold);
|
||||||
EpdFontFamily ui12FontFamily(&ui12RegularFont, &ui12BoldFont);
|
EpdFontFamily ui12FontFamily(&ui12RegularFont, &ui12BoldFont);
|
||||||
}
|
} // namespace
|
||||||
|
|
||||||
HelloWorldActivity::HelloWorldActivity(HalDisplay& display, HalGPIO& input)
|
HelloWorldActivity::HelloWorldActivity(HalDisplay& display, HalGPIO& input)
|
||||||
: display_(display), input_(input), needsUpdate_(true) {}
|
: display_(display), input_(input), needsUpdate_(true) {}
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
#include "AppLoader.h"
|
#include "AppLoader.h"
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <esp_ota_ops.h>
|
#include <esp_ota_ops.h>
|
||||||
#include <esp_partition.h>
|
#include <esp_partition.h>
|
||||||
#include <esp_system.h>
|
#include <esp_system.h>
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "Battery.h"
|
#include "Battery.h"
|
||||||
|
|
||||||
namespace CrossPoint {
|
namespace CrossPoint {
|
||||||
@ -85,8 +86,8 @@ AppManifest AppLoader::parseManifest(const String& path) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fileSize > MAX_MANIFEST_SIZE) {
|
if (fileSize > MAX_MANIFEST_SIZE) {
|
||||||
Serial.printf("[%lu] [AppLoader] Manifest file too large (%u bytes, max %u): %s\n",
|
Serial.printf("[%lu] [AppLoader] Manifest file too large (%u bytes, max %u): %s\n", millis(), fileSize,
|
||||||
millis(), fileSize, MAX_MANIFEST_SIZE, path.c_str());
|
MAX_MANIFEST_SIZE, path.c_str());
|
||||||
file.close();
|
file.close();
|
||||||
return manifest;
|
return manifest;
|
||||||
}
|
}
|
||||||
@ -97,8 +98,8 @@ AppManifest AppLoader::parseManifest(const String& path) {
|
|||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
if (bytesRead != fileSize) {
|
if (bytesRead != fileSize) {
|
||||||
Serial.printf("[%lu] [AppLoader] Failed to read complete manifest file (read %u of %u bytes): %s\n",
|
Serial.printf("[%lu] [AppLoader] Failed to read complete manifest file (read %u of %u bytes): %s\n", millis(),
|
||||||
millis(), bytesRead, fileSize, path.c_str());
|
bytesRead, fileSize, path.c_str());
|
||||||
return manifest;
|
return manifest;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,8 +114,7 @@ AppManifest AppLoader::parseManifest(const String& path) {
|
|||||||
const DeserializationError error = deserializeJson(doc, json);
|
const DeserializationError error = deserializeJson(doc, json);
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
Serial.printf("[%lu] [AppLoader] JSON parse error in %s: %s\n",
|
Serial.printf("[%lu] [AppLoader] JSON parse error in %s: %s\n", millis(), path.c_str(), error.c_str());
|
||||||
millis(), path.c_str(), error.c_str());
|
|
||||||
return manifest;
|
return manifest;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,8 +307,6 @@ String AppLoader::buildManifestPath(const String& appDir) const {
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AppLoader::isSDReady() const {
|
bool AppLoader::isSDReady() const { return SdMan.ready(); }
|
||||||
return SdMan.ready();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
} // namespace CrossPoint
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <ArduinoJson.h>
|
#include <ArduinoJson.h>
|
||||||
#include <WString.h>
|
|
||||||
#include <vector>
|
|
||||||
#include <functional>
|
|
||||||
#include <SDCardManager.h>
|
#include <SDCardManager.h>
|
||||||
|
#include <WString.h>
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
namespace CrossPoint {
|
namespace CrossPoint {
|
||||||
|
|
||||||
|
|||||||
@ -15,9 +15,9 @@
|
|||||||
#include "KOReaderCredentialStore.h"
|
#include "KOReaderCredentialStore.h"
|
||||||
#include "MappedInputManager.h"
|
#include "MappedInputManager.h"
|
||||||
#include "RecentBooksStore.h"
|
#include "RecentBooksStore.h"
|
||||||
|
#include "activities/apps/AppsActivity.h"
|
||||||
#include "activities/boot_sleep/BootActivity.h"
|
#include "activities/boot_sleep/BootActivity.h"
|
||||||
#include "activities/boot_sleep/SleepActivity.h"
|
#include "activities/boot_sleep/SleepActivity.h"
|
||||||
#include "activities/apps/AppsActivity.h"
|
|
||||||
#include "activities/browser/OpdsBookBrowserActivity.h"
|
#include "activities/browser/OpdsBookBrowserActivity.h"
|
||||||
#include "activities/home/HomeActivity.h"
|
#include "activities/home/HomeActivity.h"
|
||||||
#include "activities/home/MyLibraryActivity.h"
|
#include "activities/home/MyLibraryActivity.h"
|
||||||
|
|||||||
@ -9,9 +9,9 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include "html/AppsPageHtml.generated.h"
|
||||||
#include "html/FilesPageHtml.generated.h"
|
#include "html/FilesPageHtml.generated.h"
|
||||||
#include "html/HomePageHtml.generated.h"
|
#include "html/HomePageHtml.generated.h"
|
||||||
#include "html/AppsPageHtml.generated.h"
|
|
||||||
#include "util/StringUtils.h"
|
#include "util/StringUtils.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -525,8 +525,8 @@ static bool isValidAppId(const String& appId) {
|
|||||||
}
|
}
|
||||||
for (size_t i = 0; i < appId.length(); i++) {
|
for (size_t i = 0; i < appId.length(); i++) {
|
||||||
const char c = appId.charAt(i);
|
const char c = appId.charAt(i);
|
||||||
const bool ok = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '.' ||
|
const bool ok =
|
||||||
c == '_' || c == '-';
|
(c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '.' || c == '_' || c == '-';
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user