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