Cosmetics, consistency fixes, fix compiler warnings.
This commit is contained in:
parent
edf230386c
commit
a0091f18c7
@ -28,12 +28,11 @@ void clock_setup(void)
|
||||
|
||||
/* Enable GPIOC clock. */
|
||||
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN);
|
||||
|
||||
}
|
||||
|
||||
void gpio_setup(void)
|
||||
{
|
||||
/* Set GPIO12 (in GPIO port C) to 'output push-pull'. */
|
||||
/* Set GPIO6/7 (in GPIO port C) to 'output push-pull'. */
|
||||
gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_50_MHZ,
|
||||
GPIO_CNF_OUTPUT_PUSHPULL, GPIO6);
|
||||
gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_50_MHZ,
|
||||
|
@ -102,7 +102,9 @@
|
||||
/* PERIPH_BASE_AHB + 0xb400 (0x4002 3400 - 0x4002 7FFF): Reserved */
|
||||
#define ETHERNET_BASE (PERIPH_BASE_AHB + 0x10000)
|
||||
/* PERIPH_BASE_AHB + 0x18000 (0x4003 0000 - 0x4FFF FFFF): Reserved */
|
||||
#define USB_OTG_FS_BASE (PERIPH_BASE + 0x10000000)
|
||||
#define USB_OTG_FS_BASE (PERIPH_BASE_AHB + 0xffe8000)
|
||||
|
||||
/* FSMC */
|
||||
#define FSMC_BASE (PERIPH_BASE + 0x60000000)
|
||||
|
||||
#endif
|
||||
|
@ -46,7 +46,7 @@ int usbd_init(const usbd_driver *driver,
|
||||
const struct usb_device_descriptor *dev,
|
||||
const struct usb_config_descriptor *conf, const char **strings)
|
||||
{
|
||||
_usbd_device.driver = driver;
|
||||
_usbd_device.driver = (usbd_driver *)driver;
|
||||
_usbd_device.desc = dev;
|
||||
_usbd_device.config = conf;
|
||||
_usbd_device.strings = strings;
|
||||
@ -127,4 +127,3 @@ u8 usbd_ep_stall_get(u8 addr)
|
||||
{
|
||||
return _usbd_device.driver->ep_stall_get(addr);
|
||||
}
|
||||
|
||||
|
@ -137,6 +137,8 @@ static int usb_standard_set_address(struct usb_setup_data *req, u8 **buf,
|
||||
static int usb_standard_set_configuration(struct usb_setup_data *req,
|
||||
u8 **buf, u16 *len)
|
||||
{
|
||||
int i;
|
||||
|
||||
(void)req;
|
||||
(void)buf;
|
||||
(void)len;
|
||||
@ -151,10 +153,11 @@ static int usb_standard_set_configuration(struct usb_setup_data *req,
|
||||
_usbd_hw_endpoints_reset();
|
||||
|
||||
if (_usbd_device.user_callback_set_config) {
|
||||
/* Flush control callbacks. These will be reregistered
|
||||
* by the user handler. */
|
||||
int i;
|
||||
for(i = 0; i < MAX_USER_CONTROL_CALLBACK; i++)
|
||||
/*
|
||||
* Flush control callbacks. These will be reregistered
|
||||
* by the user handler.
|
||||
*/
|
||||
for (i = 0; i < MAX_USER_CONTROL_CALLBACK; i++)
|
||||
_usbd_device.user_control_callback[i].cb = NULL;
|
||||
|
||||
_usbd_device.user_callback_set_config(req->wValue);
|
||||
|
Loading…
x
Reference in New Issue
Block a user