diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-04-01 00:11:23 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-04-04 18:29:31 -0400 |
commit | 3e71a57f67ce0dde62e942dfa33bf38d64262916 (patch) | |
tree | f4b128d810d8678d41b71c6a02aa23875c2c9ea7 /src/lpc176x/usbserial.c | |
parent | bc9fd03dabc38ae55fae3151e94cffe7157b95bd (diff) | |
download | kutter-3e71a57f67ce0dde62e942dfa33bf38d64262916.tar.gz kutter-3e71a57f67ce0dde62e942dfa33bf38d64262916.tar.xz kutter-3e71a57f67ce0dde62e942dfa33bf38d64262916.zip |
lpc176x: Use enumerations for buses and reserve pins
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/lpc176x/usbserial.c')
-rw-r--r-- | src/lpc176x/usbserial.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lpc176x/usbserial.c b/src/lpc176x/usbserial.c index 847746d8..18466da7 100644 --- a/src/lpc176x/usbserial.c +++ b/src/lpc176x/usbserial.c @@ -10,7 +10,7 @@ #include "board/irq.h" // irq_disable #include "board/misc.h" // timer_read_time #include "byteorder.h" // cpu_to_le32 -#include "command.h" // output +#include "command.h" // DECL_CONSTANT_STR #include "generic/usb_cdc.h" // usb_notify_ep0 #include "internal.h" // gpio_peripheral #include "sched.h" // DECL_INIT @@ -261,6 +261,8 @@ usb_request_bootloader(void) NVIC_SystemReset(); } +DECL_CONSTANT_STR("RESERVE_PINS_USB", "P0.30,P0.29,P2.9"); + void usbserial_init(void) { @@ -271,9 +273,9 @@ usbserial_init(void) LPC_USB->USBClkCtrl = 0x12; while (LPC_USB->USBClkSt != 0x12) ; - // configure USBD+, USBD-, and USB Connect pins - gpio_peripheral(GPIO(0, 29), 1, 0); + // configure USBD-, USBD+, and USB Connect pins gpio_peripheral(GPIO(0, 30), 1, 0); + gpio_peripheral(GPIO(0, 29), 1, 0); gpio_peripheral(GPIO(2, 9), 1, 0); // setup endpoints realize_endpoint(EP0OUT, USB_CDC_EP0_SIZE); |