int main(int argc, char** argv) { spaceship * s; double tmp=0; if (argc<=1) { printf("Warning: tempo de sleep nao definido, usando valor default 8ms. (chame o programa como ./eagle2014 <sleeptime in ms>\n"); } else if (argc==2) { tmp=strtod(argv[1],NULL); } else { printf("Demasiados argumentos enviados para o programa, saindo!\n"); exit(0); } if (tmp<1 || tmp > 200) { tmp = TARGET_FPS; printf("W: sleep alterado para " PRETOSTRING(TARGET_FPS) " frames por segundo\n"); } else { tmp = 1000.0/tmp; } s = spc_init(0,0,0,tmp); print_banner(); while(!menu(s)); spc_destroy(s); return 0; }
int spc_pcmcia_enable(device_t self, int onoff) { struct spc_pcmcia_softc *sc = device_private(self); int error; if (onoff) { /* Establish the interrupt handler. */ sc->sc_ih = pcmcia_intr_establish(sc->sc_pf, IPL_BIO, spc_intr, &sc->sc_spc); if (!sc->sc_ih) return EIO; error = pcmcia_function_enable(sc->sc_pf); if (error) { pcmcia_intr_disestablish(sc->sc_pf, sc->sc_ih); sc->sc_ih = 0; return error; } /* Initialize only chip. */ spc_init(&sc->sc_spc, 0); } else { pcmcia_function_disable(sc->sc_pf); pcmcia_intr_disestablish(sc->sc_pf, sc->sc_ih); sc->sc_ih = 0; } return 0; }
int main() { // wait until other side is ready _delay_us(200); spc_init(); spc_trx(0x03); // flash read spc_trx(0x01); // adr L spc_trx(0x00); // adr H /* Flash @ word 0x0001: 0xc0. This should appear in simsend in the gtkwave window! */ /* read byte and place into memory location where it can be read by by the verilog code... yes, this is very crude! */ *(unsigned char*)(0x70)=spc_trx(0x00); return 0; }
int main(int argc, char** argv) { spaceship * s; s = spc_init(0,0,0,TARGET_FPS); /*surface_planner(s->moon);*/ /*read_data_spec(s);*/ game_engine(s, MODE_GRAPHIC); modo_graph("vooLunarCorrente.txt", 0,0); printf("Press a key to continue"); modo_graph("vooLunarCorrente.txt", 0,1); printf("Press a key to continue"); modo_graph("vooLunarCorrente.txt", 0,2); printf("Press a key to continue"); modo_graph("vooLunarCorrente.txt", 0,3); printf("Press a key to continue"); modo_graph("vooLunarCorrente.txt", 0,4); printf("Press a key to continue"); modo_graph("vooLunarCorrente.txt", 0,5); printf("Press a key to continue"); modo_graph("vooLunarCorrente.txt", 0,6); printf("Press a key to continue"); getchar(); return 0; }