/*************************************************************************** * \brief main * \return void ***************************************************************************/ void main (void) { int timerHandlerArray[ST_COUNT]; initInterrupt(); ST_Init(); timerHandlerArray[0] = ST_Create(INTERVAL, fkt0); timerHandlerArray[1] = ST_Create(ONESHOT, fkt1); timerHandlerArray[0] = ST_Start(timerHandlerArray[0], 10000); // 10s while(1) { if(stateRegister.restart) { printf("Restart Taste geduerckt\n"); stateRegister.restart = 0; } if(stateRegister.shoot & 0x02) { printf("Schuss-Taste gedrueckt"); if(!(stateRegister.shoot & 0x04)) { printf(" - Schuss abgesetzt"); stateRegister.shoot |= 0x04; //WeaponDelay aktiviert timerHandlerArray[1] = ST_Start(timerHandlerArray[1], 500); // 0.5s } printf("\n"); stateRegister.shoot &= 0x05; //Bit von Schuss-Taste lschen } if(stateRegister.move) { printf("An Drehschalter gedreht: "); if(stateRegister.move & SI_MOVE_LEFT) printf("Nach links\n"); else if(stateRegister.move & SI_MOVE_RIGHT) printf("Nach rechts\n"); else printf("Fehler\n"); stateRegister.move = 0; } } }
static TIFF *st_setup_test_info() { ST_TIFF *st; double dbl_data[100]; short shrt_data[] = { 1,1,0,6,1024,0,1,1,1025,0,1,1,1026,34737,17,0,2052,0,1,9001,2054,0,1,9102,3072,0,1,26711 }; char *ascii_data = "UTM 11 S E000|"; st = ST_Create(); dbl_data[0] = 60; dbl_data[1] = 60; dbl_data[2] = 0; ST_SetKey( st, 33550, 3, STT_DOUBLE, dbl_data ); dbl_data[0] = 0; dbl_data[1] = 0; dbl_data[2] = 0; dbl_data[3] = 440720; dbl_data[4] = 3751320; dbl_data[5] = 0; ST_SetKey( st, 33922, 6, STT_DOUBLE, dbl_data ); ST_SetKey( st, 34735, sizeof(shrt_data)/2, STT_SHORT, shrt_data ); ST_SetKey( st, 34737, strlen(ascii_data)+1, STT_ASCII, ascii_data ); return (TIFF *) st; }