Advertisement
Guest User

kabel pod ziemio

a guest
May 16th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. void key_press(uint8_t * klock, volatile uint8_t * KPIN, uint8_t key_mask, void (*kfun)(void) ) {
  2.  
  3. register uint8_t key_press = (*KPIN & key_mask);
  4.  
  5. if( !*klock && !key_press ) {
  6. *klock=1;
  7.  
  8. // reakcja na PRESS (wcinięcie przycisku)
  9. if(kfun) kfun();
  10.  
  11. } else if( *klock && key_press ) (*klock)++;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement