mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-07 15:07:33 -06:00
command: Allow count parameter of DECL_ENUMERATION_RANGE() to be an expression
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
84fd89b8cf
commit
7d014933ce
2 changed files with 5 additions and 8 deletions
|
@ -86,12 +86,9 @@ class HandleEnumerations:
|
|||
enum, name, value = req.split()[1:]
|
||||
self.add_enumeration(enum, name, decode_integer(value))
|
||||
def decl_enumeration_range(self, req):
|
||||
enum, name, count, value = req.split()[1:]
|
||||
try:
|
||||
count = int(count, 0)
|
||||
except ValueError as e:
|
||||
error("Invalid enumeration count in '%s'" % (req,))
|
||||
self.add_enumeration(enum, name, (decode_integer(value), count))
|
||||
enum, name, value, count = req.split()[1:]
|
||||
vc = (decode_integer(value), decode_integer(count))
|
||||
self.add_enumeration(enum, name, vc)
|
||||
def decl_static_str(self, req):
|
||||
msg = req.split(None, 1)[1]
|
||||
if msg not in self.static_strings:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue