summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
Diffstat (limited to 'demos')
-rw-r--r--demos/bsp/boards/board_ea4357.c6
-rw-r--r--demos/bsp/boards/printf_retarget.c2
-rw-r--r--demos/device/keyboard/descriptors.c10
-rw-r--r--demos/device/keyboard/tusb_config.h14
4 files changed, 23 insertions, 9 deletions
diff --git a/demos/bsp/boards/board_ea4357.c b/demos/bsp/boards/board_ea4357.c
index 70b9fb7e2..1902e2ce9 100644
--- a/demos/bsp/boards/board_ea4357.c
+++ b/demos/bsp/boards/board_ea4357.c
@@ -55,6 +55,10 @@ void board_init(void)
SysTick_Config(CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE) / CFG_TICKS_PER_SECOND); // 1 msec tick timer
+ // USB Host Power Enable
+ // USB0
+ // TODO USB1
+
#if 0
// Leds Init
uint8_t i;
@@ -89,7 +93,7 @@ void board_init(void)
//--------------------------------------------------------------------+
// LEDS
//--------------------------------------------------------------------+
-void board_leds(uint32_t mask, uint32_t state) __attribute__ ((deprecated("not supported yet")));
+void board_leds(uint32_t mask, uint32_t state) __attribute__ ((warning("not supported yet")));
void board_leds(uint32_t mask, uint32_t state)
{
#if 0
diff --git a/demos/bsp/boards/printf_retarget.c b/demos/bsp/boards/printf_retarget.c
index 6a088bfe1..232839b3c 100644
--- a/demos/bsp/boards/printf_retarget.c
+++ b/demos/bsp/boards/printf_retarget.c
@@ -40,7 +40,7 @@
//-------------------------------------------------------------------- +
// LPCXpresso printf redirection +
//-------------------------------------------------------------------- +
-#if CFG_PRINTF_TARGET != PRINTF_TARGET_DEBUG_CONSOLE
+#if (defined __CODE_RED) && (CFG_PRINTF_TARGET != PRINTF_TARGET_DEBUG_CONSOLE)
// Called by bottom level of printf routine within RedLib C library to write
// a character. With the default semihosting stub, this would write the character
// to the debugger console window . But this version writes
diff --git a/demos/device/keyboard/descriptors.c b/demos/device/keyboard/descriptors.c
index c7ab9d9c1..8491087e4 100644
--- a/demos/device/keyboard/descriptors.c
+++ b/demos/device/keyboard/descriptors.c
@@ -38,7 +38,7 @@
#include "descriptors.h"
#ifdef TUSB_CFG_DEVICE_HID_KEYBOARD
-ATTR_ALIGNED(4) const uint8_t HID_KeyboardReportDescriptor[] = {
+TUSB_ATTR_RAM_SECTION ATTR_ALIGNED(4) const uint8_t HID_KeyboardReportDescriptor[] = {
HID_UsagePage ( HID_USAGE_PAGE_GENERIC ),
HID_Usage ( HID_USAGE_GENERIC_KEYBOARD ),
HID_Collection ( HID_Application ),
@@ -81,7 +81,7 @@ ATTR_ALIGNED(4) const uint8_t HID_KeyboardReportDescriptor[] = {
#endif
#ifdef TUSB_CFG_DEVICE_HID_MOUSE
-ATTR_ALIGNED(4) const uint8_t HID_MouseReportDescriptor[] = {
+TUSB_ATTR_RAM_SECTION ATTR_ALIGNED(4) const uint8_t HID_MouseReportDescriptor[] = {
HID_UsagePage ( HID_USAGE_PAGE_GENERIC ),
HID_Usage ( HID_USAGE_GENERIC_MOUSE ),
HID_Collection ( HID_Application ),
@@ -119,7 +119,7 @@ ATTR_ALIGNED(4) const uint8_t HID_MouseReportDescriptor[] = {
#endif
/* USB Standard Device Descriptor */
-ATTR_ALIGNED(4) const USB_DEVICE_DESCRIPTOR USB_DeviceDescriptor =
+TUSB_ATTR_RAM_SECTION ATTR_ALIGNED(4) const USB_DEVICE_DESCRIPTOR USB_DeviceDescriptor =
{
.bLength = sizeof(USB_DEVICE_DESCRIPTOR),
.bDescriptorType = USB_DEVICE_DESCRIPTOR_TYPE,
@@ -153,7 +153,7 @@ ATTR_ALIGNED(4) const USB_DEVICE_DESCRIPTOR USB_DeviceDescriptor =
.bNumConfigurations = 0x01
};
-ATTR_ALIGNED(4) const USB_FS_CONFIGURATION_DESCRIPTOR USB_FsConfigDescriptor =
+TUSB_ATTR_RAM_SECTION ATTR_ALIGNED(4) const USB_FS_CONFIGURATION_DESCRIPTOR USB_FsConfigDescriptor =
{
.Config =
{
@@ -358,7 +358,7 @@ ATTR_ALIGNED(4) const USB_FS_CONFIGURATION_DESCRIPTOR USB_FsConfigDescriptor =
.ConfigDescTermination = 0,
};
-ATTR_ALIGNED(4) const USB_STR_DESCRIPTOR USB_StringDescriptor =
+TUSB_ATTR_RAM_SECTION ATTR_ALIGNED(4) const USB_STR_DESCRIPTOR USB_StringDescriptor =
{
.LangID = { .bLength = 0x04, .bDescriptorType = USB_STRING_DESCRIPTOR_TYPE },
.strLangID= {0x0409}, // US English
diff --git a/demos/device/keyboard/tusb_config.h b/demos/device/keyboard/tusb_config.h
index 39ef922b9..d9cb23c4a 100644
--- a/demos/device/keyboard/tusb_config.h
+++ b/demos/device/keyboard/tusb_config.h
@@ -59,13 +59,23 @@
#define TUSB_CFG_DEVICE
/// Enable CDC Support
-#define TUSB_CFG_DEVICE_CDC
+//#define TUSB_CFG_DEVICE_CDC
/// Enable HID Keyboard support
#define TUSB_CFG_DEVICE_HID_KEYBOARD
/// Enable HID Mouse support
-#define TUSB_CFG_DEVICE_HID_MOUSE
+//#define TUSB_CFG_DEVICE_HID_MOUSE
+
+#ifdef __CODE_RED // make use of code red's support for ram region macros
+ #if (MCU == MCU_LPC11UXX) || (MCU == MCU_LPC13UXX)
+ #define TUSB_RAM_SECTION ".data.$RAM2"
+ #elif (MCU == MCU_LPC43XX)
+ #define TUSB_RAM_SECTION ".data.$RAM3"
+ #endif
+
+ #define TUSB_ATTR_RAM_SECTION __attribute__ ((section(TUSB_RAM_SECTION)))
+#endif
#ifdef __cplusplus