diff options
| author | hathach <[email protected]> | 2018-04-10 14:31:11 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-04-10 14:31:11 +0700 |
| commit | 3c2467196070eeedd4171e183db04fb815677246 (patch) | |
| tree | 742e3f277776b025ee0f90ab63ef2f70a3b3d03a /tinyusb/class/cdc | |
| parent | 3473c71a6a7cb22cb45f368dba4edda49ed8f7af (diff) | |
mass rename TUSB_CFG to CFG_TUSB
Diffstat (limited to 'tinyusb/class/cdc')
| -rw-r--r-- | tinyusb/class/cdc/cdc_device.c | 8 | ||||
| -rw-r--r-- | tinyusb/class/cdc/cdc_host.c | 6 | ||||
| -rw-r--r-- | tinyusb/class/cdc/cdc_host.h | 10 | ||||
| -rw-r--r-- | tinyusb/class/cdc/cdc_rndis_host.c | 14 |
4 files changed, 19 insertions, 19 deletions
diff --git a/tinyusb/class/cdc/cdc_device.c b/tinyusb/class/cdc/cdc_device.c index 3dde8a4a9..5ca4c7d31 100644 --- a/tinyusb/class/cdc/cdc_device.c +++ b/tinyusb/class/cdc/cdc_device.c @@ -38,7 +38,7 @@ #include "tusb_option.h"
-#if (MODE_DEVICE_SUPPORTED && TUSB_CFG_DEVICE_CDC)
+#if (MODE_DEVICE_SUPPORTED && CFG_TUSB_DEVICE_CDC)
#define _TINY_USB_SOURCE_FILE_
//--------------------------------------------------------------------+
@@ -51,7 +51,7 @@ //--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
-TUSB_CFG_ATTR_USBRAM STATIC_VAR cdc_line_coding_t cdcd_line_coding[CONTROLLER_DEVICE_NUMBER];
+CFG_TUSB_ATTR_USBRAM STATIC_VAR cdc_line_coding_t cdcd_line_coding[CONTROLLER_DEVICE_NUMBER];
typedef struct {
uint8_t interface_number;
@@ -66,8 +66,8 @@ typedef struct { }cdcd_data_t;
// TODO multiple rhport
-TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(4) uint8_t _tmp_rx_buf[64];
-TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(4) uint8_t _tmp_tx_buf[64];
+CFG_TUSB_ATTR_USBRAM ATTR_ALIGNED(4) uint8_t _tmp_rx_buf[64];
+CFG_TUSB_ATTR_USBRAM ATTR_ALIGNED(4) uint8_t _tmp_tx_buf[64];
#define CFG_TUD_CDC_BUFSIZE 128
diff --git a/tinyusb/class/cdc/cdc_host.c b/tinyusb/class/cdc/cdc_host.c index 56f36aedb..bd5b5e32c 100644 --- a/tinyusb/class/cdc/cdc_host.c +++ b/tinyusb/class/cdc/cdc_host.c @@ -38,7 +38,7 @@ #include "tusb_option.h"
-#if (MODE_HOST_SUPPORTED && TUSB_CFG_HOST_CDC)
+#if (MODE_HOST_SUPPORTED && CFG_TUSB_HOST_CDC)
#define _TINY_USB_SOURCE_FILE_
@@ -55,7 +55,7 @@ //--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-STATIC_VAR cdch_data_t cdch_data[TUSB_CFG_HOST_DEVICE_MAX]; // TODO to be static
+STATIC_VAR cdch_data_t cdch_data[CFG_TUSB_HOST_DEVICE_MAX]; // TODO to be static
static inline cdc_pipeid_t get_app_pipeid(pipe_handle_t pipe_hdl)
{
@@ -139,7 +139,7 @@ tusb_error_t tuh_cdc_receive(uint8_t dev_addr, void * p_buffer, uint32_t length, //--------------------------------------------------------------------+
void cdch_init(void)
{
- memclr_(cdch_data, sizeof(cdch_data_t)*TUSB_CFG_HOST_DEVICE_MAX);
+ memclr_(cdch_data, sizeof(cdch_data_t)*CFG_TUSB_HOST_DEVICE_MAX);
}
tusb_error_t cdch_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_interface_desc, uint16_t *p_length)
diff --git a/tinyusb/class/cdc/cdc_host.h b/tinyusb/class/cdc/cdc_host.h index f720cb438..77f1e5a78 100644 --- a/tinyusb/class/cdc/cdc_host.h +++ b/tinyusb/class/cdc/cdc_host.h @@ -77,27 +77,27 @@ bool tuh_cdc_is_busy(uint8_t dev_addr, cdc_pipeid_t pipeid) ATTR_PURE ATTR_WARN /** \brief Perform USB OUT transfer to device
* \param[in] dev_addr device address
- * \param[in] p_data Buffer containing data. Must be accessible by USB controller (see \ref TUSB_CFG_ATTR_USBRAM)
+ * \param[in] p_data Buffer containing data. Must be accessible by USB controller (see \ref CFG_TUSB_ATTR_USBRAM)
* \param[in] length Number of bytes to be transferred via USB bus
* \retval TUSB_ERROR_NONE on success
* \retval TUSB_ERROR_INTERFACE_IS_BUSY if the interface is already transferring data with device
* \retval TUSB_ERROR_DEVICE_NOT_READY if device is not yet configured (by SET CONFIGURED request)
* \retval TUSB_ERROR_INVALID_PARA if input parameters are not correct
* \note This function is non-blocking and returns immediately. The result of USB transfer will be reported by the
- * interface's callback function. \a p_data must be declared with \ref TUSB_CFG_ATTR_USBRAM.
+ * interface's callback function. \a p_data must be declared with \ref CFG_TUSB_ATTR_USBRAM.
*/
tusb_error_t tuh_cdc_send(uint8_t dev_addr, void const * p_data, uint32_t length, bool is_notify);
/** \brief Perform USB IN transfer to get data from device
* \param[in] dev_addr device address
- * \param[in] p_buffer Buffer containing received data. Must be accessible by USB controller (see \ref TUSB_CFG_ATTR_USBRAM)
+ * \param[in] p_buffer Buffer containing received data. Must be accessible by USB controller (see \ref CFG_TUSB_ATTR_USBRAM)
* \param[in] length Number of bytes to be transferred via USB bus
* \retval TUSB_ERROR_NONE on success
* \retval TUSB_ERROR_INTERFACE_IS_BUSY if the interface is already transferring data with device
* \retval TUSB_ERROR_DEVICE_NOT_READY if device is not yet configured (by SET CONFIGURED request)
* \retval TUSB_ERROR_INVALID_PARA if input parameters are not correct
* \note This function is non-blocking and returns immediately. The result of USB transfer will be reported by the
- * interface's callback function. \a p_data must be declared with \ref TUSB_CFG_ATTR_USBRAM.
+ * interface's callback function. \a p_data must be declared with \ref CFG_TUSB_ATTR_USBRAM.
*/
tusb_error_t tuh_cdc_receive(uint8_t dev_addr, void * p_buffer, uint32_t length, bool is_notify);
@@ -147,7 +147,7 @@ typedef struct { } cdch_data_t;
-extern cdch_data_t cdch_data[TUSB_CFG_HOST_DEVICE_MAX]; // TODO consider to move to cdch internal header file
+extern cdch_data_t cdch_data[CFG_TUSB_HOST_DEVICE_MAX]; // TODO consider to move to cdch internal header file
void cdch_init(void);
tusb_error_t cdch_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_interface_desc, uint16_t *p_length) ATTR_WARN_UNUSED_RESULT;
diff --git a/tinyusb/class/cdc/cdc_rndis_host.c b/tinyusb/class/cdc/cdc_rndis_host.c index 7026a3871..62361feb4 100644 --- a/tinyusb/class/cdc/cdc_rndis_host.c +++ b/tinyusb/class/cdc/cdc_rndis_host.c @@ -38,7 +38,7 @@ #include "tusb_option.h" -#if (MODE_HOST_SUPPORTED && TUSB_CFG_HOST_CDC && TUSB_CFG_HOST_CDC_RNDIS) +#if (MODE_HOST_SUPPORTED && CFG_TUSB_HOST_CDC && CFG_TUSB_HOST_CDC_RNDIS) #define _TINY_USB_SOURCE_FILE_ @@ -54,10 +54,10 @@ //--------------------------------------------------------------------+ #define RNDIS_MSG_PAYLOAD_MAX (1024*4) -TUSB_CFG_ATTR_USBRAM static uint8_t msg_notification[TUSB_CFG_HOST_DEVICE_MAX][8]; -TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(4) static uint8_t msg_payload[RNDIS_MSG_PAYLOAD_MAX]; +CFG_TUSB_ATTR_USBRAM static uint8_t msg_notification[CFG_TUSB_HOST_DEVICE_MAX][8]; +CFG_TUSB_ATTR_USBRAM ATTR_ALIGNED(4) static uint8_t msg_payload[RNDIS_MSG_PAYLOAD_MAX]; -STATIC_VAR rndish_data_t rndish_data[TUSB_CFG_HOST_DEVICE_MAX]; +STATIC_VAR rndish_data_t rndish_data[CFG_TUSB_HOST_DEVICE_MAX]; // TODO Microsoft requires message length for any get command must be at least 4096 bytes @@ -102,7 +102,7 @@ static tusb_error_t rndis_body_subtask(void) OSAL_SUBTASK_BEGIN - for (relative_addr = 0; relative_addr < TUSB_CFG_HOST_DEVICE_MAX; relative_addr++) + for (relative_addr = 0; relative_addr < CFG_TUSB_HOST_DEVICE_MAX; relative_addr++) { } @@ -117,12 +117,12 @@ static tusb_error_t rndis_body_subtask(void) //--------------------------------------------------------------------+ void rndish_init(void) { - memclr_(rndish_data, sizeof(rndish_data_t)*TUSB_CFG_HOST_DEVICE_MAX); + memclr_(rndish_data, sizeof(rndish_data_t)*CFG_TUSB_HOST_DEVICE_MAX); //------------- Task creation -------------// //------------- semaphore creation for notificaiton pipe -------------// - for(uint8_t i=0; i<TUSB_CFG_HOST_DEVICE_MAX; i++) + for(uint8_t i=0; i<CFG_TUSB_HOST_DEVICE_MAX; i++) { rndish_data[i].sem_notification_hdl = osal_semaphore_create( OSAL_SEM_REF(rndish_data[i].semaphore_notification) ); } |
