Skip to content

Instantly share code, notes, and snippets.

@dambo1993
Last active August 28, 2019 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dambo1993/9dae35ec474ebc215eeea9f52b2f7659 to your computer and use it in GitHub Desktop.
Save dambo1993/9dae35ec474ebc215eeea9f52b2f7659 to your computer and use it in GitHub Desktop.
enum with arrays
enum rc_button
{
RC_BUTTON_POWER,
RC_BUTTON_1,
RC_BUTTON_2,
RC_BUTTON_VOLUME_UP,
RC_BUTTON_VOLUME_DOWN,
RC_BUTTON_CNT,
};
static rc_command_cb buttons_to_commands_mapping[RC_BUTTON_CNT] =
{
[RC_BUTTON_POWER] = RC_COM_POWER_cb,
[RC_BUTTON_VOLUME_UP] = RC_SPEED_UP_cb,
[RC_BUTTON_VOLUME_DOWN] = RC_SPEED_DOWN_cb,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment