From b8d1ca8e6bb6a2036e8cb287a7fb7a4080b82f14 Mon Sep 17 00:00:00 2001 From: Lucas Peng Date: Fri, 10 Jul 2026 00:30:20 -0700 Subject: [PATCH] set/import: commit config to controller flash after writing Call the new flushConfig() after a successful writeConfig() in both the set and import paths, so V2 (Win Mini 2025 / 2f24:0137) mappings survive reboot and suspend without toggling the mode switch or re-applying on every boot. flushConfig() is a base-class no-op for V1 controllers. The flash commit replays the official app's bracket choreography and takes ~12s; print a heads-up so the pause is not mistaken for a hang. Requires the libOpenWinControls flushConfig() implementation. --- src/Utils.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Utils.cpp b/src/Utils.cpp index 1da6e25..3ab2cf1 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -509,6 +509,12 @@ namespace OWCL { return 1; } + // commit RAM->flash so the mapping survives a controller reset / reboot + std::cout << "config applied, committing to controller flash (takes ~12s) ...\n"; + + if (!gpd->flushConfig()) + std::cerr << "warning: config applied but flush-to-flash failed (not permanent)\n"; + std::cout << "applied config from " << fileName << "\n"; return 0; } @@ -662,6 +668,12 @@ namespace OWCL { return 1; } + // commit RAM->flash so the mapping survives a controller reset / reboot + std::cout << "config applied, committing to controller flash (takes ~12s) ...\n"; + + if (!gpd->flushConfig()) + std::cerr << "warning: config applied but flush-to-flash failed (not permanent)\n"; + return 0; }