SHARE
TWEET

Untitled

a guest Apr 20th, 2019 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.                     if ((coord[0] && coord[1] && coord[2] && coord[3]) == '5') {
  28.                         pc11out();
  29.                     }
  30.                     my_turn = 'Y';
  31.                 }
  32.             }
  33.         }
  34.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top