Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add device state check define to avoid use of internal struct fileds in app level #185

Merged

Conversation

ayedm1
Copy link
Contributor

@ayedm1 ayedm1 commented Feb 4, 2025

add a define

#define UX_SLAVE_DEVICE_CHECK_STATE(state)                                                        \
  (_ux_system_slave->ux_system_slave_device.ux_slave_device_state & (state)) ? UX_TRUE : UX_FALSE \

instead of testing device state at applicative level

     UX_SLAVE_DEVICE *device;
     device = &_ux_system_slave->ux_system_slave_device;

    /* Check if the device state already configured */
    if ((device->ux_slave_device_state == UX_DEVICE_CONFIGURED) && (hid_mouse != UX_NULL))
    {
    }

we can do that :

      if ((UX_SLAVE_DEVICE_CHECK_STATE(UX_DEVICE_CONFIGURED)) && (hid_mouse != UX_NULL))
      {
      }

@fdesbiens fdesbiens requested a review from a team February 13, 2025 15:03
@fdesbiens fdesbiens changed the base branch from master to dev February 13, 2025 15:08
@fdesbiens fdesbiens merged commit 93d7dcc into eclipse-threadx:dev Feb 14, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants