Move over message ID specific header data to unions inside the standard TMC header structure, so that all header data is read in one chunk in the incomplete TMC demo.

pull/1469/head
Dean Camera 15 years ago
parent cd39c38d5f
commit be2a7d4598

@ -218,7 +218,7 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
else else
{ {
/* Indicate that all in-progress/pending data IN requests should be aborted */ /* Indicate that all in-progress/pending data IN requests should be aborted */
IsTMCBulkINReset = true; IsTMCBulkINReset = true;
/* Save the split request for later checking when a new request is received */ /* Save the split request for later checking when a new request is received */
RequestInProgess = Req_InitiateAbortBulkIn; RequestInProgess = Req_InitiateAbortBulkIn;
@ -351,6 +351,10 @@ void TMC_Task(void)
break; break;
case TMC_MESSAGEID_DEV_VENDOR_IN: case TMC_MESSAGEID_DEV_VENDOR_IN:
break;
default:
Endpoint_StallTransaction();
break; break;
} }

@ -105,10 +105,35 @@
typedef struct typedef struct
{ {
uint8_t MessageID; unsigned char LastMessageTransaction : 1;
uint8_t Tag; unsigned char Reserved : 7;
uint8_t InverseTag;
uint8_t Reserved; uint8_t Reserved2[3];
} TMC_DevOUTMessageHeader_t;
typedef struct
{
unsigned char TermCharEnabled : 1;
unsigned char Reserved : 7;
uint8_t TermChar;
uint8_t Reserved2[2];
} TMC_DevINMessageHeader_t;
typedef struct
{
uint8_t MessageID;
uint8_t Tag;
uint8_t InverseTag;
uint8_t Reserved;
uint32_t TransferSize;
union
{
TMC_DevOUTMessageHeader_t DeviceOUT;
TMC_DevINMessageHeader_t DeviceIN;
uint32_t VendorSpecific;
} MessageIDSpecific;
} TMC_MessageHeader_t; } TMC_MessageHeader_t;
/* Function Prototypes: */ /* Function Prototypes: */

@ -131,8 +131,8 @@
#define ENDPOINT_CONTROLEP 0 #define ENDPOINT_CONTROLEP 0
#if (!defined(FIXED_CONTROL_ENDPOINT_SIZE) || defined(__DOXYGEN__)) #if (!defined(FIXED_CONTROL_ENDPOINT_SIZE) || defined(__DOXYGEN__))
/** Default size of the default control endpoint's bank, until altered by the Endpoint0Size value /** Default size of the default control endpoint's bank, until altered by the control endpoint bank size
* in the device descriptor. Not available if the FIXED_CONTROL_ENDPOINT_SIZE token is defined. * value in the device descriptor. Not available if the FIXED_CONTROL_ENDPOINT_SIZE token is defined.
*/ */
#define ENDPOINT_CONTROLEP_DEFAULT_SIZE 8 #define ENDPOINT_CONTROLEP_DEFAULT_SIZE 8
#endif #endif

@ -105,11 +105,11 @@ ISR(TIMER1_COMPA_vect, ISR_BLOCK)
if (CurrentLoggingTicks++ < LoggingInterval500MS_SRAM) if (CurrentLoggingTicks++ < LoggingInterval500MS_SRAM)
return; return;
LEDs_SetAllLEDs(LEDMASK_USB_BUSY);
/* Reset log tick counter to prepare for next logging interval */ /* Reset log tick counter to prepare for next logging interval */
CurrentLoggingTicks = 0; CurrentLoggingTicks = 0;
LEDs_SetAllLEDs(LEDMASK_USB_BUSY);
/* Only log when not connected to a USB host */ /* Only log when not connected to a USB host */
if (USB_DeviceState == DEVICE_STATE_Unattached) if (USB_DeviceState == DEVICE_STATE_Unattached)
{ {

Loading…
Cancel
Save