Skip to content
This repository was archived by the owner on Nov 23, 2025. It is now read-only.

Commit fc89397

Browse files
committed
Fixing the reset_all_io for the new uos structure.
Allowing it to define volatility level. Enabling volatile instructions for arduino devices.
1 parent 9259158 commit fc89397

4 files changed

Lines changed: 16 additions & 8 deletions

File tree

CHANGES.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ Version 0.5.0
1111
the project.
1212
The logger has a NullHandler so is suppressed unless the client enables.
1313
Removed configure_logs function as this was no longer functional.
14+
* Updating reset_all_io to use persistence levels pertaining to where the
15+
reset details are obtained from.
16+
* Enabling volatile instructions on arduino devices as this is now
17+
available at the firmware level.
1418

1519
Version 0.4.0
1620
-------------

uoshardware/abstractions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ class UOSFunctions:
4242
)
4343
get_adc_input = UOSFunction(
4444
name="get_adc_input",
45-
address_lut={Persistence.NONE: 85},
45+
address_lut={Persistence.NONE: 90},
4646
ack=True,
4747
rx_packets_expected=[2],
4848
pin_requirements=["adc_in"],
4949
)
5050
reset_all_io = UOSFunction(
51-
name="reset_all_io", address_lut={Persistence.NONE: 245}, ack=True
51+
name="reset_all_io", address_lut={Persistence.RAM: 79}, ack=True
5252
)
5353
hard_reset = UOSFunction(
5454
name="hard_reset", address_lut={Persistence.NONE: -1}, ack=False

uoshardware/api.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,15 @@ def get_gpio_config(self, pin: int) -> ComResult:
210210
),
211211
)
212212

213-
def reset_all_io(self) -> ComResult:
214-
"""Execute the reset IO at the defined volatility level."""
213+
def reset_all_io(self, volatility=Persistence.RAM) -> ComResult:
214+
"""Execute the reset IO at the defined volatility level.
215+
216+
:param volatility: Where should the pins reset from, use constants from uoshardware.
217+
:return: ComResult object containing the result of the reset operation..
218+
"""
215219
return self.__execute_instruction(
216220
UOSFunctions.reset_all_io,
217-
InstructionArguments(),
221+
InstructionArguments(volatility=volatility),
218222
)
219223

220224
def hard_reset(self) -> ComResult:

uoshardware/devices/_arduino.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
name="Arduino Nano 3",
88
interfaces=[Interface.STUB, Interface.SERIAL],
99
functions_enabled={
10-
UOSFunctions.set_gpio_output.name: [Persistence.NONE],
11-
UOSFunctions.get_gpio_input.name: [Persistence.NONE],
10+
UOSFunctions.set_gpio_output.name: [Persistence.NONE, Persistence.RAM],
11+
UOSFunctions.get_gpio_input.name: [Persistence.NONE, Persistence.RAM],
1212
UOSFunctions.get_adc_input.name: [Persistence.NONE],
13-
UOSFunctions.reset_all_io.name: [Persistence.NONE],
13+
UOSFunctions.reset_all_io.name: [Persistence.RAM],
1414
UOSFunctions.hard_reset.name: [Persistence.NONE],
1515
UOSFunctions.get_system_info.name: [Persistence.NONE],
1616
UOSFunctions.get_gpio_config.name: [Persistence.NONE],

0 commit comments

Comments
 (0)