summaryrefslogtreecommitdiff
path: root/examples/obsolete/device/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-11-23 15:28:32 +0700
committerGitHub <[email protected]>2018-11-23 15:28:32 +0700
commita1c596490aa40863cd5f1e36a821157ffeab2af6 (patch)
treec8246e10d303414f222a5ba15480c04010240c8e /examples/obsolete/device/src
parent2edfd5b555388d10a9013eb598c9a73a4ee1afa9 (diff)
parent394a22ecf7760cce630a8186260f1c79901af934 (diff)
Merge pull request #13 from hathach/devlocal
add unplugged event for nrf5x
Diffstat (limited to 'examples/obsolete/device/src')
-rw-r--r--examples/obsolete/device/src/keyboard_device_app.c10
-rw-r--r--examples/obsolete/device/src/mouse_device_app.c10
-rw-r--r--examples/obsolete/device/src/msc_device_ramdisk.c2
-rw-r--r--examples/obsolete/device/src/tusb_config.h18
4 files changed, 20 insertions, 20 deletions
diff --git a/examples/obsolete/device/src/keyboard_device_app.c b/examples/obsolete/device/src/keyboard_device_app.c
index 4bb25b9c0..5e14c56c9 100644
--- a/examples/obsolete/device/src/keyboard_device_app.c
+++ b/examples/obsolete/device/src/keyboard_device_app.c
@@ -51,7 +51,7 @@
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-CFG_TUSB_ATTR_USBRAM hid_keyboard_report_t keyboard_report;
+CFG_TUSB_MEM_SECTION hid_keyboard_report_t keyboard_report;
//--------------------------------------------------------------------+
// tinyusb callbacks
@@ -66,13 +66,13 @@ void keyboard_app_umount(uint8_t rhport)
}
-void tud_hid_keyboard_cb(uint8_t rhport, tusb_event_t event, uint32_t xferred_bytes)
+void tud_hid_keyboard_cb(uint8_t rhport, xfer_result_t event, uint32_t xferred_bytes)
{
switch(event)
{
- case TUSB_EVENT_XFER_COMPLETE:
- case TUSB_EVENT_XFER_ERROR:
- case TUSB_EVENT_XFER_STALLED:
+ case XFER_RESULT_SUCCESS:
+ case XFER_RESULT_FAILED:
+ case XFER_RESULT_STALLED:
default: break;
}
}
diff --git a/examples/obsolete/device/src/mouse_device_app.c b/examples/obsolete/device/src/mouse_device_app.c
index 077cecc7c..6869f1a05 100644
--- a/examples/obsolete/device/src/mouse_device_app.c
+++ b/examples/obsolete/device/src/mouse_device_app.c
@@ -51,7 +51,7 @@
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-CFG_TUSB_ATTR_USBRAM hid_mouse_report_t mouse_report;
+CFG_TUSB_MEM_SECTION hid_mouse_report_t mouse_report;
//--------------------------------------------------------------------+
// tinyusb callbacks
@@ -66,13 +66,13 @@ void mouse_app_umount(uint8_t rhport)
}
-void tud_hid_mouse_cb(uint8_t rhport, tusb_event_t event, uint32_t xferred_bytes)
+void tud_hid_mouse_cb(uint8_t rhport, xfer_result_t event, uint32_t xferred_bytes)
{
switch(event)
{
- case TUSB_EVENT_XFER_COMPLETE:
- case TUSB_EVENT_XFER_ERROR:
- case TUSB_EVENT_XFER_STALLED:
+ case XFER_RESULT_SUCCESS:
+ case XFER_RESULT_FAILED:
+ case XFER_RESULT_STALLED:
default: break;
}
}
diff --git a/examples/obsolete/device/src/msc_device_ramdisk.c b/examples/obsolete/device/src/msc_device_ramdisk.c
index 6dc48e290..f28690b73 100644
--- a/examples/obsolete/device/src/msc_device_ramdisk.c
+++ b/examples/obsolete/device/src/msc_device_ramdisk.c
@@ -47,7 +47,7 @@
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-CFG_TUSB_ATTR_USBRAM
+CFG_TUSB_MEM_SECTION
uint8_t msc_device_ramdisk[DISK_BLOCK_NUM][DISK_BLOCK_SIZE] =
{
//------------- Boot Sector -------------//
diff --git a/examples/obsolete/device/src/tusb_config.h b/examples/obsolete/device/src/tusb_config.h
index 7b7c82299..c5739038f 100644
--- a/examples/obsolete/device/src/tusb_config.h
+++ b/examples/obsolete/device/src/tusb_config.h
@@ -97,31 +97,31 @@
#ifdef __CODE_RED // compiled with lpcxpresso
#if (CFG_TUSB_MCU == OPT_MCU_LPC11UXX) || (CFG_TUSB_MCU == OPT_MCU_LPC13UXX)
- #define CFG_TUSB_ATTR_USBRAM ATTR_SECTION(.data.$RAM2) ATTR_ALIGNED(64) // lp11u & lp13u requires data to be 64 byte aligned
+ #define CFG_TUSB_MEM_SECTION ATTR_SECTION(.data.$RAM2) ATTR_ALIGNED(64) // lp11u & lp13u requires data to be 64 byte aligned
#elif CFG_TUSB_MCU == OPT_MCU_LPC175X_6X
- #define CFG_TUSB_ATTR_USBRAM // LPC17xx USB DMA can access all
+ #define CFG_TUSB_MEM_SECTION // LPC17xx USB DMA can access all
#elif (CFG_TUSB_MCU == OPT_MCU_LPC43XX)
- #define CFG_TUSB_ATTR_USBRAM ATTR_SECTION(.data.$RAM3)
+ #define CFG_TUSB_MEM_SECTION ATTR_SECTION(.data.$RAM3)
#endif
#elif defined __CC_ARM // Compiled with Keil armcc, USBRAM_SECTION is defined in scatter files
#if (CFG_TUSB_MCU == OPT_MCU_LPC11UXX) || (CFG_TUSB_MCU == OPT_MCU_LPC13UXX)
- #define CFG_TUSB_ATTR_USBRAM ATTR_SECTION(USBRAM_SECTION) ATTR_ALIGNED(64) // lp11u & lp13u requires data to be 64 byte aligned
+ #define CFG_TUSB_MEM_SECTION ATTR_SECTION(USBRAM_SECTION) ATTR_ALIGNED(64) // lp11u & lp13u requires data to be 64 byte aligned
#elif (CFG_TUSB_MCU == OPT_MCU_LPC175X_6X)
- #define CFG_TUSB_ATTR_USBRAM // LPC17xx USB DMA can access all address
+ #define CFG_TUSB_MEM_SECTION // LPC17xx USB DMA can access all address
#elif (CFG_TUSB_MCU == OPT_MCU_LPC43XX)
- #define CFG_TUSB_ATTR_USBRAM // Use keil tool configure to have AHB SRAM as default memory
+ #define CFG_TUSB_MEM_SECTION // Use keil tool configure to have AHB SRAM as default memory
#endif
#elif defined __ICCARM__ // compiled with IAR
#if (CFG_TUSB_MCU == OPT_MCU_LPC11UXX) || (CFG_TUSB_MCU == OPT_MCU_LPC13UXX)
- #define CFG_TUSB_ATTR_USBRAM _Pragma("location=\"USB_PACKET_MEMORY\"") ATTR_ALIGNED(64)
+ #define CFG_TUSB_MEM_SECTION _Pragma("location=\"USB_PACKET_MEMORY\"") ATTR_ALIGNED(64)
#elif (CFG_TUSB_MCU == OPT_MCU_LPC175X_6X)
- #define CFG_TUSB_ATTR_USBRAM
+ #define CFG_TUSB_MEM_SECTION
#elif (CFG_TUSB_MCU == OPT_MCU_LPC43XX)
- #define CFG_TUSB_ATTR_USBRAM _Pragma("location=\".ahb_sram1\"")
+ #define CFG_TUSB_MEM_SECTION _Pragma("location=\".ahb_sram1\"")
#endif
#else