summaryrefslogtreecommitdiff
path: root/src/demo.c
diff options
context:
space:
mode:
authorAmir Hammad <amir.hammad@hotmail.com>2016-09-09 18:33:26 +0200
committerAmir Hammad <amir.hammad@hotmail.com>2016-09-11 13:31:48 +0200
commit8946cb522b10465d3fe3a9846158dbff4e924240 (patch)
tree42f27a561840d060a212028d3ebc5102ddbfce66 /src/demo.c
parentdecb2d817d806e8ed6e77cf215e4adfef4767a50 (diff)
downloadsecure-hid-8946cb522b10465d3fe3a9846158dbff4e924240.tar.gz
secure-hid-8946cb522b10465d3fe3a9846158dbff4e924240.tar.bz2
secure-hid-8946cb522b10465d3fe3a9846158dbff4e924240.zip
lld: rework low level driver initialization
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
Diffstat (limited to 'src/demo.c')
-rw-r--r--src/demo.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/demo.c b/src/demo.c
index 44a94c0..a6b4196 100644
--- a/src/demo.c
+++ b/src/demo.c
@@ -122,6 +122,17 @@ static const usbh_dev_driver_t *device_drivers[] = {
NULL
};
+static const usbh_low_level_driver_t * const lld_drivers[] = {
+#ifdef USE_STM32F4_USBH_DRIVER_FS
+ &usbh_lld_stm32f4_driver_fs, // Make sure USE_STM32F4_USBH_DRIVER_FS is defined in usbh_config.h
+#endif
+
+#ifdef USE_STM32F4_USBH_DRIVER_HS
+ &usbh_lld_stm32f4_driver_hs, // Make sure USE_STM32F4_USBH_DRIVER_HS is defined in usbh_config.h
+#endif
+ NULL
+ };
+
static void gp_xbox_update(uint8_t device_id, gp_xbox_packet_t packet)
{
(void)device_id;
@@ -218,7 +229,6 @@ int main(void)
midi_driver_init(&midi_config);
gpio_set(GPIOD, GPIO13);
-
/**
* Pass array of supported low level drivers
* In case of stm32f407, there are up to two supported OTG hosts on one chip.
@@ -226,16 +236,6 @@ int main(void)
*
* Pass array of supported device drivers
*/
- const void *lld_drivers[] = {
-#ifdef USE_STM32F4_USBH_DRIVER_FS
- usbh_lld_stm32f4_driver_fs, // Make sure USE_STM32F4_USBH_DRIVER_FS is defined in usbh_config.h
-#endif
-
-#ifdef USE_STM32F4_USBH_DRIVER_HS
- usbh_lld_stm32f4_driver_hs, // Make sure USE_STM32F4_USBH_DRIVER_HS is defined in usbh_config.h
-#endif
- NULL
- };
usbh_init(lld_drivers, device_drivers);
gpio_clear(GPIOD, GPIO13);