Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. int count=0;
  2. char coord[4] = {'\0', '\0', '\0', '\0',};
  3. int t_i = 0;
  4. void TIM3_IRQHandler() {
  5. char key = key_scan();
  6. char input;
  7. if (phase == 0) {
  8. char result = getchar_irq();
  9.  
  10. if (my_turn == 'Y') {
  11. if (key != '\0') {
  12. t_i++;
  13. putchar_irq(key);
  14. if (t_i == 4) {
  15. pb8out();
  16. putchar_irq('Y');
  17. my_turn = 'N';
  18. }
  19. t_i = t_i % 4;
  20. }
  21. }
  22. else if (my_turn == 'N') {
  23. if ((result - 48 >= 0) && (result - 48 <= 9)) {
  24. coord[t_i] = result;
  25. t_i = (t_i + 1) % 4;
  26. if (t_i == 0) {
  27. my_turn = 'Y';
  28. }
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement