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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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))
      {
      }

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.

1 participant