Servod: Updating to fix the keypress value issue

In keyboard.xml, 'map="keypress_duration"' restrict the key press control to
just the 'tab', 'press', and 'long_press' settings. This creates the problem
for the 'press' value triggered from Autotest like 'dut-control power_key:0.5'
& 'dut-control ctrl_d:0.1'.

And autotests are failing with error "Map keypress_duration doesn't contain
key \nTry one of -> 'press', 'long_press', 'tab'".

So adding new params in map (tab="0.1" & short_press="0.2") and mapping them
to the keys when autotest calling keypress without passing any values
(eg. self.servo.ctrl_d()).

And also added the try-except block in resolve_val to pass the ValueError
for the proper logging of error message at the end.

TEST=Verified & firmware_ECPowerButton tests on
Octopus-Yorp board, tests are passing. And also verified the following key
press events.
dut-control power_key_val:0.5
dut-control power_key:tab
dut-control power_key:press
dut-control power_key:long_press
dut-control ctrl_d:0.1

Change-Id: I3ae3d8c672c32f980a013f42c21554807fc17d08
Signed-off-by: Lenine Ajagappane <>
Commit-Ready: Ruben Rodriguez Buchillon <>
Tested-by: Ruben Rodriguez Buchillon <>
Reviewed-by: Ruben Rodriguez Buchillon <>
3 files changed