Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
127 | ligi | 1 | /************************************************** |
2 | * |
||
3 | * |
||
4 | * Riddim |
||
5 | * Remote Interactive Digital Drone Interface Mashup |
||
6 | * |
||
7 | * 2007-2008 Marcus -LiGi- Bueschleb |
||
8 | * |
||
9 | * |
||
130 | ligi | 10 | **************************************************/ |
125 | ligi | 11 | |
127 | ligi | 12 | #include "riddim.h" |
41 | ligi | 13 | |
14 | |||
127 | ligi | 15 | int state=STATEID_SCANNING; |
41 | ligi | 16 | |
43 | ligi | 17 | |
47 | ligi | 18 | struct js_event x52_event_struct; |
19 | |||
48 | ligi | 20 | int engines_on=0; |
21 | int old_engines_on=0; |
||
22 | |||
130 | ligi | 23 | int *axis; |
24 | char *button; |
||
48 | ligi | 25 | |
127 | ligi | 26 | struct x52 *x52_output; |
47 | ligi | 27 | |
127 | ligi | 28 | int selected_bt_device=0; |
47 | ligi | 29 | |
43 | ligi | 30 | void write_display(int line,char* text) |
31 | { |
||
32 | if (x52_output) x52_settext(x52_output, line , text, strlen(text)); |
||
33 | } |
||
34 | |||
35 | void clear_display() |
||
36 | { |
||
37 | write_display(0,""); |
||
38 | write_display(1,""); |
||
39 | write_display(2,""); |
||
40 | } |
||
41 | |||
42 | |||
43 | void output_device_list() |
||
44 | { |
||
45 | int i; |
||
46 | char disp_txt[20]; |
||
47 | for(i=0;i<bt_device_count;i++) |
||
48 | { |
||
49 | if (i<3) |
||
50 | { |
||
51 | |||
52 | if (selected_bt_device==i) |
||
53 | sprintf(disp_txt,"#%s",names[i]); |
||
54 | else |
||
55 | sprintf(disp_txt," %s",names[i]); |
||
56 | write_display(i,disp_txt); |
||
57 | } |
||
58 | } |
||
59 | } |
||
60 | |||
127 | ligi | 61 | |
62 | void print_device_list() |
||
43 | ligi | 63 | { |
127 | ligi | 64 | int i; |
65 | for(i=0;i<bt_device_count;i++) |
||
66 | printf("device%i->%s\n",i,names[i]); |
||
43 | ligi | 67 | } |
68 | |||
69 | |||
130 | ligi | 70 | |
50 | ligi | 71 | int count=0; |
72 | int connected=0; |
||
43 | ligi | 73 | |
117 | ligi | 74 | |
75 | int input=INPUT_NONE; |
||
76 | |||
125 | ligi | 77 | |
483 | ligi | 78 | |
43 | ligi | 79 | int main(int argc, char**argv) |
80 | { |
||
125 | ligi | 81 | |
483 | ligi | 82 | printf("Starting Riddim %d.%d \n",RIDDIM_VERSION_MAJOR,RIDDIM_VERSION_MINOR ); |
43 | ligi | 83 | printf("\tRemote Interactive Digital Drone Interface Mashup\n"); |
127 | ligi | 84 | printf("\nusage:\n"); |
85 | printf("\t riddim [config_file]\n\n"); |
||
125 | ligi | 86 | |
127 | ligi | 87 | |
88 | |||
483 | ligi | 89 | collect_evdev_devices(); |
90 | |||
91 | bt_host_init(); |
||
92 | |||
130 | ligi | 93 | if (argv[1]) |
94 | parse_config(argv[1]); |
||
95 | else |
||
96 | parse_config("/etc/riddim.conf"); |
||
125 | ligi | 97 | |
483 | ligi | 98 | // exit(0); |
125 | ligi | 99 | |
130 | ligi | 100 | printf("input %s:\n",input_evdev_name); |
101 | /* |
||
102 | if (bluetooth_mac) |
||
50 | ligi | 103 | { |
130 | ligi | 104 | |
105 | printf("Connecting via Bluetooth to %s\n",bluetooth_mac); |
||
106 | if (connect_mk_bluetooth(bluetooth_mac));; |
||
107 | connected=TRUE; |
||
127 | ligi | 108 | } |
130 | ligi | 109 | */ |
483 | ligi | 110 | |
111 | if (mk_tty) |
||
112 | { |
||
113 | printf("connecting to mk via tty: %s\n",mk_tty); |
||
114 | if (!connect_mk_tty(mk_tty)) |
||
115 | printf("cant connect !!"); |
||
116 | else |
||
117 | { |
||
118 | printf("connected !-)"); |
||
119 | connected=TRUE; |
||
120 | } |
||
121 | } |
||
122 | |||
127 | ligi | 123 | if (mk_socket_port) |
124 | { |
||
483 | ligi | 125 | printf("connecting to mk via local port: %i\n",mk_socket_port); |
130 | ligi | 126 | |
127 | ligi | 127 | if (connect_mk_localhost_socket(mk_socket_port)==-1) |
128 | printf("cant connect !!"); |
||
129 | else |
||
50 | ligi | 130 | { |
130 | ligi | 131 | printf("connected !-)"); |
127 | ligi | 132 | connected=TRUE; |
50 | ligi | 133 | } |
134 | } |
||
127 | ligi | 135 | |
130 | ligi | 136 | // todo reenable bluetooth connection |
117 | ligi | 137 | |
483 | ligi | 138 | connect_evdev(); |
139 | |||
140 | /* |
||
140 | ligi | 141 | if ((input_evdev_name)) |
117 | ligi | 142 | { |
130 | ligi | 143 | printf("\nInitializing evdev input (%s) ..\n",input_evdev_name); |
144 | |||
145 | if (connect_evdev(input_evdev_name)) |
||
146 | { |
||
147 | printf(".. done");// |
||
148 | input=INPUT_EVDEV; |
||
149 | } |
||
150 | else |
||
151 | printf(".. ERROR ");// |
||
117 | ligi | 152 | } |
483 | ligi | 153 | */ |
140 | ligi | 154 | if (input_joydev_name) |
155 | { |
||
156 | printf("\nInitializing joystick input from %s ..\n",input_joydev_name); |
||
157 | if (connect_joy()) |
||
158 | { |
||
159 | printf(".. done");// |
||
160 | input=INPUT_JOYDEV; |
||
161 | } |
||
162 | else |
||
163 | printf(".. ERROR ");// |
||
164 | } |
||
165 | |||
166 | |||
43 | ligi | 167 | printf("\nInitializing X-52 output .."); |
168 | |||
47 | ligi | 169 | x52_output = x52_init(); |
170 | |||
171 | clear_display(); |
||
43 | ligi | 172 | |
47 | ligi | 173 | write_display(0, "RIDDIM active"); |
43 | ligi | 174 | |
47 | ligi | 175 | if (x52_output) x52_setbri(x52_output, 1,128); |
176 | if (x52_output) |
||
177 | printf(" done \n"); |
||
178 | else |
||
179 | printf(" not found \n"); |
||
43 | ligi | 180 | |
127 | ligi | 181 | /* |
130 | ligi | 182 | if (!connected) |
43 | ligi | 183 | { |
130 | ligi | 184 | printf("Scanning for Bluetooth Devices ..\n"); |
185 | write_display(1,"Bluetooth Scan"); |
||
186 | scan_bt(); |
||
187 | printf(" done \n"); |
||
188 | printf(" %d Devices found \n",bt_device_count); |
||
189 | print_device_list() ; |
||
43 | ligi | 190 | } |
127 | ligi | 191 | */ |
41 | ligi | 192 | |
130 | ligi | 193 | // int v_old; |
117 | ligi | 194 | int polls=0; |
127 | ligi | 195 | |
130 | ligi | 196 | |
127 | ligi | 197 | if (exit_after_init) |
198 | exit(0); |
||
117 | ligi | 199 | printf("starting loop ..\n"); |
200 | |||
201 | |||
130 | ligi | 202 | |
127 | ligi | 203 | int complete_misses=0; |
130 | ligi | 204 | int complete_matches=0; |
117 | ligi | 205 | |
130 | ligi | 206 | |
127 | ligi | 207 | int confirm_misses; |
130 | ligi | 208 | |
209 | |||
210 | |||
483 | ligi | 211 | // init_evdevstatus_led(); |
130 | ligi | 212 | |
213 | while( TRUE ) |
||
41 | ligi | 214 | { |
117 | ligi | 215 | |
483 | ligi | 216 | // blink_evdev_led(); |
217 | bt_host_tick(mk_socket); |
||
127 | ligi | 218 | usleep(loop_delay); |
483 | ligi | 219 | |
220 | |||
221 | |||
222 | poll_evdev(); |
||
223 | |||
117 | ligi | 224 | switch (input) |
43 | ligi | 225 | { |
127 | ligi | 226 | |
117 | ligi | 227 | |
228 | case INPUT_NONE: |
||
140 | ligi | 229 | printf("processing input none\n"); |
117 | ligi | 230 | break; |
43 | ligi | 231 | |
117 | ligi | 232 | case INPUT_EVDEV: |
140 | ligi | 233 | printf("processing input evdev\n"); |
483 | ligi | 234 | |
130 | ligi | 235 | |
236 | break; |
||
117 | ligi | 237 | |
238 | case INPUT_JOYDEV: |
||
140 | ligi | 239 | printf("processing input joydev\n"); |
117 | ligi | 240 | // poll values from input device |
241 | |||
242 | for (polls=0;polls<100;polls++) // FIXME - better Polling |
||
243 | { |
||
140 | ligi | 244 | read(joy_input_fd, &x52_event_struct, sizeof(struct js_event)); |
117 | ligi | 245 | |
246 | |||
247 | /* see what to do with the event */ |
||
248 | switch (x52_event_struct.type & ~JS_EVENT_INIT) |
||
249 | { |
||
250 | case JS_EVENT_AXIS: |
||
251 | axis [ x52_event_struct.number ] = x52_event_struct.value; |
||
252 | break; |
||
253 | case JS_EVENT_BUTTON: |
||
254 | button [ x52_event_struct.number ] = x52_event_struct.value; |
||
255 | break; |
||
256 | } |
||
257 | } |
||
130 | ligi | 258 | int x; |
117 | ligi | 259 | for( x=0 ; x<num_of_buttons ; ++x ) |
260 | if( button[x]==0) |
||
261 | button_trigger[x]=0; |
||
262 | else |
||
263 | { |
||
264 | if (button_trigger[x]<100)button_trigger[x]++; |
||
265 | } |
||
266 | break; |
||
140 | ligi | 267 | } // switch (input) |
43 | ligi | 268 | |
117 | ligi | 269 | printf("input done\n"); |
43 | ligi | 270 | |
47 | ligi | 271 | switch(state) |
272 | { |
||
273 | case STATEID_SCANNING: |
||
130 | ligi | 274 | |
50 | ligi | 275 | state=STATEID_CONNECTING; |
130 | ligi | 276 | /* |
48 | ligi | 277 | ExternControl.Digital[0]=0; |
278 | ExternControl.Digital[1]=0; |
||
279 | ExternControl.RemoteTasten=0; |
||
280 | ExternControl.Nick=(axis[1]>>8)*(-1)+127;; |
||
281 | |||
282 | printf("nick%d\n",ExternControl.Nick); |
||
283 | ExternControl.Roll=(axis[0]>>8)*(-1)+127;; |
||
284 | ExternControl.Gier=(axis[5]>>8)*(-1)+127;; |
||
285 | ExternControl.Gas=(axis[2]>>8)*(-1)+127; |
||
286 | ExternControl.Higt=0; |
||
287 | ExternControl.free=0; |
||
288 | ExternControl.Frame='t'; |
||
289 | ExternControl.Config=1; |
||
290 | |||
291 | printf("sending data\n"); |
||
292 | |||
50 | ligi | 293 | |
127 | ligi | 294 | if (connected)SendOutData('b', 0, (unsigned char *)&ExternControl, sizeof(ExternControl)); |
50 | ligi | 295 | gettimeofday(&time_struct1,NULL); |
48 | ligi | 296 | |
47 | ligi | 297 | if (button_trigger[BUTTON_SELECT]==1) |
298 | { |
||
299 | state=STATEID_CONNECTING; |
||
300 | clear_display(); |
||
301 | write_display(0,"connecting to"); |
||
302 | write_display(1,names[selected_bt_device]); |
||
127 | ligi | 303 | //connect_mk(addrs[selected_bt_device]); |
47 | ligi | 304 | write_display(0,"connected to"); |
305 | } |
||
43 | ligi | 306 | |
47 | ligi | 307 | if ((button_trigger[BUTTON_UP]+button_trigger[BUTTON_DOWN])==1) |
308 | { |
||
309 | printf("-> sel_dev %d - %d\n",selected_bt_device,button_trigger[19]); |
||
310 | if (button_trigger[BUTTON_DOWN]==1) |
||
311 | if (selected_bt_device>0) selected_bt_device--; |
||
312 | if (button_trigger[BUTTON_UP]==1) |
||
313 | if (selected_bt_device<bt_device_count-1) selected_bt_device++; |
||
314 | |||
127 | ligi | 315 | |
47 | ligi | 316 | } |
130 | ligi | 317 | */ |
47 | ligi | 318 | break; |
48 | ligi | 319 | |
47 | ligi | 320 | case STATEID_CONNECTING: |
127 | ligi | 321 | |
50 | ligi | 322 | |
127 | ligi | 323 | confirm_misses=0; |
140 | ligi | 324 | |
483 | ligi | 325 | RxBuffer[2]=0; |
130 | ligi | 326 | if (connected) |
483 | ligi | 327 | while (RxBuffer[2]!='B') |
127 | ligi | 328 | { |
50 | ligi | 329 | |
127 | ligi | 330 | RxBuffer[1]=0; |
130 | ligi | 331 | read_from_mk(); |
483 | ligi | 332 | bt_host_send(RxBuffer,rx_last_length); |
333 | printf("sending to host: %s",PrintableRxBuffer); |
||
50 | ligi | 334 | |
117 | ligi | 335 | |
127 | ligi | 336 | // ftime(&time_struct); |
130 | ligi | 337 | |
483 | ligi | 338 | printf("waiting for confirm frame ( confirmed:%d misses:%d %c)\n",complete_matches,complete_misses,RxBuffer[2]); |
339 | // RxBuffer[2]=0; |
||
43 | ligi | 340 | |
130 | ligi | 341 | // r=0; |
43 | ligi | 342 | |
117 | ligi | 343 | // new |
130 | ligi | 344 | /* |
117 | ligi | 345 | if (button_trigger[12]>1) |
346 | { |
||
347 | SendOutData('s', 0, (unsigned char *)&ExternControl, sizeof(ExternControl)); |
||
348 | button_trigger[12]=0; |
||
349 | } |
||
130 | ligi | 350 | */ |
351 | ExternControl.Frame='t'; |
||
117 | ligi | 352 | if (++confirm_misses>4) |
127 | ligi | 353 | { |
354 | complete_misses++; |
||
355 | printf("sending again\n"); |
||
356 | SendOutData('b', 0, (unsigned char *)&ExternControl, sizeof(ExternControl)); |
||
357 | } |
||
48 | ligi | 358 | } |
127 | ligi | 359 | else |
360 | printf("not connected to mk\n"); |
||
130 | ligi | 361 | |
50 | ligi | 362 | gettimeofday(&time_struct2,NULL); |
43 | ligi | 363 | |
140 | ligi | 364 | printf("last trip: %d\n",(int)(time_struct2.tv_usec-time_struct1.tv_usec)); |
130 | ligi | 365 | // act_mode=button[24] | (button[25]<<1); |
43 | ligi | 366 | |
127 | ligi | 367 | |
368 | |||
369 | // Step converting axis data to nick/roll/gier/gas/.. |
||
370 | |||
140 | ligi | 371 | // act_nick=(evdev_rel_axis[rel_axis_nick]-128)*nick_mul; |
127 | ligi | 372 | |
373 | |||
140 | ligi | 374 | |
375 | |||
483 | ligi | 376 | /* Mix input values */ |
377 | |||
378 | act_gas=0; |
||
379 | act_nick=0; |
||
380 | act_roll=0; |
||
381 | act_gier=0; |
||
382 | |||
383 | int act_input=0; |
||
384 | for (act_input=0;act_input<input_count;act_input++) |
||
385 | { |
||
386 | //process buttons |
||
387 | if (inputs[act_input].nick_up_btn!=-1) |
||
388 | { |
||
389 | if (inputs[act_input].evdev_button[inputs[act_input].nick_up_btn]!=0) |
||
390 | act_nick=100; |
||
391 | |||
392 | } |
||
393 | |||
394 | if (inputs[act_input].nick_down_btn!=-1) |
||
395 | { |
||
396 | if (inputs[act_input].evdev_button[inputs[act_input].nick_down_btn]!=0) |
||
397 | act_nick=-100; |
||
398 | |||
399 | } |
||
400 | |||
401 | if (inputs[act_input].roll_left_btn!=-1) |
||
402 | { |
||
403 | if (inputs[act_input].evdev_button[inputs[act_input].roll_left_btn]!=0) |
||
404 | act_roll=100; |
||
405 | |||
406 | } |
||
407 | |||
408 | if (inputs[act_input].roll_right_btn!=-1) |
||
409 | { |
||
410 | if (inputs[act_input].evdev_button[inputs[act_input].roll_right_btn]!=0) |
||
411 | act_roll=-100; |
||
412 | |||
413 | } |
||
414 | |||
415 | // process axis |
||
416 | |||
417 | if (inputs[act_input].rel_axis_nick!=-1) |
||
418 | act_nick=inputs[act_input].evdev_rel_axis[inputs[act_input].rel_axis_nick]*inputs[act_input].nick_mul; |
||
419 | |||
420 | if (inputs[act_input].rel_axis_roll!=-1) |
||
421 | act_roll=inputs[act_input].evdev_rel_axis[inputs[act_input].rel_axis_roll]*inputs[act_input].roll_mul; |
||
422 | |||
423 | |||
424 | if (inputs[act_input].rel_axis_gier!=-1) |
||
425 | act_gier=inputs[act_input].evdev_rel_axis[inputs[act_input].rel_axis_gier]*inputs[act_input].gier_mul; |
||
426 | |||
427 | |||
428 | if (inputs[act_input].rel_axis_gas!=-1) |
||
429 | act_gas=inputs[act_input].evdev_rel_axis[inputs[act_input].rel_axis_gas]*inputs[act_input].gas_mul; |
||
430 | |||
431 | |||
432 | |||
433 | } |
||
434 | |||
140 | ligi | 435 | switch(input) |
436 | { |
||
437 | case INPUT_EVDEV: |
||
483 | ligi | 438 | /* |
140 | ligi | 439 | act_nick=(evdev_rel_axis[rel_axis_nick]-nick_add)*nick_mul; |
440 | act_roll=(evdev_rel_axis[rel_axis_roll]-nick_add)*roll_mul; |
||
441 | act_gier=(evdev_rel_axis[rel_axis_gier]-nick_add)*gier_mul; |
||
442 | act_gas=(evdev_rel_axis[rel_axis_gas]-nick_add)*gas_mul; |
||
483 | ligi | 443 | */ |
140 | ligi | 444 | |
445 | break; |
||
446 | |||
447 | case INPUT_JOYDEV: |
||
448 | act_nick=(axis[rel_axis_nick])*nick_mul; |
||
449 | act_roll=(axis[rel_axis_roll])*roll_mul; |
||
450 | act_gier=(axis[rel_axis_gier])*gier_mul; |
||
451 | act_gas=(axis[rel_axis_gas]*-1+33000)*gas_mul; |
||
452 | |||
453 | break; |
||
454 | } |
||
455 | |||
456 | // act values clipping to usefull vals |
||
457 | // act_gas=0; |
||
458 | |||
459 | // act_gas=255; |
||
460 | |||
461 | |||
127 | ligi | 462 | /* |
130 | ligi | 463 | switch (act_mode) |
50 | ligi | 464 | { |
465 | case 0: |
||
117 | ligi | 466 | |
467 | |||
130 | ligi | 468 | act_nick=(axis[AXIS_NICK])*(INVERT_NICK); |
469 | act_roll=(axis[AXIS_ROLL])*(INVERT_ROLL); |
||
470 | act_gier=(axis[AXIS_GIER])*(INVERT_GIER); |
||
471 | act_gas=((axis[AXIS_GAS])-128)*(-1); |
||
117 | ligi | 472 | |
130 | ligi | 473 | // clip gas |
474 | if (act_gas<0) act_gas=0; |
||
50 | ligi | 475 | |
130 | ligi | 476 | if (act_gas>250) act_gas=250; |
117 | ligi | 477 | |
130 | ligi | 478 | //////// act_gas=0; |
479 | break; |
||
50 | ligi | 480 | |
481 | case 1: |
||
130 | ligi | 482 | act_nick=(axis[AXIS_NICK]>>8)*(INVERT_NICK)/2; |
483 | act_roll=(axis[AXIS_ROLL]>>8)*(INVERT_ROLL)/2; |
||
484 | act_gier=(axis[AXIS_GIER]>>8)*(INVERT_GIER)/2; |
||
485 | act_gas=(axis[AXIS_GAS]>>8)*(INVERT_GAS); |
||
50 | ligi | 486 | |
130 | ligi | 487 | break; |
50 | ligi | 488 | |
489 | case 2: |
||
130 | ligi | 490 | act_nick=(axis[AXIS_NICK]>>8)*(INVERT_NICK)/3; |
491 | act_roll=(axis[AXIS_ROLL]>>8)*(INVERT_ROLL)/3; |
||
492 | act_gier=(axis[AXIS_GIER]>>8)*(INVERT_GIER)/3; |
||
493 | act_gas=(axis[AXIS_GAS]>>8)*(INVERT_GAS); |
||
50 | ligi | 494 | |
495 | |||
130 | ligi | 496 | break; |
50 | ligi | 497 | |
498 | } |
||
127 | ligi | 499 | */ |
48 | ligi | 500 | ExternControl.Digital[0]=0; |
501 | ExternControl.Digital[1]=0; |
||
502 | ExternControl.RemoteTasten=0; |
||
130 | ligi | 503 | ExternControl.Higt=0; |
504 | ExternControl.free=0; |
||
505 | ExternControl.Frame='t'; |
||
506 | ExternControl.Config=1; |
||
507 | |||
508 | |||
50 | ligi | 509 | ExternControl.Nick=act_nick; //(axis[1]>>8)*(-1)/2; |
117 | ligi | 510 | ExternControl.Roll=act_roll*(-1); //(axis[0]>>8)*(-1)/2; |
511 | ExternControl.Gier=act_gier; // ************ |
||
512 | ExternControl.Gas=act_gas; // ************ |
||
483 | ligi | 513 | ExternControl.Gas=255; // ************ |
50 | ligi | 514 | |
130 | ligi | 515 | |
48 | ligi | 516 | |
140 | ligi | 517 | printf("act_mode %d , act_nick %d , act_roll %d , act_gier %d , act_gas %d",act_mode , act_nick , act_roll , act_gier , act_gas); |
518 | |||
127 | ligi | 519 | if (connected) |
520 | { |
||
140 | ligi | 521 | complete_matches++; |
127 | ligi | 522 | printf("sending data\n"); |
523 | |||
524 | SendOutData('b', 0, (unsigned char *)&ExternControl, sizeof(ExternControl)); |
||
525 | gettimeofday(&time_struct1,NULL); |
||
526 | printf("sent data\n"); |
||
527 | } |
||
48 | ligi | 528 | |
130 | ligi | 529 | // printf("sleeping\n"); |
530 | // for (polls=0;polls<100;polls++) // FIXME - better Polling |
||
531 | // printf("end_sleep\n"); |
||
127 | ligi | 532 | |
130 | ligi | 533 | // int v=axis[6]/655+50; |
534 | // if (v!=v_old)if (x52_output) x52_setbri(x52_output, 0,v ); |
||
535 | // v_old=v; |
||
47 | ligi | 536 | |
130 | ligi | 537 | // printf("v: %d \n",v); |
127 | ligi | 538 | |
539 | |||
130 | ligi | 540 | /* |
541 | for (i=0;i<num_of_axis;i++) |
||
47 | ligi | 542 | printf("A%d: %d ", i,axis[i]>>8 ); |
543 | |||
130 | ligi | 544 | for( x=0 ; x<num_of_buttons ; ++x ) |
47 | ligi | 545 | |
546 | printf("B%d: %d ", x, button[x] ); |
||
130 | ligi | 547 | */ |
548 | |||
47 | ligi | 549 | break; |
550 | } |
||
127 | ligi | 551 | |
48 | ligi | 552 | printf("\n"); |
47 | ligi | 553 | fflush(stdout); |
130 | ligi | 554 | printf("loop fin ( confirmed:%d misses:%d | debug_sets:%d )\n",complete_matches,complete_misses,debug_sets); |
140 | ligi | 555 | printf("------------------------------------------------------------------------\n"); |
43 | ligi | 556 | |
50 | ligi | 557 | } |
41 | ligi | 558 | |
43 | ligi | 559 | |
47 | ligi | 560 | /******************** Cleanup **********************/ |
140 | ligi | 561 | close(joy_input_fd); |
127 | ligi | 562 | close(mk_socket); |
41 | ligi | 563 | |
564 | if (x52_output) x52_close(x52_output); |
||
565 | return 0; |
||
566 | } |