mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 14:47:37 +03:00
clang format fix
This commit is contained in:
parent
e77321c26d
commit
623ea25d65
@ -45,8 +45,6 @@ void validateFrontButtonMapping(CrossPointSettings& settings) {
|
|||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool CrossPointSettings::saveToFile() const {
|
bool CrossPointSettings::saveToFile() const {
|
||||||
// Make sure the directory exists
|
// Make sure the directory exists
|
||||||
SdMan.mkdir("/.crosspoint");
|
SdMan.mkdir("/.crosspoint");
|
||||||
@ -63,7 +61,7 @@ bool CrossPointSettings::saveToFile() const {
|
|||||||
serialization::writePod(outputFile, shortPwrBtn);
|
serialization::writePod(outputFile, shortPwrBtn);
|
||||||
serialization::writePod(outputFile, statusBar);
|
serialization::writePod(outputFile, statusBar);
|
||||||
serialization::writePod(outputFile, orientation);
|
serialization::writePod(outputFile, orientation);
|
||||||
serialization::writePod(outputFile, frontButtonLayout); // legacy
|
serialization::writePod(outputFile, frontButtonLayout); // legacy
|
||||||
serialization::writePod(outputFile, sideButtonLayout);
|
serialization::writePod(outputFile, sideButtonLayout);
|
||||||
serialization::writePod(outputFile, fontFamily);
|
serialization::writePod(outputFile, fontFamily);
|
||||||
serialization::writePod(outputFile, fontSize);
|
serialization::writePod(outputFile, fontSize);
|
||||||
@ -124,7 +122,7 @@ bool CrossPointSettings::loadFromFile() {
|
|||||||
if (++settingsRead >= fileSettingsCount) break;
|
if (++settingsRead >= fileSettingsCount) break;
|
||||||
readAndValidate(inputFile, orientation, ORIENTATION_COUNT);
|
readAndValidate(inputFile, orientation, ORIENTATION_COUNT);
|
||||||
if (++settingsRead >= fileSettingsCount) break;
|
if (++settingsRead >= fileSettingsCount) break;
|
||||||
readAndValidate(inputFile, frontButtonLayout, FRONT_BUTTON_LAYOUT_COUNT); // legacy
|
readAndValidate(inputFile, frontButtonLayout, FRONT_BUTTON_LAYOUT_COUNT); // legacy
|
||||||
if (++settingsRead >= fileSettingsCount) break;
|
if (++settingsRead >= fileSettingsCount) break;
|
||||||
readAndValidate(inputFile, sideButtonLayout, SIDE_BUTTON_LAYOUT_COUNT);
|
readAndValidate(inputFile, sideButtonLayout, SIDE_BUTTON_LAYOUT_COUNT);
|
||||||
if (++settingsRead >= fileSettingsCount) break;
|
if (++settingsRead >= fileSettingsCount) break;
|
||||||
|
|||||||
@ -19,31 +19,31 @@ class ButtonRemapActivity final : public Activity {
|
|||||||
void loop() override;
|
void loop() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Rendering task state.
|
// Rendering task state.
|
||||||
TaskHandle_t displayTaskHandle = nullptr;
|
TaskHandle_t displayTaskHandle = nullptr;
|
||||||
SemaphoreHandle_t renderingMutex = nullptr;
|
SemaphoreHandle_t renderingMutex = nullptr;
|
||||||
bool updateRequired = false;
|
bool updateRequired = false;
|
||||||
|
|
||||||
// Callback used to exit the remap flow back to the settings list.
|
// Callback used to exit the remap flow back to the settings list.
|
||||||
const std::function<void()> onBack;
|
const std::function<void()> onBack;
|
||||||
// Index of the logical role currently awaiting input.
|
// Index of the logical role currently awaiting input.
|
||||||
uint8_t currentStep = 0;
|
uint8_t currentStep = 0;
|
||||||
// Temporary mapping from logical role -> hardware button index.
|
// Temporary mapping from logical role -> hardware button index.
|
||||||
uint8_t tempMapping[4] = {0xFF, 0xFF, 0xFF, 0xFF};
|
uint8_t tempMapping[4] = {0xFF, 0xFF, 0xFF, 0xFF};
|
||||||
// Error banner timing (used when reassigning duplicate buttons).
|
// Error banner timing (used when reassigning duplicate buttons).
|
||||||
unsigned long errorUntil = 0;
|
unsigned long errorUntil = 0;
|
||||||
std::string errorMessage;
|
std::string errorMessage;
|
||||||
|
|
||||||
// FreeRTOS task helpers.
|
// FreeRTOS task helpers.
|
||||||
static void taskTrampoline(void* param);
|
static void taskTrampoline(void* param);
|
||||||
[[noreturn]] void displayTaskLoop();
|
[[noreturn]] void displayTaskLoop();
|
||||||
void render();
|
void render();
|
||||||
|
|
||||||
// Commit temporary mapping to settings.
|
// Commit temporary mapping to settings.
|
||||||
void applyTempMapping();
|
void applyTempMapping();
|
||||||
// Returns false if a hardware button is already assigned to a different role.
|
// Returns false if a hardware button is already assigned to a different role.
|
||||||
bool validateUnassigned(uint8_t pressedButton);
|
bool validateUnassigned(uint8_t pressedButton);
|
||||||
// Labels for UI display.
|
// Labels for UI display.
|
||||||
const char* getRoleName(uint8_t roleIndex) const;
|
const char* getRoleName(uint8_t roleIndex) const;
|
||||||
const char* getHardwareName(uint8_t buttonIndex) const;
|
const char* getHardwareName(uint8_t buttonIndex) const;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -40,12 +40,12 @@ const SettingInfo readerSettings[readerSettingsCount] = {
|
|||||||
|
|
||||||
constexpr int controlsSettingsCount = 4;
|
constexpr int controlsSettingsCount = 4;
|
||||||
const SettingInfo controlsSettings[controlsSettingsCount] = {
|
const SettingInfo controlsSettings[controlsSettingsCount] = {
|
||||||
// Launches the remap wizard for front buttons.
|
// Launches the remap wizard for front buttons.
|
||||||
SettingInfo::Action("Remap Front Buttons"),
|
SettingInfo::Action("Remap Front Buttons"),
|
||||||
SettingInfo::Enum("Side Button Layout (reader)", &CrossPointSettings::sideButtonLayout,
|
SettingInfo::Enum("Side Button Layout (reader)", &CrossPointSettings::sideButtonLayout,
|
||||||
{"Prev, Next", "Next, Prev"}),
|
{"Prev, Next", "Next, Prev"}),
|
||||||
SettingInfo::Toggle("Long-press Chapter Skip", &CrossPointSettings::longPressChapterSkip),
|
SettingInfo::Toggle("Long-press Chapter Skip", &CrossPointSettings::longPressChapterSkip),
|
||||||
SettingInfo::Enum("Short Power Button Click", &CrossPointSettings::shortPwrBtn, {"Ignore", "Sleep", "Page Turn"})};
|
SettingInfo::Enum("Short Power Button Click", &CrossPointSettings::shortPwrBtn, {"Ignore", "Sleep", "Page Turn"})};
|
||||||
|
|
||||||
constexpr int systemSettingsCount = 5;
|
constexpr int systemSettingsCount = 5;
|
||||||
const SettingInfo systemSettings[systemSettingsCount] = {
|
const SettingInfo systemSettings[systemSettingsCount] = {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user