diff --git a/src/lpc176x/gpio.c b/src/lpc176x/gpio.c index 0b6d034..270480f 100644 --- a/src/lpc176x/gpio.c +++ b/src/lpc176x/gpio.c @@ -64,14 +64,10 @@ regs_to_pin(LPC_GPIO_TypeDef *regs, uint32_t bit) struct gpio_out gpio_out_setup(uint8_t pin, uint8_t val) { - if (GPIO2PORT(pin) >= ARRAY_SIZE(digital_regs)) - goto fail; LPC_GPIO_TypeDef *regs = digital_regs[GPIO2PORT(pin)]; struct gpio_out g = { .regs=regs, .bit=GPIO2BIT(pin) }; gpio_out_reset(g, val); return g; -fail: - shutdown("Not an output pin"); } void @@ -115,14 +111,10 @@ gpio_out_write(struct gpio_out g, uint8_t val) struct gpio_in gpio_in_setup(uint8_t pin, int8_t pull_up) { - if (GPIO2PORT(pin) >= ARRAY_SIZE(digital_regs)) - goto fail; LPC_GPIO_TypeDef *regs = digital_regs[GPIO2PORT(pin)]; struct gpio_in g = { .regs=regs, .bit=GPIO2BIT(pin) }; gpio_in_reset(g, pull_up); return g; -fail: - shutdown("Not an input pin"); } void diff --git a/src/lpc176x/usbserial.c b/src/lpc176x/usbserial.c index 777f77e..4d251ce 100644 --- a/src/lpc176x/usbserial.c +++ b/src/lpc176x/usbserial.c @@ -244,22 +244,6 @@ usb_set_configure(void) usb_irq_enable(); } -void -usb_request_bootloader(void) -{ - if (!CONFIG_SMOOTHIEWARE_BOOTLOADER) - return; - // Disable USB and pause for 5ms so host recognizes a disconnect - irq_disable(); - sie_cmd_write(SIE_CMD_SET_DEVICE_STATUS, 0); - udelay(5000); - // The "LPC17xx-DFU-Bootloader" will enter the bootloader if the - // watchdog timeout flag is set. - LPC_WDT->WDMOD = 0x07; - NVIC_SystemReset(); -} - - /**************************************************************** * Setup and interrupts ****************************************************************/