diff options
author | Joshua Liu <joshua.liu@sourceobby.com> | 2025-06-22 22:08:03 -0400 |
---|---|---|
committer | Joshua Liu <joshua.liu@sourceobby.com> | 2025-06-22 22:08:03 -0400 |
commit | 8ed8ac39c6de611b6737280a5041c15d3f415c1d (patch) | |
tree | ba1c6f89a6143077bd827c556a8b40714f697fee /streamdeck.c | |
parent | ad91b5b1ed83b0a522e6071d6b063362b58e031a (diff) |
feat: created the function declaration and some implementation of destroy_streamdeck and clean_exit
Diffstat (limited to 'streamdeck.c')
-rw-r--r-- | streamdeck.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/streamdeck.c b/streamdeck.c index 28e5a03..30e5065 100644 --- a/streamdeck.c +++ b/streamdeck.c @@ -106,6 +106,8 @@ streamdeck* connect() { streamdeck* res = malloc(sizeof(streamdeck)); + if (!res) + return NULL; res->hid_handle = create_hid_handler (); if (1) /* Replace this with the actual ID of the different streamdecks */ { @@ -207,7 +209,7 @@ update_current_folder (screen* folder) { for (int i = 0; i < STREAMDECK_MINI; i++ ) { - + ; } return 0; } @@ -222,3 +224,18 @@ load_key () { } +void +destroy_streamdeck (streamdeck* target) +{ + hid_close (target->hid_handle->handler); + free (target->hid_handle); + free (target->curr_screen); + free (target); +} + +void +clean_exit () +{ + hid_exit (); +} + |