aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Hermann2011-01-30 22:43:33 +0100
committerUwe Hermann2011-01-30 22:43:33 +0100
commita0091f18c71a19d68cf1c0de4ceb3d9e90c23c39 (patch)
treebad81e0cd53aef1dc97fc1d580d27058b49614e9
parentedf230386c2013a346a43daed8473d208e80921d (diff)
Cosmetics, consistency fixes, fix compiler warnings.
-rw-r--r--examples/stm32/stm32-h107/Makefile4
-rw-r--r--examples/stm32/stm32-h107/fancyblink/fancyblink.c3
-rw-r--r--include/libopencm3/stm32/memorymap.h4
-rw-r--r--lib/usb/usb.c3
-rw-r--r--lib/usb/usb_standard.c11
5 files changed, 14 insertions, 11 deletions
diff --git a/examples/stm32/stm32-h107/Makefile b/examples/stm32/stm32-h107/Makefile
index c9edec3..a6d797d 100644
--- a/examples/stm32/stm32-h107/Makefile
+++ b/examples/stm32/stm32-h107/Makefile
@@ -24,7 +24,7 @@ Q := @
MAKEFLAGS += --no-print-directory
endif
-all: fancyblink
+all: fancyblink
fancyblink:
@printf " BUILD examples/stm32/stm32-h107/fancyblink\n"
@@ -34,5 +34,5 @@ clean:
@printf " CLEAN examples/stm32/stm32-h107/fancyblink\n"
$(Q)$(MAKE) -C fancyblink clean
-.PHONY: fancyblink
+.PHONY: fancyblink
diff --git a/examples/stm32/stm32-h107/fancyblink/fancyblink.c b/examples/stm32/stm32-h107/fancyblink/fancyblink.c
index 759b767..c73d3d4 100644
--- a/examples/stm32/stm32-h107/fancyblink/fancyblink.c
+++ b/examples/stm32/stm32-h107/fancyblink/fancyblink.c
@@ -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,
diff --git a/include/libopencm3/stm32/memorymap.h b/include/libopencm3/stm32/memorymap.h
index ad7fe5a..63c88da 100644
--- a/include/libopencm3/stm32/memorymap.h
+++ b/include/libopencm3/stm32/memorymap.h
@@ -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
diff --git a/lib/usb/usb.c b/lib/usb/usb.c
index f24f2f9..dbdb822 100644
--- a/lib/usb/usb.c
+++ b/lib/usb/usb.c
@@ -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);
}
-
diff --git a/lib/usb/usb_standard.c b/lib/usb/usb_standard.c
index adfaa23..5995387 100644
--- a/lib/usb/usb_standard.c
+++ b/lib/usb/usb_standard.c
@@ -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);