Commit ffba3aca authored by Theodor-Adrian Stana's avatar Theodor-Adrian Stana

sw: leds.py clears LED test bits on exit

parent 8a67d16a
......@@ -75,7 +75,9 @@ def main(bus,tname,inf,log):
try:
# First phase of LED test, enable pulse LED sequencing
bus.vv_write(CSR, 1 << CSR_FRONT_LED_EN_OFS)
val = bus.vv_read(CSR)
val |= (1 << CSR_FRONT_LED_EN_OFS)
bus.vv_write(CSR, val)
# The gateware should blink the LEDs, ask the operator for input
inp = raw_input("--> Are the channel LEDs blinking one by one? yes/no: ")
......@@ -91,7 +93,9 @@ def main(bus,tname,inf,log):
inp = raw_input('Please type "yes" or "no" to continue:')
# Second phase of LED test, enable status LED sequencing
bus.vv_write(CSR, 1 << CSR_STAT_LED_EN_OFS)
val &= ~(1 << CSR_FRONT_LED_EN_OFS)
val |= 1 << CSR_STAT_LED_EN_OFS
bus.vv_write(CSR, val)
# The gateware should blink the LEDs, ask the operator for input
inp = raw_input("--> Are the status LEDs blinking one by one? yes/no: ")
......@@ -113,3 +117,10 @@ def main(bus,tname,inf,log):
except BusWarning, e:
raise PtsError("SKT Warning: %s" % (e))
finally:
# Clean-up -- clear status and front LED test bits
val = bus.vv_read(CSR)
val &= ~((1 << CSR_FRONT_LED_EN_OFS) | (1 << CSR_STAT_LED_EN_OFS))
bus.vv_write(CSR, val)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment