Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. int t;
  2.  
  3. void swap(int *x, int *y)
  4. {
  5. int s;
  6.  
  7. s = t; // save global variable
  8. t = *x;
  9. *x = *y;
  10.  
  11. // hardware interrupt might invoke isr() here!
  12. *y = t;
  13. t = s; // restore global variable
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement