Skip to content

Commit 6a257be

Browse files
committed
Add option to skip version check.
1 parent ce3288d commit 6a257be

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

gpdconfig/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def main():
2222
parser.add_argument("-d","--dump", metavar="FILE", help="Dump config to FILE")
2323
parser.add_argument("-r","--reset", action="store_true", help="Reset to defaults")
2424
parser.add_argument("-v","--verbose", action="store_true", help="Output current config to stdout")
25+
parser.add_argument("-x","--disable-version-check", dest="fwcheck", action="store_true", help="Disable FW version check")
2526

2627
group = parser.add_argument_group("Informational options")
2728
group.add_argument("-c","--fields", action="store_true", help="List available fields")
@@ -55,7 +56,7 @@ def main():
5556
return
5657

5758
# Read the current configuration from the device
58-
wc = WinControls()
59+
wc = WinControls(disableFwCheck=options.fwcheck)
5960

6061
if wc.loaded and options.dump:
6162
with open(options.dump,"w") as wf:

gpdconfig/wincontrols/hardware.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from .config import *
66
from . import hid
77

8-
class WinControls(object):
8+
class WinControls():
99
"""Class for reading and writing configuration to the GPD Win controller hardware."""
1010

1111
# Map of fields and their offsets in the binary configuration
@@ -73,7 +73,8 @@ class WinControls(object):
7373

7474
field = {f.name: f for f in _fields}
7575

76-
def __init__(self, read=True):
76+
def __init__(self, read=True, disableFwCheck=False):
77+
self.disableFwCheck = disableFwCheck
7778
self._openHid()
7879
self.loaded = False
7980
if read:
@@ -119,6 +120,8 @@ def _parseResponse(self, response):
119120
}
120121

121122
def _checkDevice(self):
123+
if self.disableFwCheck:
124+
return
122125
supported = ['K504', 'K407']
123126
info = self._parseResponse(self._response)
124127
if info['Kfirmware'] not in supported:

0 commit comments

Comments
 (0)