Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #include <os.h>
  2. #include <common.h>
  3. #include "graphics.h"
  4. #include "utils.h"
  5. #include "main.h"
  6.  
  7. int main(void) {
  8. enableLink();
  9. clearScreen();
  10. unsigned char number = 0;
  11. while (!isKeyPressed(KEY_NSPIRE_ESC) && !isKeyPressed(KEY_84_CLEAR))
  12. {
  13. if (number < 128)
  14. {
  15. setTip();
  16. setRing();
  17. }
  18. else
  19. {
  20. resetTip();
  21. resetRing();
  22. }
  23. number++;
  24. }
  25. disableLink();
  26. return 0;
  27. }
  28.  
  29. void enableLink()
  30. {
  31. MISC_PORTS |= 0x20;
  32. }
  33.  
  34. void disableLink()
  35. {
  36. MISC_PORTS &= 0x20;
  37. }
  38.  
  39. void InterruptHandler()
  40. {
  41.  
  42. }
  43.  
  44. void setTip()
  45. {
  46. KEYPAD_84_IO |= 1;
  47. }
  48.  
  49. void resetTip()
  50. {
  51. KEYPAD_84_IO &= ~1;
  52. }
  53.  
  54. void setRing()
  55. {
  56. KEYPAD_84_IO |= 2;
  57. }
  58.  
  59. void resetRing()
  60. {
  61. KEYPAD_84_IO &= ~2;
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement