diff options
Diffstat (limited to 'project/Core/Src')
| -rw-r--r-- | project/Core/Src/Project/local_control.c | 3 | ||||
| -rw-r--r-- | project/Core/Src/Project/player_actions.c | 2 | ||||
| -rw-r--r-- | project/Core/Src/Project/remote_control.c | 6 | ||||
| -rw-r--r-- | project/Core/Src/System/systick.c | 3 |
4 files changed, 12 insertions, 2 deletions
diff --git a/project/Core/Src/Project/local_control.c b/project/Core/Src/Project/local_control.c index 8b12bc3..5957e1a 100644 --- a/project/Core/Src/Project/local_control.c +++ b/project/Core/Src/Project/local_control.c @@ -11,12 +11,15 @@ #include <stdint.h> #include "GPIO.h" #include "project.h" +#include "systick.h" int click_count = 0; uint32_t last_press = 0; uint32_t time_down = 0; int hold_pending = 0; +void handle_press(int pressed); + /** * Initialize local control mode (does not enable it) */ diff --git a/project/Core/Src/Project/player_actions.c b/project/Core/Src/Project/player_actions.c index 8318e08..2fe1732 100644 --- a/project/Core/Src/Project/player_actions.c +++ b/project/Core/Src/Project/player_actions.c @@ -90,7 +90,7 @@ void player_stop() { /** * Toggles the LED every second if in pause mode */ -void SysTick_Handler2(int count) { +void player_action_tick(int count) { if (state != PAUSED_STATE) return; diff --git a/project/Core/Src/Project/remote_control.c b/project/Core/Src/Project/remote_control.c index c549eb1..68d3f21 100644 --- a/project/Core/Src/Project/remote_control.c +++ b/project/Core/Src/Project/remote_control.c @@ -18,6 +18,8 @@ static char buffer[80]; static char* cur = buffer; +void parse_input(char buffer[]); + /** * Initialize remote control mode (does not enable it) */ @@ -39,6 +41,10 @@ void remote_control_loop() { } } +/** + * Parses the input string and calls the correct command + * @param buffer a null terminated string of the input + */ void parse_input(char buffer[]) { if (!strcmp(buffer, "HELP")) { player_help(); diff --git a/project/Core/Src/System/systick.c b/project/Core/Src/System/systick.c index c18707e..f9e2470 100644 --- a/project/Core/Src/System/systick.c +++ b/project/Core/Src/System/systick.c @@ -1,4 +1,5 @@ #include "systick.h" +#include "player_actions.h" systick_t *get_systick() { return (systick_t *) 0xE000E010; @@ -59,7 +60,7 @@ int check_systick() { static uint32_t count = 0; void SysTick_Handler() { - SysTick_Handler2(count++); + player_action_tick(count++); } uint32_t systick_get_count() { |
