diff options
Diffstat (limited to 'fw/src/usbd_conf.c')
-rw-r--r-- | fw/src/usbd_conf.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/fw/src/usbd_conf.c b/fw/src/usbd_conf.c index ccc4b16..b6815e5 100644 --- a/fw/src/usbd_conf.c +++ b/fw/src/usbd_conf.c @@ -2,6 +2,10 @@ #include "stm32f0xx_hal.h"
#include "usbd_def.h"
#include "usbd_core.h"
+#include "usbd_hid.h"
+
+#include <stdbool.h>
+#include <assert.h>
PCD_HandleTypeDef hpcd_USB_FS;
@@ -574,3 +578,19 @@ void USBD_LL_Delay(uint32_t Delay /* ms */) HAL_Delay(Delay);
}
+static USBD_HID_HandleTypeDef *static_hid_handle;
+static bool static_hid_handle_allocated = false;
+
+void *USBD_static_malloc(uint32_t size)
+{
+ assert(!static_hid_handle_allocated);
+ static_hid_handle_allocated = true;
+ return static_hid_handle;
+}
+
+void USBD_static_free(void *p)
+{
+ assert(static_hid_handle_allocated);
+ static_hid_handle_allocated = false;
+}
+
|