mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-29 19:20:22 +00:00
Rename USBTMC_CFG_ENABLE_488, and fix build with it off.
This commit is contained in:
parent
d742c3e15c
commit
f3d6d0127b
@ -57,7 +57,7 @@
|
||||
|
||||
#define CFG_TUD_USBTMC 1
|
||||
#define CFG_TUD_USBTMC_ENABLE_INT_EP 1
|
||||
#define USBTMC_CFG_ENABLE_488 1
|
||||
#define CFG_USBTMC_CFG_ENABLE_488 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "bsp/board.h"
|
||||
#include "main.h"
|
||||
|
||||
#if (USBTMC_CFG_ENABLE_488)
|
||||
#if (CFG_USBTMC_CFG_ENABLE_488)
|
||||
usbtmc_response_capabilities_488_t const
|
||||
#else
|
||||
usbtmc_response_capabilities_t const
|
||||
@ -48,7 +48,7 @@ usbtmcd_app_capabilities =
|
||||
.canEndBulkInOnTermChar = 0
|
||||
},
|
||||
|
||||
#if (USBTMC_CFG_ENABLE_488)
|
||||
#if (CFG_USBTMC_CFG_ENABLE_488)
|
||||
.bcdUSB488 = USBTMC_488_VERSION,
|
||||
.bmIntfcCapabilities488 =
|
||||
{
|
||||
|
@ -227,7 +227,7 @@ bool usbtmcd_transmit_dev_msg_data(
|
||||
void usbtmcd_init(void)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
# if USBTMC_CFG_ENABLE_488
|
||||
# if CFG_USBTMC_CFG_ENABLE_488
|
||||
if(usbtmcd_app_capabilities.bmIntfcCapabilities488.supportsTrigger)
|
||||
TU_ASSERT(&usbtmcd_app_msg_trigger != NULL,);
|
||||
// Per USB488 spec: table 8
|
||||
@ -310,12 +310,13 @@ bool usbtmcd_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16
|
||||
{
|
||||
TU_ASSERT(usbtmc_state.ep_int_in != 0);
|
||||
}
|
||||
|
||||
#if (USBTMC_CFG_ENABLE_488)
|
||||
if(usbtmcd_app_capabilities.bmIntfcCapabilities488.is488_2 ||
|
||||
usbtmcd_app_capabilities.bmDevCapabilities488.SR1)
|
||||
{
|
||||
TU_ASSERT(usbtmc_state.ep_int_in != 0);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
TU_VERIFY( usbd_edpt_xfer(rhport, usbtmc_state.ep_bulk_out, usbtmc_state.ep_bulk_out_buf, 64));
|
||||
|
||||
@ -431,7 +432,7 @@ bool usbtmcd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint
|
||||
TU_VERIFY(handle_devMsgIn(rhport, msg, xferred_bytes));
|
||||
break;
|
||||
|
||||
#ifdef USBTMC_CFG_ENABLE_488
|
||||
#if (CFG_USBTMC_CFG_ENABLE_488)
|
||||
case USBTMC_MSGID_USB488_TRIGGER:
|
||||
// Spec says we halt the EP if we didn't declare we support it.
|
||||
TU_VERIFY(usbtmcd_app_capabilities.bmIntfcCapabilities488.supportsTrigger);
|
||||
@ -524,7 +525,7 @@ bool usbtmcd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint
|
||||
bool usbtmcd_control_request(uint8_t rhport, tusb_control_request_t const * request) {
|
||||
|
||||
uint8_t tmcStatusCode = USBTMC_STATUS_FAILED;
|
||||
#if (USBTMC_CFG_ENABLE_488)
|
||||
#if (CFG_USBTMC_CFG_ENABLE_488)
|
||||
uint8_t bTag;
|
||||
#endif
|
||||
|
||||
@ -724,7 +725,7 @@ bool usbtmcd_control_request(uint8_t rhport, tusb_control_request_t const * requ
|
||||
TU_VERIFY(tud_control_xfer(rhport, request, (void*)&tmcStatusCode, sizeof(tmcStatusCode)));
|
||||
return true;
|
||||
}
|
||||
#if (USBTMC_CFG_ENABLE_488)
|
||||
#if (CFG_USBTMC_CFG_ENABLE_488)
|
||||
|
||||
// USB488 required requests
|
||||
case USB488_bREQUEST_READ_STATUS_BYTE:
|
||||
|
@ -37,8 +37,8 @@
|
||||
#include "usbtmc.h"
|
||||
|
||||
// Enable 488 mode by default
|
||||
#if !defined(USBTMC_CFG_ENABLE_488)
|
||||
#define USBTMC_CFG_ENABLE_488 (1)
|
||||
#if !defined(CFG_USBTMC_CFG_ENABLE_488)
|
||||
#define CFG_CFG_USBTMC_CFG_ENABLE_488 (1)
|
||||
#endif
|
||||
|
||||
// USB spec says that full-speed must be 8,16,32, or 64.
|
||||
@ -49,7 +49,7 @@
|
||||
* Functions to be implemeted by the class implementation
|
||||
*/
|
||||
|
||||
#if (USBTMC_CFG_ENABLE_488)
|
||||
#if (CFG_USBTMC_CFG_ENABLE_488)
|
||||
extern usbtmc_response_capabilities_488_t const usbtmcd_app_capabilities;
|
||||
#else
|
||||
extern usbtmc_response_capabilities_t const usbtmcd_app_capabilities;
|
||||
@ -75,7 +75,7 @@ bool usbtmcd_app_check_clear(uint8_t rhport, usbtmc_get_clear_status_rsp_t *rsp)
|
||||
// Indicator pulse should be 0.5 to 1.0 seconds long
|
||||
TU_ATTR_WEAK bool usbtmcd_app_indicator_pluse(uint8_t rhport, tusb_control_request_t const * msg, uint8_t *tmcResult);
|
||||
|
||||
#if (USBTMC_CFG_ENABLE_488)
|
||||
#if (CFG_USBTMC_CFG_ENABLE_488)
|
||||
uint8_t usbtmcd_app_get_stb(uint8_t rhport, uint8_t *tmcResult);
|
||||
TU_ATTR_WEAK bool usbtmcd_app_msg_trigger(uint8_t rhport, usbtmc_msg_generic_t* msg);
|
||||
//TU_ATTR_WEAK bool usbtmcd_app_go_to_local(uint8_t rhport);
|
||||
|
Loading…
x
Reference in New Issue
Block a user