Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions pybpodapi/state_machine/state_machine_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,21 @@ def add_state(
output_code
== self.hardware.channels.events_positions.globalTimerTrigger
):
self.global_timers.triggers_matrix[state_name_idx] = 2 ** (
output_value - 1
)
# self.global_timers.triggers_matrix[state_name_idx] = 2 ** (
# output_value - 1 )

# output_value here could be a decimal integer representing (more than one) bits to TRIGGER
# E.g.: 3 = '11' = trigger timers 1 & 2
self.global_timers.triggers_matrix[state_name_idx] = output_value

if output_code == self.hardware.channels.events_positions.globalTimerCancel:
self.global_timers.cancels_matrix[output_value - 1] = 1

# self.global_timers.cancels_matrix[output_value - 1] = 1 # This doesn't work

# output_value here could be a decimal integer representing (more than one) bits to CANCEL
# E.g.: 3 = '11' = cancel timers 1 & 2
self.global_timers.cancels_matrix[state_name_idx] = output_value


self.output_matrix[state_name_idx].append((output_code, output_value))

Expand Down