Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int test_xpm(unsigned short xi, unsigned short yi, char *xpm[]) {
- 132
- 133
- vg_init(0x105); //resolution
- 134
- //vg_exit();
- 135
- 136
- message msg;
- 137
- //counter_timer = 0;
- 138
- code = 0;
- 139
- timer_test_square(60); //Resets time frequency to default to get the leds working in real time
- 140
- int ipc_status, r;
- 141
- int irq_set_kbd = kbd_subscribe_int(); //Subscriptions for both timer and keyboard
- 142
- int irq_set_timer = timer_subscribe_int();
- 143
- int xpm_width, xpm_height;
- 144
- 145
- char *map;
- 146
- 147
- 148
- 149
- map = read_xpm(pic1, &xpm_width, &xpm_height);
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- while ( code != BREAK_CODE )
- 157
- { //Cycle remains as long as ESC key is not pressed or the time given has not run out
- 158
- r = driver_receive(ANY,&msg,&ipc_status);
- 159
- 160
- if(r != 0) //In case something wrong happened with driver communication report error msg
- 161
- {
- 162
- printf("driver_receive falhou com: %d",r);
- 163
- continue;
- 164
- }
- 165
- 166
- if(is_ipc_notify(ipc_status))
- 167
- {
- 168
- switch (_ENDPOINT_P(msg.m_source))
- 169
- {
- 170
- case HARDWARE:
- 171
- if(msg.NOTIFY_ARG & irq_set_kbd)
- 172
- 173
- kbd_int_handler();
- 174
- 175
- 176
- 177
- 178
- //Increments the counter_timer to manage time
- 179
- break;
- 180
- 181
- default: break;
- 182
- }
- 183
- 184
- } else {}
- 185
- 186
- }
- 187
- 188
- 189
- //well, nothing. but wait. thats good because before I couldnt get out of the machine. It seems it is doing
- 190
- //the read_xpm but printing nothing. You must be doing something else wrong then.
- 191
- 192
- 193
- 194
- vg_exit();
- 195
- 196
- //UNSUBSCRIPTIONS
- 197
- kbd_unsubscribe_int();
- 198
- 199
- 200
- }
- 201
- 202
- int test_move(unsigned short xi, unsigned short yi, char *xpm[],
- 203
- unsigned short hor, short delta, unsigned short time) {
- 204
- 205
- /* To be completed */
- 206
- 207
- }
- 208
- 209
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement