Skip to content

Commit

Permalink
provisioning: Finetune LED check thresholds
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Kipshagen committed Feb 7, 2025
1 parent 5943051 commit a4ef854
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions provisioning/provision_stage_3_warp2.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,13 +470,11 @@ def is_front_panel_led_white(self):
color = self.try_action('20D', lambda device: device.get_color())

# White can saturate the sensor
if color[0] == 65535 and color[1] == 65535 and color[2] == 65535 and color[3] == 65535:
if color[0] >= 60000 and color[1] >= 60000 and color[2] >= 60000 and color[3] >= 60000:
return True


return color[0] / color[3] < 0.5 and color[1] / color[3] < 0.5 and color[2] / color[3] < 0.5 and color[3] > 10000


# internal
def check_iec_state(self, expected_state):
assert self.get_iec_state_function != None
Expand Down Expand Up @@ -651,7 +649,7 @@ def test_front_panel_button(self, automatic):
fatal_error('Front panel button is already pressed before test')

if not led_before:
fatal_error('Front panel LED is not on before test')
fatal_error('Front panel LED is not blue before test')

if automatic:
self.set_servo_position(servo, channel, -3000)
Expand Down Expand Up @@ -681,7 +679,7 @@ def test_front_panel_button(self, automatic):
fatal_error('Front panel button is not pressed during test')

if led_pressed:
fatal_error('Front panel LED is still on during test')
fatal_error('Front panel LED is still blue during test')

if not automatic:
print(green('Waiting for front panel button release'))
Expand Down

0 comments on commit a4ef854

Please sign in to comment.