Advertisement
Guest User

Untitled

a guest
Nov 25th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. int test_xpm(unsigned short xi, unsigned short yi, char *xpm[]) {
  2. 132
  3. 133
  4. vg_init(0x105); //resolution
  5. 134
  6. //vg_exit();
  7. 135
  8. 136
  9. message msg;
  10. 137
  11. //counter_timer = 0;
  12. 138
  13. code = 0;
  14. 139
  15. timer_test_square(60); //Resets time frequency to default to get the leds working in real time
  16. 140
  17. int ipc_status, r;
  18. 141
  19. int irq_set_kbd = kbd_subscribe_int(); //Subscriptions for both timer and keyboard
  20. 142
  21. int irq_set_timer = timer_subscribe_int();
  22. 143
  23. int xpm_width, xpm_height;
  24. 144
  25. 145
  26. char *map;
  27. 146
  28. 147
  29. 148
  30. 149
  31. map = read_xpm(pic1, &xpm_width, &xpm_height);
  32. 150
  33. 151
  34. 152
  35. 153
  36. 154
  37. 155
  38. 156
  39. while ( code != BREAK_CODE )
  40. 157
  41. { //Cycle remains as long as ESC key is not pressed or the time given has not run out
  42. 158
  43. r = driver_receive(ANY,&msg,&ipc_status);
  44. 159
  45. 160
  46. if(r != 0) //In case something wrong happened with driver communication report error msg
  47. 161
  48. {
  49. 162
  50. printf("driver_receive falhou com: %d",r);
  51. 163
  52. continue;
  53. 164
  54. }
  55. 165
  56. 166
  57. if(is_ipc_notify(ipc_status))
  58. 167
  59. {
  60. 168
  61. switch (_ENDPOINT_P(msg.m_source))
  62. 169
  63. {
  64. 170
  65. case HARDWARE:
  66. 171
  67. if(msg.NOTIFY_ARG & irq_set_kbd)
  68. 172
  69. 173
  70. kbd_int_handler();
  71. 174
  72. 175
  73. 176
  74. 177
  75. 178
  76. //Increments the counter_timer to manage time
  77. 179
  78. break;
  79. 180
  80. 181
  81. default: break;
  82. 182
  83. }
  84. 183
  85. 184
  86. } else {}
  87. 185
  88. 186
  89. }
  90. 187
  91. 188
  92. 189
  93. //well, nothing. but wait. thats good because before I couldnt get out of the machine. It seems it is doing
  94. 190
  95. //the read_xpm but printing nothing. You must be doing something else wrong then.
  96. 191
  97. 192
  98. 193
  99. 194
  100. vg_exit();
  101. 195
  102. 196
  103. //UNSUBSCRIPTIONS
  104. 197
  105. kbd_unsubscribe_int();
  106. 198
  107. 199
  108. 200
  109. }
  110. 201
  111. 202
  112. int test_move(unsigned short xi, unsigned short yi, char *xpm[],
  113. 203
  114. unsigned short hor, short delta, unsigned short time) {
  115. 204
  116. 205
  117. /* To be completed */
  118. 206
  119. 207
  120. }
  121. 208
  122. 209
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement