Rev 242 | Rev 247 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 242 | Rev 244 | ||
---|---|---|---|
Line 345... | Line 345... | ||
345 | // initialize UART0 (to MKGPS or MK3MAG) |
345 | // initialize UART0 (to MKGPS or MK3MAG) |
346 | UART0_Init(); |
346 | UART0_Init(); |
347 | // initialize adc |
347 | // initialize adc |
348 | Analog_Init(); |
348 | Analog_Init(); |
349 | // initialize usb |
349 | // initialize usb |
350 | //USB_ConfigInit(); |
350 | USB_ConfigInit(); |
351 | // initialize SPI0 to FC |
351 | // initialize SPI0 to FC |
352 | SPI0_Init(); |
352 | SPI0_Init(); |
353 | // initialize i2c bus (needs Timer 1) |
353 | // initialize i2c bus (needs Timer 1) |
354 | I2C1_Init(); |
354 | I2C1_Init(); |
355 | // initialize the gps position controller (needs Timer 1) |
355 | // initialize the gps position controller (needs Timer 1) |
Line 386... | Line 386... | ||
386 | // ---------- Prepare the isr driven |
386 | // ---------- Prepare the isr driven |
387 | // set to absolute lowest priority |
387 | // set to absolute lowest priority |
388 | VIC_Config(EXTIT3_ITLine, VIC_IRQ, PRIORITY_SW); |
388 | VIC_Config(EXTIT3_ITLine, VIC_IRQ, PRIORITY_SW); |
389 | // enable interrupts |
389 | // enable interrupts |
390 | VIC_ITCmd(EXTIT3_ITLine, ENABLE); |
390 | VIC_ITCmd(EXTIT3_ITLine, ENABLE); |
- | 391 | ||
391 | for (;;) // the endless main loop |
392 | for (;;) // the endless main loop |
392 | { |
393 | { |
393 | UART0_ProcessRxData(); // process request |
394 | UART0_ProcessRxData(); // process request |
394 | UART1_ProcessRxData(); // process request |
395 | UART1_ProcessRxData(); // process request |
395 | USB_ProcessRxData(); // process request |
396 | USB_ProcessRxData(); // process request |
396 | UART0_TransmitTxData(); // send answer |
397 | UART0_TransmitTxData(); // send answer |
397 | UART1_TransmitTxData(); // send answer |
398 | UART1_TransmitTxData(); // send answer |
398 | UART2_TransmitTxData(); // send answer |
399 | UART2_TransmitTxData(); // send answer |
399 | USB_TransmitTxData(); // send answer |
400 | USB_TransmitTxData(); // send answer |
400 | - | ||
401 | SPI0_UpdateBuffer(); // handle new SPI Data |
401 | SPI0_UpdateBuffer(); // handle new SPI Data |
402 | // ---------------- Error Check Timing ---------------------------- |
402 | // ---------------- Error Check Timing ---------------------------- |
403 | if(CheckDelay(TimerCheckError)) |
403 | if(CheckDelay(TimerCheckError)) |
404 | { |
404 | { |
405 | TimerCheckError = SetDelay(1000); |
405 | TimerCheckError = SetDelay(1000); |