From 2365bbe010364e61b35d4ae0b38696d119c65b97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20Nyk=C3=A4nen?= Date: Wed, 30 Sep 2015 15:34:57 +0300 Subject: [PATCH 1/3] TI TM4C/LM4F cdc-acm fixes --- src/platforms/common/cdcacm.c | 2 +- src/platforms/launchpad-icdi/platform.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/platforms/common/cdcacm.c b/src/platforms/common/cdcacm.c index ab8294e..a44703f 100644 --- a/src/platforms/common/cdcacm.c +++ b/src/platforms/common/cdcacm.c @@ -498,7 +498,7 @@ static void cdcacm_set_config(usbd_device *dev, uint16_t wValue) configured = wValue; /* GDB interface */ -#ifdef STM32F4 +#if defined(STM32F4) || defined(LM4F) usbd_ep_setup(dev, 0x01, USB_ENDPOINT_ATTR_BULK, CDCACM_PACKET_SIZE, gdb_usb_out_cb); #else diff --git a/src/platforms/launchpad-icdi/platform.c b/src/platforms/launchpad-icdi/platform.c index ff67fa0..be7e517 100644 --- a/src/platforms/launchpad-icdi/platform.c +++ b/src/platforms/launchpad-icdi/platform.c @@ -46,8 +46,8 @@ void sys_tick_handler(void) void platform_init(void) { - int i; - for(i=0; i<1000000; i++); + int i; + for(i=0; i<1000000; i++); rcc_sysclk_config(OSCSRC_MOSC, XTAL_16M, PLL_DIV_80MHZ); @@ -77,12 +77,12 @@ platform_init(void) periph_clock_enable(RCC_GPIOD); __asm__("nop"); __asm__("nop"); __asm__("nop"); gpio_mode_setup(GPIOD_BASE, GPIO_MODE_ANALOG, GPIO_PUPD_NONE, GPIO4|GPIO5); + usbuart_init(); + cdcacm_init(); + usb_enable_interrupts(USB_INT_RESET | USB_INT_DISCON | USB_INT_RESUME | USB_INT_SUSPEND, 0xff, 0xff); - - usbuart_init(); - cdcacm_init(); } void platform_timeout_set(uint32_t ms) From 3f9ea8250a74039b95bfb31752c1de46935036ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20Nyk=C3=A4nen?= Date: Thu, 22 Oct 2015 19:33:45 +0300 Subject: [PATCH 2/3] Defined snprintf to sniprintf on launchpad-icdi --- src/platforms/launchpad-icdi/platform.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platforms/launchpad-icdi/platform.h b/src/platforms/launchpad-icdi/platform.h index 52b963e..87e53d5 100644 --- a/src/platforms/launchpad-icdi/platform.h +++ b/src/platforms/launchpad-icdi/platform.h @@ -96,6 +96,7 @@ extern usbd_driver lm4f_usb_driver; #define sscanf siscanf #define sprintf siprintf #define vasprintf vasiprintf +#define snprintf sniprintf #define DEBUG(...) From 600f0d27d93d9c0de4c14bff6445dff011d9ed3b Mon Sep 17 00:00:00 2001 From: Gareth McMullin Date: Wed, 11 Nov 2015 12:41:13 -0800 Subject: [PATCH 3/3] Use sniprintf on newlib platforms. --- src/platforms/f4discovery/platform.h | 1 + src/platforms/stlink/platform.h | 1 + src/platforms/swlink/platform.h | 1 + 3 files changed, 3 insertions(+) diff --git a/src/platforms/f4discovery/platform.h b/src/platforms/f4discovery/platform.h index 16bd169..5f5b4da 100644 --- a/src/platforms/f4discovery/platform.h +++ b/src/platforms/f4discovery/platform.h @@ -160,6 +160,7 @@ static inline int platform_hwversion(void) #define sscanf siscanf #define sprintf siprintf #define vasprintf vasiprintf +#define snprintf sniprintf #endif diff --git a/src/platforms/stlink/platform.h b/src/platforms/stlink/platform.h index 498e512..6db6d45 100644 --- a/src/platforms/stlink/platform.h +++ b/src/platforms/stlink/platform.h @@ -138,6 +138,7 @@ extern uint16_t led_idle_run; #define sscanf siscanf #define sprintf siprintf #define vasprintf vasiprintf +#define snprintf sniprintf #endif diff --git a/src/platforms/swlink/platform.h b/src/platforms/swlink/platform.h index e31f543..b1690e7 100644 --- a/src/platforms/swlink/platform.h +++ b/src/platforms/swlink/platform.h @@ -131,6 +131,7 @@ #define sscanf siscanf #define sprintf siprintf #define vasprintf vasiprintf +#define snprintf sniprintf #endif