fix HWIL tests

This commit is contained in:
Samuel Sadok
2020-11-16 18:14:16 +01:00
parent 89f67ba6b0
commit b32a455dda
3 changed files with 7 additions and 1 deletions
+1
View File
@@ -258,6 +258,7 @@ interfaces:
Setting this to False even though a brake resistor is connected is
harmless. Setting this to True even though no brake resistor is
connected can break the power supply.
Changes to this value require a reboot to take effect.
dc_bus_undervoltage_trip_level:
type: float32
+3
View File
@@ -40,6 +40,9 @@ class TestClosedLoopControlBase():
# Set brake resistor settings
axis_ctx.parent.handle.config.brake_resistance = float(axis_ctx.parent.yaml['brake-resistance'])
# The docs say this requires a reboot but here's a small secret:
# Since the brake resistor is also started in clear_errors() this
# circumvents the need for a reboot.
axis_ctx.parent.handle.config.enable_brake_resistor = True
# Set calibration settings
+3 -1
View File
@@ -106,6 +106,8 @@ class TestSimpleCANClosedLoop():
# Make sure there are no funny configurations active
logger.debug('Setting up clean configuration...')
axis_ctx.parent.erase_config_and_reboot()
axis_ctx.parent.handle.config.enable_brake_resistor = True
axis_ctx.parent.save_config_and_reboot()
# run calibration
axis_ctx.handle.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
@@ -162,7 +164,7 @@ class TestSimpleCANClosedLoop():
test_assert_eq(axis_ctx.handle.config.can.node_id, node_id+20)
# Reset node ID to default value
asyncio.run(command(canbus.handle, node_id+20, extended_id, 'set_node_id', node_id=node_id))
command(canbus.handle, node_id+20, extended_id, 'set_node_id', node_id=node_id)
fence()
test_assert_eq(axis_ctx.handle.config.can.node_id, node_id)