-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
In standalone mode with multiple classes, the task functions for later classes in the class array are not called unless all preceding classes have task functions defined.
usbx/common/core/src/ux_device_stack_tasks_run.c
Lines 89 to 106 in 68aee7d
| class_instance = _ux_system_slave -> ux_system_slave_class_array; | |
| for (class_index = 0; class_index < UX_SYSTEM_DEVICE_MAX_CLASS_GET(); class_index++) | |
| { | |
| /* Skip classes not used. */ | |
| if (class_instance -> ux_slave_class_status == UX_UNUSED) | |
| continue; | |
| /* Skip classes has no task function. */ | |
| if (class_instance -> ux_slave_class_task_function == UX_NULL) | |
| continue; | |
| /* Invoke task function. */ | |
| status |= class_instance -> ux_slave_class_task_function(class_instance -> ux_slave_class_instance); | |
| /* Move to the next class. */ | |
| class_instance ++; | |
| } |
If the first instance doesn't have a task function, the following class instances are not checked, since class_instance isn't incremented unless the task function was actually called. I moved class_instance++ into the for loop on L90 to fix this.
To Reproduce
Steps to reproduce the behavior:
- Use standalone mode.
- Use a class without a task function (e.g. CDC-ACM) followed by a class with a task function (e.g. Audio).
- Audio class task function is never called, so audio class does not work.
Expected behavior
Task functions are called for all class instances.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working