I'm trying to figure out some firmware that was written for us. I am not so familiar with C, and I think there are a few shortcuts here that I just don't get. I don’t understand how the code relates to comments, in particular, how you get 70 ms from any of them. Can you help translate into English?
State=(State<<1) | !input(USER_BUTTON) | 0xe000;
if(State==0xe000)
{
Debounced_Button_Pressed = TRUE;
time_button_held++;
}
else if (State==0xffff)
{
Debounced_Button_Pressed = FALSE;
}
This is a timer interrupt function and seems to fire every 4.4 ms
Thanks.
source
share