Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void key_press(uint8_t * klock, volatile uint8_t * KPIN, uint8_t key_mask, void (*kfun)(void) ) {
- register uint8_t key_press = (*KPIN & key_mask);
- if( !*klock && !key_press ) {
- *klock=1;
- // reakcja na PRESS (wcinięcie przycisku)
- if(kfun) kfun();
- } else if( *klock && key_press ) (*klock)++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement