Rev 663 | Rev 693 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 663 | Rev 688 | ||
---|---|---|---|
Line 79... | Line 79... | ||
79 | #include "debug.h" |
79 | #include "debug.h" |
80 | #include "eeprom.h" |
80 | #include "eeprom.h" |
81 | #include "ssc.h" |
81 | #include "ssc.h" |
82 | #include "sdc.h" |
82 | #include "sdc.h" |
83 | #include "uart1.h" |
83 | #include "uart1.h" |
- | 84 | #include "canbus.h" |
|
Line 84... | Line 85... | ||
84 | 85 | ||
85 | 86 | ||
86 | #ifdef FOLLOW_ME |
87 | #ifdef FOLLOW_ME |
Line 454... | Line 455... | ||
454 | { |
455 | { |
455 | old_ms = CountMilliseconds; |
456 | old_ms = CountMilliseconds; |
456 | Compass_Update(); // update compass communication |
457 | Compass_Update(); // update compass communication |
457 | Analog_Update(); // get new ADC values |
458 | Analog_Update(); // get new ADC values |
458 | CalcHeadFree(); |
459 | CalcHeadFree(); |
- | 460 | if(UART_VersionInfo.HWMajor >= 30) ProcessCanBus(); |
|
459 | if(!CheckDelay(SPI0_Timeout)) TimeoutGPS_Process = 0; |
461 | if(!CheckDelay(SPI0_Timeout)) TimeoutGPS_Process = 0; |
460 | else if(CountMilliseconds - SPI0_Timeout > 30000000L) SPI0_Timeout = CountMilliseconds; // avoid too long overflows |
462 | else if(CountMilliseconds - SPI0_Timeout > 30000000L) SPI0_Timeout = CountMilliseconds; // avoid too long overflows |
461 | if(++TimeoutGPS_Process >= 25) |
463 | if(++TimeoutGPS_Process >= 25) |
462 | { |
464 | { |
463 | GPS_Navigation(&GPSData, &(ToFlightCtrl.GPSStick)); // process the GPS data even if the FC is not connected |
465 | GPS_Navigation(&GPSData, &(ToFlightCtrl.GPSStick)); // process the GPS data even if the FC is not connected |
Line 633... | Line 635... | ||
633 | Settings_GetParamValue(PID_SEND_NMEA,(u16 *) &NMEA_Interval); |
635 | Settings_GetParamValue(PID_SEND_NMEA,(u16 *) &NMEA_Interval); |
634 | UART1_PutString("\r\n"); |
636 | UART1_PutString("\r\n"); |
Line 635... | Line 637... | ||
635 | 637 | ||
636 | CompassValueErrorCount = 0; |
638 | CompassValueErrorCount = 0; |
- | 639 | I2CBus(Compass_I2CPort)->Timeout = SetDelay(3000); |
|
- | 640 | ||
- | 641 | // Intilizes the Canbus |
|
637 | I2CBus(Compass_I2CPort)->Timeout = SetDelay(3000); |
642 | if(UART_VersionInfo.HWMajor >= 30) CanbusInit(); |
638 | // ++++++++++++++++++++++++++++++++++++++++++++++ |
643 | // ++++++++++++++++++++++++++++++++++++++++++++++ |
639 | for (;;) // the endless main loop |
644 | for (;;) // the endless main loop |
640 | { |
645 | { |
641 | PollingTimeout = 5; |
646 | PollingTimeout = 5; |