Skip to content

Commit a4c20fd

Browse files
committed
pbsys/program_stop: Add getter for stop buttons.
This lets us restore a previously set value from user code.
1 parent fadd501 commit a4c20fd

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

lib/pbio/include/pbsys/program_stop.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#if PBSYS_CONFIG_PROGRAM_STOP
1919

20+
pbio_button_flags_t pbsys_program_stop_get_buttons(void);
2021
void pbsys_program_stop_set_buttons(pbio_button_flags_t buttons);
2122

2223
#else // PBSYS_CONFIG_PROGRAM_STOP

lib/pbio/sys/program_stop.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ void pbsys_program_stop(bool force_stop) {
4242
}
4343
}
4444

45+
/**
46+
* Gets the stop button(s) used during a user program.
47+
* @param [in] buttons One or more button flags that stop the program
48+
* or 0 if stopping by button is disabled.
49+
*/
50+
pbio_button_flags_t pbsys_program_stop_get_buttons(void) {
51+
return stop_buttons;
52+
}
53+
4554
/**
4655
* Sets the stop button(s) to be used during a user program.
4756
* @param [in] buttons One or more button flags to set the stop button

0 commit comments

Comments
 (0)