Example #1
0
void InitGPS()
{
	CalculateRotateFact();
	OSTimeDly(500);
        InitEncoders();
	InitGyro(GPS_TIMER_PPR / (double)GPS_TIMER_DIV);
	g_X = START_X ;
	g_Y = START_Y ;
	InitTimerInt(GPS_TIMER, GPS_TIMER_PPR, GPS_TIMER_DIV, GPS_ISR, 0x10);
}
Example #2
0
void TaskStart (void *data)
{
    auto UBYTE  i;
    // Create N_TASKS identical tasks
    for (i = 0; i < N_TASKS; i++) {
        TaskData[i] = i;          // Each task has its own number
        OSTaskCreate(Task, (void *)&TaskData[i], TASK_STK_SIZE, 11+i);
    }
    InitTimerInt();  // Setup Timer A internal interrupts
    OSStatInit();    // Initialize statistics task
    DispStr(0, 12, "#Tasks          : xxxxx  CPU Usage: xxxxx %");
    DispStr(0, 13, "#Task switch/sec: xxxxx");
    DispStr(0, 14, "<-PRESS 'Q' TO QUIT->");
    for (;;) {
        UpdateStat();
        OSTimeDly(OS_TICKS_PER_SEC);  // Wait one second
    }
}