Cosmetics, consistency fixes, fix compiler warnings.
This commit is contained in:
parent
edf230386c
commit
a0091f18c7
@ -24,7 +24,7 @@ Q := @
|
|||||||
MAKEFLAGS += --no-print-directory
|
MAKEFLAGS += --no-print-directory
|
||||||
endif
|
endif
|
||||||
|
|
||||||
all: fancyblink
|
all: fancyblink
|
||||||
|
|
||||||
fancyblink:
|
fancyblink:
|
||||||
@printf " BUILD examples/stm32/stm32-h107/fancyblink\n"
|
@printf " BUILD examples/stm32/stm32-h107/fancyblink\n"
|
||||||
@ -34,5 +34,5 @@ clean:
|
|||||||
@printf " CLEAN examples/stm32/stm32-h107/fancyblink\n"
|
@printf " CLEAN examples/stm32/stm32-h107/fancyblink\n"
|
||||||
$(Q)$(MAKE) -C fancyblink clean
|
$(Q)$(MAKE) -C fancyblink clean
|
||||||
|
|
||||||
.PHONY: fancyblink
|
.PHONY: fancyblink
|
||||||
|
|
||||||
|
@ -28,12 +28,11 @@ void clock_setup(void)
|
|||||||
|
|
||||||
/* Enable GPIOC clock. */
|
/* Enable GPIOC clock. */
|
||||||
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN);
|
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void gpio_setup(void)
|
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_set_mode(GPIOC, GPIO_MODE_OUTPUT_50_MHZ,
|
||||||
GPIO_CNF_OUTPUT_PUSHPULL, GPIO6);
|
GPIO_CNF_OUTPUT_PUSHPULL, GPIO6);
|
||||||
gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_50_MHZ,
|
gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_50_MHZ,
|
||||||
|
@ -102,7 +102,9 @@
|
|||||||
/* PERIPH_BASE_AHB + 0xb400 (0x4002 3400 - 0x4002 7FFF): Reserved */
|
/* PERIPH_BASE_AHB + 0xb400 (0x4002 3400 - 0x4002 7FFF): Reserved */
|
||||||
#define ETHERNET_BASE (PERIPH_BASE_AHB + 0x10000)
|
#define ETHERNET_BASE (PERIPH_BASE_AHB + 0x10000)
|
||||||
/* PERIPH_BASE_AHB + 0x18000 (0x4003 0000 - 0x4FFF FFFF): Reserved */
|
/* 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)
|
#define FSMC_BASE (PERIPH_BASE + 0x60000000)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -46,7 +46,7 @@ int usbd_init(const usbd_driver *driver,
|
|||||||
const struct usb_device_descriptor *dev,
|
const struct usb_device_descriptor *dev,
|
||||||
const struct usb_config_descriptor *conf, const char **strings)
|
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.desc = dev;
|
||||||
_usbd_device.config = conf;
|
_usbd_device.config = conf;
|
||||||
_usbd_device.strings = strings;
|
_usbd_device.strings = strings;
|
||||||
@ -127,4 +127,3 @@ u8 usbd_ep_stall_get(u8 addr)
|
|||||||
{
|
{
|
||||||
return _usbd_device.driver->ep_stall_get(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,
|
static int usb_standard_set_configuration(struct usb_setup_data *req,
|
||||||
u8 **buf, u16 *len)
|
u8 **buf, u16 *len)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
(void)req;
|
(void)req;
|
||||||
(void)buf;
|
(void)buf;
|
||||||
(void)len;
|
(void)len;
|
||||||
@ -151,10 +153,11 @@ static int usb_standard_set_configuration(struct usb_setup_data *req,
|
|||||||
_usbd_hw_endpoints_reset();
|
_usbd_hw_endpoints_reset();
|
||||||
|
|
||||||
if (_usbd_device.user_callback_set_config) {
|
if (_usbd_device.user_callback_set_config) {
|
||||||
/* Flush control callbacks. These will be reregistered
|
/*
|
||||||
* by the user handler. */
|
* Flush control callbacks. These will be reregistered
|
||||||
int i;
|
* by the user handler.
|
||||||
for(i = 0; i < MAX_USER_CONTROL_CALLBACK; i++)
|
*/
|
||||||
|
for (i = 0; i < MAX_USER_CONTROL_CALLBACK; i++)
|
||||||
_usbd_device.user_control_callback[i].cb = NULL;
|
_usbd_device.user_control_callback[i].cb = NULL;
|
||||||
|
|
||||||
_usbd_device.user_callback_set_config(req->wValue);
|
_usbd_device.user_callback_set_config(req->wValue);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user