clang format fix

This commit is contained in:
Arthur Tazhitdinov 2026-02-02 15:03:47 +03:00
parent e77321c26d
commit 623ea25d65
3 changed files with 18 additions and 20 deletions

View File

@ -45,8 +45,6 @@ void validateFrontButtonMapping(CrossPointSettings& settings) {
}
} // namespace
bool CrossPointSettings::saveToFile() const {
// Make sure the directory exists
SdMan.mkdir("/.crosspoint");
@ -63,7 +61,7 @@ bool CrossPointSettings::saveToFile() const {
serialization::writePod(outputFile, shortPwrBtn);
serialization::writePod(outputFile, statusBar);
serialization::writePod(outputFile, orientation);
serialization::writePod(outputFile, frontButtonLayout); // legacy
serialization::writePod(outputFile, frontButtonLayout); // legacy
serialization::writePod(outputFile, sideButtonLayout);
serialization::writePod(outputFile, fontFamily);
serialization::writePod(outputFile, fontSize);
@ -124,7 +122,7 @@ bool CrossPointSettings::loadFromFile() {
if (++settingsRead >= fileSettingsCount) break;
readAndValidate(inputFile, orientation, ORIENTATION_COUNT);
if (++settingsRead >= fileSettingsCount) break;
readAndValidate(inputFile, frontButtonLayout, FRONT_BUTTON_LAYOUT_COUNT); // legacy
readAndValidate(inputFile, frontButtonLayout, FRONT_BUTTON_LAYOUT_COUNT); // legacy
if (++settingsRead >= fileSettingsCount) break;
readAndValidate(inputFile, sideButtonLayout, SIDE_BUTTON_LAYOUT_COUNT);
if (++settingsRead >= fileSettingsCount) break;

View File

@ -19,31 +19,31 @@ class ButtonRemapActivity final : public Activity {
void loop() override;
private:
// Rendering task state.
// Rendering task state.
TaskHandle_t displayTaskHandle = nullptr;
SemaphoreHandle_t renderingMutex = nullptr;
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;
// Index of the logical role currently awaiting input.
// Index of the logical role currently awaiting input.
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};
// Error banner timing (used when reassigning duplicate buttons).
// Error banner timing (used when reassigning duplicate buttons).
unsigned long errorUntil = 0;
std::string errorMessage;
// FreeRTOS task helpers.
// FreeRTOS task helpers.
static void taskTrampoline(void* param);
[[noreturn]] void displayTaskLoop();
void render();
// Commit temporary mapping to settings.
// Commit temporary mapping to settings.
void applyTempMapping();
// Returns false if a hardware button is already assigned to a different role.
bool validateUnassigned(uint8_t pressedButton);
// Labels for UI display.
// Returns false if a hardware button is already assigned to a different role.
bool validateUnassigned(uint8_t pressedButton);
// Labels for UI display.
const char* getRoleName(uint8_t roleIndex) const;
const char* getHardwareName(uint8_t buttonIndex) const;
};

View File

@ -40,12 +40,12 @@ const SettingInfo readerSettings[readerSettingsCount] = {
constexpr int controlsSettingsCount = 4;
const SettingInfo controlsSettings[controlsSettingsCount] = {
// Launches the remap wizard for front buttons.
SettingInfo::Action("Remap Front Buttons"),
SettingInfo::Enum("Side Button Layout (reader)", &CrossPointSettings::sideButtonLayout,
{"Prev, Next", "Next, Prev"}),
SettingInfo::Toggle("Long-press Chapter Skip", &CrossPointSettings::longPressChapterSkip),
SettingInfo::Enum("Short Power Button Click", &CrossPointSettings::shortPwrBtn, {"Ignore", "Sleep", "Page Turn"})};
// Launches the remap wizard for front buttons.
SettingInfo::Action("Remap Front Buttons"),
SettingInfo::Enum("Side Button Layout (reader)", &CrossPointSettings::sideButtonLayout,
{"Prev, Next", "Next, Prev"}),
SettingInfo::Toggle("Long-press Chapter Skip", &CrossPointSettings::longPressChapterSkip),
SettingInfo::Enum("Short Power Button Click", &CrossPointSettings::shortPwrBtn, {"Ignore", "Sleep", "Page Turn"})};
constexpr int systemSettingsCount = 5;
const SettingInfo systemSettings[systemSettingsCount] = {