Skip to content

Commit bfceae2

Browse files
committed
version 2.3
1 parent a75fa06 commit bfceae2

7 files changed

Lines changed: 22 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## Future
1+
## 2.3
22

33
- ControllerV2: Fix automatic active slots count for back buttons
4+
- Add reset option
45

56
## 2.2
67

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.23)
22

3-
project(OpenWinControlsCLI VERSION 2.2 DESCRIPTION "Multiplatform GPD WinControls replacement (command-line)" LANGUAGES CXX)
3+
project(OpenWinControlsCLI VERSION 2.3 DESCRIPTION "Multiplatform GPD WinControls replacement (command-line)" LANGUAGES CXX)
44

55
set(PROJECT_AUTHOR "kylon")
66
set(CMAKE_CXX_STANDARD 20)

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ and hold time (**l4h**) to something high like **300**.
5151
### Help
5252

5353
```text
54-
OpenWinControlsCLI 2.2
54+
OpenWinControlsCLI 2.3
5555
5656
Usage: OpenWinControlsCLI command [args]
5757
@@ -80,6 +80,9 @@ Commands:
8080
8181
print
8282
Print current firmware settings
83+
84+
reset
85+
Reset controller memory to a known working state
8386
8487
Options:
8588

src/Utils.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,4 +662,13 @@ namespace OWCL {
662662

663663
return 0;
664664
}
665+
666+
int resetConfig(const std::shared_ptr<OWC::Controller> &gpd) {
667+
if (!gpd->resetConfig()) {
668+
std::cerr << "failed to reset controller memory\n";
669+
return 1;
670+
}
671+
672+
return 0;
673+
}
665674
}

src/Utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ namespace OWCL {
2727
[[nodiscard]] int exportToYaml(const std::shared_ptr<OWC::Controller> &gpd, const std::string &fileName);
2828
[[nodiscard]] int importFromYaml(const std::shared_ptr<OWC::Controller> &gpd, const std::string &fileName);
2929
[[nodiscard]] int writeConfig(const std::shared_ptr<OWC::Controller> &gpd, const OWC::CMDParser &cmd);
30+
[[nodiscard]] int resetConfig(const std::shared_ptr<OWC::Controller> &gpd);
3031
}

src/classes/CMDParser.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ namespace OWC {
5353
" apply mapping from file\n\n"
5454
" print\n"
5555
" Print current firmware settings\n\n"
56+
" reset\n"
57+
" Reset controller memory to a known working state\n\n"
5658

5759
"Options:\n\n"
5860
" du [key]\n"
@@ -306,7 +308,7 @@ namespace OWC {
306308
showXKeys();
307309
return false;
308310

309-
} else if (isArg("print")) {
311+
} else if (isArg("print") || isArg("reset")) {
310312
args.emplace(argV[0], 0);
311313
return true;
312314

src/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ int main(int argc, char *argv[]) {
173173

174174
if (cmdParser.hasArg("print"))
175175
OWCL::printCurrentSettings(gpd);
176+
else if (cmdParser.hasArg("reset"))
177+
return OWCL::resetConfig(gpd);
176178
else if (cmdParser.hasArg("export"))
177179
return OWCL::exportToYaml(gpd, std::get<std::string>(cmdParser.getValue("export")));
178180
else if (cmdParser.hasArg("import"))

0 commit comments

Comments
 (0)