summaryrefslogtreecommitdiff
path: root/examples/obsolete
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
parent2edfd5b555388d10a9013eb598c9a73a4ee1afa9 (diff)
parent394a22ecf7760cce630a8186260f1c79901af934 (diff)
Merge pull request #13 from hathach/devlocal
add unplugged event for nrf5x
Diffstat (limited to 'examples/obsolete')
-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
-rw-r--r--examples/obsolete/host/src/cdc_serial_host_app.c12
-rw-r--r--examples/obsolete/host/src/keyboard_host_app.c8
-rw-r--r--examples/obsolete/host/src/mouse_host_app.c8
-rw-r--r--examples/obsolete/host/src/msc_cli.c2
-rw-r--r--examples/obsolete/host/src/msc_host_app.c4
-rw-r--r--examples/obsolete/host/src/tusb_config.h12
10 files changed, 43 insertions, 43 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
diff --git a/examples/obsolete/host/src/cdc_serial_host_app.c b/examples/obsolete/host/src/cdc_serial_host_app.c
index 30ed6698e..85604dcdf 100644
--- a/examples/obsolete/host/src/cdc_serial_host_app.c
+++ b/examples/obsolete/host/src/cdc_serial_host_app.c
@@ -49,8 +49,8 @@
static osal_semaphore_t sem_hdl;
enum { SERIAL_BUFFER_SIZE = 64 };
-CFG_TUSB_ATTR_USBRAM static uint8_t serial_in_buffer[SERIAL_BUFFER_SIZE];
-CFG_TUSB_ATTR_USBRAM static uint8_t serial_out_buffer[SERIAL_BUFFER_SIZE];
+CFG_TUSB_MEM_SECTION static uint8_t serial_in_buffer[SERIAL_BUFFER_SIZE];
+CFG_TUSB_MEM_SECTION static uint8_t serial_out_buffer[SERIAL_BUFFER_SIZE];
static uint8_t received_bytes; // set by transfer complete callback
@@ -75,7 +75,7 @@ void tuh_cdc_unmounted_cb(uint8_t dev_addr)
}
// invoked ISR context
-void tuh_cdc_xfer_isr(uint8_t dev_addr, tusb_event_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes)
+void tuh_cdc_xfer_isr(uint8_t dev_addr, xfer_result_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes)
{
(void) dev_addr; // compiler warnings
@@ -84,17 +84,17 @@ void tuh_cdc_xfer_isr(uint8_t dev_addr, tusb_event_t event, cdc_pipeid_t pipe_id
case CDC_PIPE_DATA_IN:
switch(event)
{
- case TUSB_EVENT_XFER_COMPLETE:
+ case XFER_RESULT_SUCCESS:
received_bytes = xferred_bytes;
osal_semaphore_post(sem_hdl); // notify main task
break;
- case TUSB_EVENT_XFER_ERROR:
+ case XFER_RESULT_FAILED:
received_bytes = 0; // ignore
tuh_cdc_receive(dev_addr, serial_in_buffer, SERIAL_BUFFER_SIZE, true); // waiting for next data
break;
- case TUSB_EVENT_XFER_STALLED:
+ case XFER_RESULT_STALLED:
default :
break;
}
diff --git a/examples/obsolete/host/src/keyboard_host_app.c b/examples/obsolete/host/src/keyboard_host_app.c
index 21ace3bbf..fd51548c3 100644
--- a/examples/obsolete/host/src/keyboard_host_app.c
+++ b/examples/obsolete/host/src/keyboard_host_app.c
@@ -53,7 +53,7 @@
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
static osal_queue_t queue_kbd_hdl;
-CFG_TUSB_ATTR_USBRAM static hid_keyboard_report_t usb_keyboard_report;
+CFG_TUSB_MEM_SECTION static hid_keyboard_report_t usb_keyboard_report;
static inline uint8_t keycode_to_ascii(uint8_t modifier, uint8_t keycode) ATTR_CONST ATTR_ALWAYS_INLINE;
static inline void process_kbd_report(hid_keyboard_report_t const * report);
@@ -77,16 +77,16 @@ void tuh_hid_keyboard_unmounted_cb(uint8_t dev_addr)
}
// invoked ISR context
-void tuh_hid_keyboard_isr(uint8_t dev_addr, tusb_event_t event)
+void tuh_hid_keyboard_isr(uint8_t dev_addr, xfer_result_t event)
{
switch(event)
{
- case TUSB_EVENT_XFER_COMPLETE:
+ case XFER_RESULT_SUCCESS:
osal_queue_send(queue_kbd_hdl, &usb_keyboard_report);
tuh_hid_keyboard_get_report(dev_addr, (uint8_t*) &usb_keyboard_report);
break;
- case TUSB_EVENT_XFER_ERROR:
+ case XFER_RESULT_FAILED:
tuh_hid_keyboard_get_report(dev_addr, (uint8_t*) &usb_keyboard_report); // ignore & continue
break;
diff --git a/examples/obsolete/host/src/mouse_host_app.c b/examples/obsolete/host/src/mouse_host_app.c
index e242c7caa..819c2b290 100644
--- a/examples/obsolete/host/src/mouse_host_app.c
+++ b/examples/obsolete/host/src/mouse_host_app.c
@@ -53,7 +53,7 @@
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
static osal_queue_t queue_mouse_hdl;
-CFG_TUSB_ATTR_USBRAM static hid_mouse_report_t usb_mouse_report;
+CFG_TUSB_MEM_SECTION static hid_mouse_report_t usb_mouse_report;
static inline void process_mouse_report(hid_mouse_report_t const * p_report);
@@ -76,16 +76,16 @@ void tuh_hid_mouse_unmounted_cb(uint8_t dev_addr)
}
// invoked ISR context
-void tuh_hid_mouse_isr(uint8_t dev_addr, tusb_event_t event)
+void tuh_hid_mouse_isr(uint8_t dev_addr, xfer_result_t event)
{
switch(event)
{
- case TUSB_EVENT_XFER_COMPLETE:
+ case XFER_RESULT_SUCCESS:
osal_queue_send(queue_mouse_hdl, &usb_mouse_report);
(void) tuh_hid_mouse_get_report(dev_addr, (uint8_t*) &usb_mouse_report);
break;
- case TUSB_EVENT_XFER_ERROR:
+ case XFER_RESULT_FAILED:
(void) tuh_hid_mouse_get_report(dev_addr, (uint8_t*) &usb_mouse_report); // ignore & continue
break;
diff --git a/examples/obsolete/host/src/msc_cli.c b/examples/obsolete/host/src/msc_cli.c
index 1f7b1f5ec..75dbb1c01 100644
--- a/examples/obsolete/host/src/msc_cli.c
+++ b/examples/obsolete/host/src/msc_cli.c
@@ -141,7 +141,7 @@ static cli_cmdfunc_t cli_command_tbl[] =
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-CFG_TUSB_ATTR_USBRAM uint8_t fileread_buffer[CLI_FILE_READ_BUFFER];
+CFG_TUSB_MEM_SECTION uint8_t fileread_buffer[CLI_FILE_READ_BUFFER];
static char cli_buffer[CLI_MAX_BUFFER];
static char volume_label[20];
diff --git a/examples/obsolete/host/src/msc_host_app.c b/examples/obsolete/host/src/msc_host_app.c
index 957db2fad..1cfe9ec60 100644
--- a/examples/obsolete/host/src/msc_host_app.c
+++ b/examples/obsolete/host/src/msc_host_app.c
@@ -55,7 +55,7 @@
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-CFG_TUSB_ATTR_USBRAM static FATFS fatfs[CFG_TUSB_HOST_DEVICE_MAX];
+CFG_TUSB_MEM_SECTION static FATFS fatfs[CFG_TUSB_HOST_DEVICE_MAX];
//--------------------------------------------------------------------+
// tinyusb callbacks
@@ -129,7 +129,7 @@ void tuh_msc_unmounted_cb(uint8_t dev_addr)
}
// invoked ISR context
-void tuh_msc_isr(uint8_t dev_addr, tusb_event_t event, uint32_t xferred_bytes)
+void tuh_msc_isr(uint8_t dev_addr, xfer_result_t event, uint32_t xferred_bytes)
{
(void) dev_addr;
(void) event;
diff --git a/examples/obsolete/host/src/tusb_config.h b/examples/obsolete/host/src/tusb_config.h
index 547fd3645..f39fa26b4 100644
--- a/examples/obsolete/host/src/tusb_config.h
+++ b/examples/obsolete/host/src/tusb_config.h
@@ -77,26 +77,26 @@
#ifdef __CODE_RED // make use of code red's support for ram region macros
#if 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 ATTR_SECTION(.data.$RAM3)
+ #define CFG_TUSB_MEM_SECTION ATTR_SECTION(.data.$RAM3)
#endif
#elif defined __CC_ARM // Compiled with Keil armcc
#if (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_LPC175X_6X)
// LP175x_6x can access all but CMSIS-RTX causes overflow in 32KB SRAM --> move to AHB ram
- #define CFG_TUSB_ATTR_USBRAM _Pragma("location=\".sram\"")
+ #define CFG_TUSB_MEM_SECTION _Pragma("location=\".sram\"")
#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