1
10
13
14
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
108
109
110
111
112
113
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
157
162
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
234
235
236
237
238
259
260
261
262
263
264
265
266
267
268
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
291
292
293
294
295
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
354
355
356
357
358
359
360
361
362
363
364
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
410
411
412
413
414
415
416
417
418
419
420
421
422
423
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
470
471
472
473
474
475
476
478
479
480
481
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
524
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
588
589
590
591
592
593
594
595
596
597
598
599
603
604
605
606
607
608
...
...
...
#define UX_SOURCE_CODE
#include "ux_api.h"
#include "ux_host_class_cdc_acm.h"
#include "ux_host_stack.h"
#if defined(UX_HOST_STANDALONE)
#define UX_HOST_CLASS_CDC_ACM_INIT_TRANSFER_WAIT (UX_STATE_WAIT)
#define UX_HOST_CLASS_CDC_ACM_INIT_DESCRIPTORS_PARSE (UX_STATE_NEXT)
#define UX_HOST_CLASS_CDC_ACM_INIT_DELAY_WAIT (UX_STATE_CLASS_STEP + 0)
#define UX_HOST_CLASS_CDC_ACM_INIT_LINE_CODING_SET (UX_STATE_CLASS_STEP + 1)
#define UX_HOST_CLASS_CDC_ACM_INIT_LINE_CODING_GET (UX_STATE_CLASS_STEP + 2)
#define UX_HOST_CLASS_CDC_ACM_INIT_LINE_CODING_CHECK (UX_STATE_CLASS_STEP + 3)
#define UX_HOST_CLASS_CDC_ACM_INIT_LINE_STATE_SET (UX_STATE_CLASS_STEP + 4)
#define UX_HOST_CLASS_CDC_ACM_INIT_ERROR (UX_STATE_CLASS_STEP + 5)
#define UX_HOST_CLASS_CDC_ACM_INIT_DONE (UX_STATE_CLASS_STEP + 6)
9 defines
static inline UINT _ux_host_class_cdc_acm_activate_wait(UX_HOST_CLASS_COMMAND *command);/* ... */
#endif
...
...
UINT _ux_host_class_cdc_acm_entry(UX_HOST_CLASS_COMMAND *command)
{
UINT status;
/* ... */
switch (command -> ux_host_class_command_request)
{
case UX_HOST_CLASS_COMMAND_QUERY:
/* ... */
if((command -> ux_host_class_command_usage == UX_HOST_CLASS_COMMAND_USAGE_CSP) &&
((command -> ux_host_class_command_class == UX_HOST_CLASS_CDC_DATA_CLASS) ||
((command -> ux_host_class_command_class == UX_HOST_CLASS_CDC_CONTROL_CLASS) &&
(command -> ux_host_class_command_subclass == UX_HOST_CLASS_CDC_ACM_SUBCLASS)) ||
((command -> ux_host_class_command_class == UX_HOST_CLASS_CDC_CONTROL_CLASS) &&
(command -> ux_host_class_command_subclass == UX_HOST_CLASS_CDC_DLC_SUBCLASS))))
{
if ((command -> ux_host_class_command_iad_class == 0) && (command -> ux_host_class_command_iad_subclass == 0))
return(UX_SUCCESS);
else
{
if ((command -> ux_host_class_command_iad_class == UX_HOST_CLASS_CDC_CONTROL_CLASS) &&
(command -> ux_host_class_command_iad_subclass == UX_HOST_CLASS_CDC_ACM_SUBCLASS))
return(UX_SUCCESS);
else
return(UX_NO_CLASS_MATCH);
}else { ... }
}if ((command -> ux_host_class_command_usage == UX_HOST_CLASS_COMMAND_USAGE_CSP) && ((command -> ux_host_class_command_class == UX_HOST_CLASS_CDC_DATA_CLASS) || ((command -> ux_host_class_command_class == UX_HOST_CLASS_CDC_CONTROL_CLASS) && (command -> ux_host_class_command_subclass == UX_HOST_CLASS_CDC_ACM_SUBCLASS)) || ((command -> ux_host_class_command_class == UX_HOST_CLASS_CDC_CONTROL_CLASS) && (command -> ux_host_class_command_subclass == UX_HOST_CLASS_CDC_DLC_SUBCLASS)))) { ... }
else
return(UX_NO_CLASS_MATCH);
case UX_HOST_CLASS_COMMAND_QUERY:
case UX_HOST_CLASS_COMMAND_ACTIVATE:
/* ... */
status = _ux_host_class_cdc_acm_activate(command);
return(status);
#if defined(UX_HOST_STANDALONE)case UX_HOST_CLASS_COMMAND_ACTIVATE:
case UX_HOST_CLASS_COMMAND_ACTIVATE_WAIT:
status = _ux_host_class_cdc_acm_activate_wait(command);
return(status);/* ... */
#endif
case UX_HOST_CLASS_COMMAND_ACTIVATE_WAIT:
case UX_HOST_CLASS_COMMAND_DEACTIVATE:
/* ... */
status = _ux_host_class_cdc_acm_deactivate(command);
return(status);
case UX_HOST_CLASS_COMMAND_DEACTIVATE:
default:
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_FUNCTION_NOT_SUPPORTED);
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_FUNCTION_NOT_SUPPORTED, 0, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_FUNCTION_NOT_SUPPORTED);default
}switch (command -> ux_host_class_command_request) { ... }
}{ ... }
#if defined(UX_HOST_STANDALONE)
static inline VOID _ux_host_class_cdc_acm_descriptors_parse(UX_HOST_CLASS_CDC_ACM *cdc_acm)
{
UX_ENDPOINT *control_endpoint;
UX_TRANSFER *transfer_request;
UX_INTERFACE *interface;
UCHAR *descriptor;
ULONG total_descriptor_length;
UCHAR descriptor_length;
UCHAR descriptor_type;
UCHAR descriptor_byte2;
ULONG interface_found;
ULONG interface_parsed;
UCHAR offset;
control_endpoint = &cdc_acm -> ux_host_class_cdc_acm_device -> ux_device_control_endpoint;
transfer_request = &control_endpoint -> ux_endpoint_transfer_request;
if (transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS ||
transfer_request -> ux_transfer_request_actual_length !=
transfer_request -> ux_transfer_request_requested_length)
{
cdc_acm -> ux_host_class_cdc_acm_status = UX_DESCRIPTOR_CORRUPTED;
cdc_acm -> ux_host_class_cdc_acm_cmd_state = UX_HOST_CLASS_CDC_ACM_INIT_ERROR;
return;
}if (transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS || transfer_request -> ux_transfer_request_actual_length != transfer_request -> ux_transfer_request_requested_length) { ... }
interface = cdc_acm -> ux_host_class_cdc_acm_interface;
total_descriptor_length = transfer_request -> ux_transfer_request_actual_length;
descriptor = (UCHAR *)cdc_acm -> ux_host_class_cdc_acm_allocated;
interface_found = UX_FALSE;
interface_parsed = UX_FALSE;
while(total_descriptor_length)
{
descriptor_length = *descriptor;
descriptor_type = *(descriptor + 1);
descriptor_byte2 = *(descriptor + 2);
if (descriptor_length < 3 || descriptor_length > total_descriptor_length)
{
break;
}if (descriptor_length < 3 || descriptor_length > total_descriptor_length) { ... }
switch(descriptor_type)
{
case UX_INTERFACE_DESCRIPTOR_ITEM:
if (interface -> ux_interface_descriptor.bInterfaceNumber == descriptor_byte2)
{
interface_found = UX_TRUE;
}if (interface -> ux_interface_descriptor.bInterfaceNumber == descriptor_byte2) { ... }
else
{
if (interface_found)
{
interface_parsed = UX_TRUE;
}if (interface_found) { ... }
}else { ... }
break;
case UX_INTERFACE_DESCRIPTOR_ITEM:
case UX_HOST_CLASS_CDC_ACM_CS_INTERFACE:
if (interface_found)
{
switch(descriptor_byte2)
{
case UX_HOST_CLASS_CDC_ACM_CALL_MANAGEMENT_DESCRIPTOR:
cdc_acm -> ux_host_class_cdc_acm_capabilities =
*(descriptor + UX_HOST_CLASS_CDC_ACM_CALL_MANAGEMENT_CAPABILITIES);
break;
case UX_HOST_CLASS_CDC_ACM_CALL_MANAGEMENT_DESCRIPTOR:
case UX_HOST_CLASS_CDC_ACM_UNION_DESCRIPTOR:
for (offset = UX_HOST_CLASS_CDC_ACM_UNION_FUNCTIONAL_MASTER;
offset < descriptor_length;
offset ++)
{
cdc_acm -> ux_host_class_cdc_acm_interfaces_bitmap |=
1u << *(descriptor + offset);
}for (offset = UX_HOST_CLASS_CDC_ACM_UNION_FUNCTIONAL_MASTER; offset < descriptor_length; offset ++) { ... }
break;
case UX_HOST_CLASS_CDC_ACM_UNION_DESCRIPTOR:
default:
break;default
}switch (descriptor_byte2) { ... }
}if (interface_found) { ... }
break;
case UX_HOST_CLASS_CDC_ACM_CS_INTERFACE:
default:
break;default
}switch (descriptor_type) { ... }
descriptor += descriptor_length;
total_descriptor_length -= descriptor_length;
}while (total_descriptor_length) { ... }
_ux_utility_memory_free(cdc_acm -> ux_host_class_cdc_acm_allocated);
cdc_acm -> ux_host_class_cdc_acm_allocated = UX_NULL;
if (interface_parsed == UX_FALSE)
{
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_DESCRIPTOR_CORRUPTED);
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DESCRIPTOR_CORRUPTED, descriptor, 0, 0, UX_TRACE_ERRORS, 0, 0)
cdc_acm -> ux_host_class_cdc_acm_status = UX_DESCRIPTOR_CORRUPTED;
cdc_acm -> ux_host_class_cdc_acm_cmd_state = UX_HOST_CLASS_CDC_ACM_INIT_ERROR;
return;
}if (interface_parsed == UX_FALSE) { ... }
cdc_acm -> ux_host_class_cdc_acm_tick = _ux_utility_time_get();
cdc_acm -> ux_host_class_cdc_acm_cmd_state = UX_HOST_CLASS_CDC_ACM_INIT_DELAY_WAIT;
}_ux_host_class_cdc_acm_descriptors_parse (UX_HOST_CLASS_CDC_ACM *cdc_acm) { ... }
static inline UINT _ux_host_class_cdc_acm_activate_wait(UX_HOST_CLASS_COMMAND *command)
{
UX_HOST_CLASS *cdc_acm_class;
UX_HOST_CLASS_CDC_ACM *cdc_acm_inst;
UX_INTERFACE *interface;
UX_HOST_CLASS_CDC_ACM *cdc_acm;
UX_ENDPOINT *control_endpoint;
UX_TRANSFER *transfer;
UCHAR *buffer;
ULONG rate, stop_bit, parity, data_bit;
UINT status;
ULONG tick, diff;
interface = (UX_INTERFACE *)command -> ux_host_class_command_container;
cdc_acm = (UX_HOST_CLASS_CDC_ACM *) interface -> ux_interface_class_instance;
switch(cdc_acm -> ux_host_class_cdc_acm_cmd_state)
{
case UX_HOST_CLASS_CDC_ACM_INIT_DESCRIPTORS_PARSE:
_ux_host_class_cdc_acm_descriptors_parse(cdc_acm);
break;
case UX_HOST_CLASS_CDC_ACM_INIT_DESCRIPTORS_PARSE:
case UX_HOST_CLASS_CDC_ACM_INIT_DELAY_WAIT:
tick = _ux_utility_time_get();
diff = _ux_utility_time_elapsed(cdc_acm -> ux_host_class_cdc_acm_tick, tick);
if (diff > UX_MS_TO_TICK(UX_HOST_CLASS_CDC_ACM_DEVICE_INIT_DELAY))
{
cdc_acm -> ux_host_class_cdc_acm_allocated =
_ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY,
8);
if (cdc_acm -> ux_host_class_cdc_acm_allocated == UX_NULL)
{
cdc_acm -> ux_host_class_cdc_acm_status = UX_MEMORY_INSUFFICIENT;
cdc_acm -> ux_host_class_cdc_acm_cmd_state =
UX_HOST_CLASS_CDC_ACM_INIT_ERROR;
break;
}if (cdc_acm -> ux_host_class_cdc_acm_allocated == UX_NULL) { ... }
control_endpoint = &cdc_acm -> ux_host_class_cdc_acm_device ->
ux_device_control_endpoint;
transfer = &control_endpoint -> ux_endpoint_transfer_request;
transfer -> ux_transfer_request_data_pointer = (UCHAR *)
cdc_acm -> ux_host_class_cdc_acm_allocated;
transfer -> ux_transfer_request_flags = 0;
cdc_acm -> ux_host_class_cdc_acm_cmd_state =
UX_HOST_CLASS_CDC_ACM_INIT_LINE_CODING_SET;
}if (diff > UX_MS_TO_TICK(UX_HOST_CLASS_CDC_ACM_DEVICE_INIT_DELAY)) { ... }
break;
case UX_HOST_CLASS_CDC_ACM_INIT_DELAY_WAIT:
case UX_HOST_CLASS_CDC_ACM_INIT_LINE_CODING_SET:
buffer = (UCHAR *)cdc_acm -> ux_host_class_cdc_acm_allocated;
rate = UX_HOST_CLASS_CDC_ACM_LINE_CODING_DEFAULT_RATE;
stop_bit = UX_HOST_CLASS_CDC_ACM_LINE_CODING_DEFAULT_STOP_BIT;
parity = UX_HOST_CLASS_CDC_ACM_LINE_CODING_DEFAULT_PARITY;
data_bit = UX_HOST_CLASS_CDC_ACM_LINE_CODING_DEFAULT_DATA_BIT;
_ux_utility_long_put(buffer + UX_HOST_CLASS_CDC_ACM_LINE_CODING_RATE, rate);
*(buffer + UX_HOST_CLASS_CDC_ACM_LINE_CODING_STOP_BIT) = (UCHAR)stop_bit;
*(buffer + UX_HOST_CLASS_CDC_ACM_LINE_CODING_PARITY) = (UCHAR)parity;
*(buffer + UX_HOST_CLASS_CDC_ACM_LINE_CODING_DATA_BIT) = (UCHAR)data_bit;
status = _ux_host_class_cdc_acm_command(cdc_acm,
UX_HOST_CLASS_CDC_ACM_REQ_SET_LINE_CODING, 0,
buffer, UX_HOST_CLASS_CDC_ACM_LINE_CODING_LENGTH);
if (status != UX_SUCCESS)
{
cdc_acm -> ux_host_class_cdc_acm_status = status;
cdc_acm -> ux_host_class_cdc_acm_cmd_state =
UX_HOST_CLASS_CDC_ACM_INIT_ERROR;
break;
}if (status != UX_SUCCESS) { ... }
cdc_acm -> ux_host_class_cdc_acm_cmd_state =
UX_HOST_CLASS_CDC_ACM_INIT_TRANSFER_WAIT;
cdc_acm -> ux_host_class_cdc_acm_next_state =
UX_HOST_CLASS_CDC_ACM_INIT_LINE_CODING_GET;
break;
case UX_HOST_CLASS_CDC_ACM_INIT_LINE_CODING_SET:
case UX_HOST_CLASS_CDC_ACM_INIT_LINE_CODING_GET:
buffer = (UCHAR *)cdc_acm -> ux_host_class_cdc_acm_allocated;
status = _ux_host_class_cdc_acm_command(cdc_acm,
UX_HOST_CLASS_CDC_ACM_REQ_GET_LINE_CODING, 0,
buffer, UX_HOST_CLASS_CDC_ACM_LINE_CODING_LENGTH);
if (status != UX_SUCCESS)
{
cdc_acm -> ux_host_class_cdc_acm_status = status;
cdc_acm -> ux_host_class_cdc_acm_cmd_state =
UX_HOST_CLASS_CDC_ACM_INIT_ERROR;
break;
}if (status != UX_SUCCESS) { ... }
cdc_acm -> ux_host_class_cdc_acm_cmd_state =
UX_HOST_CLASS_CDC_ACM_INIT_TRANSFER_WAIT;
cdc_acm -> ux_host_class_cdc_acm_next_state =
UX_HOST_CLASS_CDC_ACM_INIT_LINE_CODING_CHECK;
break;
case UX_HOST_CLASS_CDC_ACM_INIT_LINE_CODING_GET:
case UX_HOST_CLASS_CDC_ACM_INIT_LINE_CODING_CHECK:
buffer = (UCHAR *)cdc_acm -> ux_host_class_cdc_acm_allocated;
rate = _ux_utility_long_get(buffer + UX_HOST_CLASS_CDC_ACM_LINE_CODING_RATE);
stop_bit = *(buffer + UX_HOST_CLASS_CDC_ACM_LINE_CODING_STOP_BIT);
parity = *(buffer + UX_HOST_CLASS_CDC_ACM_LINE_CODING_PARITY);
data_bit = *(buffer + UX_HOST_CLASS_CDC_ACM_LINE_CODING_DATA_BIT);
if (rate != UX_HOST_CLASS_CDC_ACM_LINE_CODING_DEFAULT_RATE ||
stop_bit != UX_HOST_CLASS_CDC_ACM_LINE_CODING_DEFAULT_STOP_BIT ||
parity != UX_HOST_CLASS_CDC_ACM_LINE_CODING_DEFAULT_PARITY ||
data_bit != UX_HOST_CLASS_CDC_ACM_LINE_CODING_DEFAULT_DATA_BIT)
{
cdc_acm -> ux_host_class_cdc_acm_status = UX_DEVICE_ENUMERATION_FAILURE;
cdc_acm -> ux_host_class_cdc_acm_cmd_state = UX_HOST_CLASS_CDC_ACM_INIT_ERROR;
break;
}if (rate != UX_HOST_CLASS_CDC_ACM_LINE_CODING_DEFAULT_RATE || stop_bit != UX_HOST_CLASS_CDC_ACM_LINE_CODING_DEFAULT_STOP_BIT || parity != UX_HOST_CLASS_CDC_ACM_LINE_CODING_DEFAULT_PARITY || data_bit != UX_HOST_CLASS_CDC_ACM_LINE_CODING_DEFAULT_DATA_BIT) { ... }
case UX_HOST_CLASS_CDC_ACM_INIT_LINE_CODING_CHECK:
case UX_HOST_CLASS_CDC_ACM_INIT_LINE_STATE_SET:
buffer = (UCHAR *)cdc_acm -> ux_host_class_cdc_acm_allocated;
*(buffer) = UX_HOST_CLASS_CDC_ACM_CTRL_DTR | UX_HOST_CLASS_CDC_ACM_CTRL_RTS;
status = _ux_host_class_cdc_acm_command(cdc_acm,
UX_HOST_CLASS_CDC_ACM_REQ_SET_LINE_STATE,
*(buffer), UX_NULL, 0);
if (status != UX_SUCCESS)
{
cdc_acm -> ux_host_class_cdc_acm_status = status;
cdc_acm -> ux_host_class_cdc_acm_cmd_state =
UX_HOST_CLASS_CDC_ACM_INIT_ERROR;
break;
}if (status != UX_SUCCESS) { ... }
cdc_acm -> ux_host_class_cdc_acm_cmd_state =
UX_HOST_CLASS_CDC_ACM_INIT_TRANSFER_WAIT;
cdc_acm -> ux_host_class_cdc_acm_next_state =
UX_HOST_CLASS_CDC_ACM_INIT_DONE;
break;
case UX_HOST_CLASS_CDC_ACM_INIT_LINE_STATE_SET:
case UX_HOST_CLASS_CDC_ACM_INIT_ERROR:
case UX_HOST_CLASS_CDC_ACM_INIT_ERROR:
case UX_HOST_CLASS_CDC_ACM_INIT_DONE:
if (cdc_acm -> ux_host_class_cdc_acm_allocated)
{
_ux_utility_memory_free(cdc_acm -> ux_host_class_cdc_acm_allocated);
cdc_acm -> ux_host_class_cdc_acm_allocated = UX_NULL;
}if (cdc_acm -> ux_host_class_cdc_acm_allocated) { ... }
if (cdc_acm -> ux_host_class_cdc_acm_status == UX_SUCCESS)
{
cdc_acm_class = cdc_acm -> ux_host_class_cdc_acm_class;
cdc_acm_inst = (UX_HOST_CLASS_CDC_ACM *)cdc_acm_class -> ux_host_class_first_instance;
while(cdc_acm_inst)
{
interface = cdc_acm_inst -> ux_host_class_cdc_acm_interface;
if (cdc_acm -> ux_host_class_cdc_acm_interfaces_bitmap &
(1ul << interface -> ux_interface_descriptor.bInterfaceNumber))
{
cdc_acm_inst -> ux_host_class_cdc_acm_control = cdc_acm;
break;
}if (cdc_acm -> ux_host_class_cdc_acm_interfaces_bitmap & (1ul << interface -> ux_interface_descriptor.bInterfaceNumber)) { ... }
cdc_acm_inst = cdc_acm_inst -> ux_host_class_cdc_acm_next_instance;
}while (cdc_acm_inst) { ... }
cdc_acm -> ux_host_class_cdc_acm_state = UX_HOST_CLASS_INSTANCE_LIVE;
/* ... */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_INSERTION, cdc_acm -> ux_host_class_cdc_acm_class, (VOID *) cdc_acm);
}if (_ux_system_host -> ux_system_host_change_function != UX_NULL) { ... }
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_CDC_ACM_ACTIVATE, cdc_acm, 0, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
UX_TRACE_OBJECT_REGISTER(UX_TRACE_HOST_OBJECT_TYPE_INTERFACE, cdc_acm, 0, 0, 0)
cdc_acm -> ux_host_class_cdc_acm_cmd_state = UX_STATE_RESET;
}if (cdc_acm -> ux_host_class_cdc_acm_status == UX_SUCCESS) { ... }
else
{
if (cdc_acm -> ux_host_class_cdc_acm_interrupt_endpoint &&
cdc_acm -> ux_host_class_cdc_acm_interrupt_endpoint -> ux_endpoint_transfer_request.ux_transfer_request_data_pointer)
{
_ux_host_stack_endpoint_transfer_abort(cdc_acm -> ux_host_class_cdc_acm_interrupt_endpoint);
_ux_utility_memory_free(cdc_acm -> ux_host_class_cdc_acm_interrupt_endpoint -> ux_endpoint_transfer_request.ux_transfer_request_data_pointer);
}if (cdc_acm -> ux_host_class_cdc_acm_interrupt_endpoint && cdc_acm -> ux_host_class_cdc_acm_interrupt_endpoint -> ux_endpoint_transfer_request.ux_transfer_request_data_pointer) { ... }
_ux_host_stack_class_instance_destroy(cdc_acm -> ux_host_class_cdc_acm_class, (VOID *) cdc_acm);
interface = cdc_acm -> ux_host_class_cdc_acm_interface;
interface -> ux_interface_class_instance = UX_NULL;
_ux_utility_memory_free(cdc_acm);
}else { ... }
return(UX_STATE_NEXT);
case UX_HOST_CLASS_CDC_ACM_INIT_DONE:
case UX_HOST_CLASS_CDC_ACM_INIT_TRANSFER_WAIT:
control_endpoint = &cdc_acm -> ux_host_class_cdc_acm_device -> ux_device_control_endpoint;
transfer = &control_endpoint -> ux_endpoint_transfer_request;
status = _ux_host_stack_transfer_run(transfer);
if (status <= UX_STATE_NEXT)
{
if (transfer -> ux_transfer_request_completion_code != UX_SUCCESS)
{
cdc_acm -> ux_host_class_cdc_acm_cmd_state = UX_STATE_EXIT;
break;
}if (transfer -> ux_transfer_request_completion_code != UX_SUCCESS) { ... }
cdc_acm -> ux_host_class_cdc_acm_cmd_state =
cdc_acm -> ux_host_class_cdc_acm_next_state;
break;
}if (status <= UX_STATE_NEXT) { ... }
break;
case UX_HOST_CLASS_CDC_ACM_INIT_TRANSFER_WAIT:
default:
return(UX_STATE_NEXT);default
}switch (cdc_acm -> ux_host_class_cdc_acm_cmd_state) { ... }
return(UX_STATE_WAIT);
}_ux_host_class_cdc_acm_activate_wait (UX_HOST_CLASS_COMMAND *command) { ... }
/* ... */#endif...