Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lufa
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Erik Strand
lufa
Commits
6e2920bc
Commit
6e2920bc
authored
14 years ago
by
Dean Camera
Browse files
Options
Downloads
Patches
Plain Diff
Add comments to the currently completed portions of the incomplete Test and Measurement Class demo.
parent
0803cf00
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c
+22
-1
22 additions, 1 deletion
...Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c
with
22 additions
and
1 deletion
Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c
+
22
−
1
View file @
6e2920bc
...
...
@@ -100,16 +100,25 @@ void SetupHardware(void)
USB_Init
();
}
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
* starts the library USB task to begin the enumeration and USB management process.
*/
void
EVENT_USB_Device_Connect
(
void
)
{
LEDs_SetAllLEDs
(
LEDMASK_USB_ENUMERATING
);
}
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
* the status LEDs and stops the USB management and CDC management tasks.
*/
void
EVENT_USB_Device_Disconnect
(
void
)
{
LEDs_SetAllLEDs
(
LEDMASK_USB_NOTREADY
);
}
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
* of the USB device after enumeration - the device endpoints are configured and the CDC management task started.
*/
void
EVENT_USB_Device_ConfigurationChanged
(
void
)
{
LEDs_SetAllLEDs
(
LEDMASK_USB_READY
);
...
...
@@ -130,10 +139,15 @@ void EVENT_USB_Device_ConfigurationChanged(void)
}
}
/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific
* control requests that are not handled internally by the USB library (including the CDC control commands,
* which are all issued via the control endpoint), so that they can be handled appropriately for the application.
*/
void
EVENT_USB_Device_UnhandledControlRequest
(
void
)
{
uint8_t
TMCRequestStatus
=
TMC_REQUEST_STATUS_SUCCESS
;
/* Process TMC specific control requests */
switch
(
USB_ControlRequest
.
bRequest
)
{
case
Req_InitiateAbortBulkOut
:
...
...
@@ -141,6 +155,7 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
{
Endpoint_ClearSETUP
();
/* Check that no split transaction is already in progress and the data OUT transfer tag is valid */
if
(
RequestInProgess
!=
0
)
{
TMCRequestStatus
=
TMC_REQUEST_STATUS_SPLIT_IN_PROGRESS
;
...
...
@@ -171,6 +186,7 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
{
Endpoint_ClearSETUP
();
/* Check that an ABORT BULK OUT transaction has been requested and that the request has completed */
if
(
RequestInProgess
!=
Req_InitiateAbortBulkOut
)
TMCRequestStatus
=
TMC_REQUEST_STATUS_SPLIT_NOT_IN_PROGRESS
;
else
if
(
IsTMCBulkOUTReset
)
...
...
@@ -193,6 +209,7 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
{
Endpoint_ClearSETUP
();
/* Check that no split transaction is already in progress and the data IN transfer tag is valid */
if
(
RequestInProgess
!=
0
)
{
TMCRequestStatus
=
TMC_REQUEST_STATUS_SPLIT_IN_PROGRESS
;
...
...
@@ -224,6 +241,7 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
{
Endpoint_ClearSETUP
();
/* Check that an ABORT BULK IN transaction has been requested and that the request has completed */
if
(
RequestInProgess
!=
Req_InitiateAbortBulkIn
)
TMCRequestStatus
=
TMC_REQUEST_STATUS_SPLIT_NOT_IN_PROGRESS
;
else
if
(
IsTMCBulkINReset
)
...
...
@@ -246,6 +264,7 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
{
Endpoint_ClearSETUP
();
/* Check that no split transaction is already in progress */
if
(
RequestInProgess
!=
0
)
{
Endpoint_Write_Byte
(
TMC_REQUEST_STATUS_SPLIT_IN_PROGRESS
);
...
...
@@ -273,6 +292,7 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
{
Endpoint_ClearSETUP
();
/* Check that a CLEAR transaction has been requested and that the request has completed */
if
(
RequestInProgess
!=
Req_InitiateClear
)
TMCRequestStatus
=
TMC_REQUEST_STATUS_SPLIT_NOT_IN_PROGRESS
;
else
if
(
IsTMCBulkINReset
||
IsTMCBulkOUTReset
)
...
...
@@ -306,6 +326,7 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
}
}
/** Function to manage TMC data transmission and reception to and from the host. */
void
TMC_Task
(
void
)
{
/* Device must be connected and configured for the task to run */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment