84,6 → 84,7 |
#include "uart1.h" |
#include "canbus.h" |
#include "triggerlog.h" |
#include "CamCtrl.h" |
|
|
#ifdef FOLLOW_ME |
489,10 → 490,21 |
if(CountMilliseconds != old_ms) // 1 ms |
{ |
if(CanbusTimeOut >= 2) CanbusTimeOut--; |
if(CamCtrlTimeout) |
{ |
if(--CamCtrlTimeout == 1) CamCtrlCharacter = '?'; |
else if(CamCtrlTimeout == 10000) CamCtrlTimeout = 0; // this is used during NC startup-Time phase |
} |
else |
{ |
if(TrigLogging.CountExternal) CamCtrlCharacter = TrigLogging.CountExternal % 10 + '0'; |
FromCamCtrl.CamStatus = 0; |
}; |
old_ms = CountMilliseconds; |
Compass_Update(); // update compass communication |
Analog_Update(); // get new ADC values |
CalcHeadFree(); |
if(CamCtrlTimeout > 1) CamCtrl_GetData(3); |
if(UART_VersionInfo.HWMajor >= 30) ProcessCanBus(); |
if(!CheckDelay(SPI0_Timeout)) TimeoutGPS_Process = 0; |
else if(CountMilliseconds - SPI0_Timeout > 30000000L) SPI0_Timeout = CountMilliseconds; // avoid too long overflows |
539,7 → 551,11 |
{ |
if(CheckDelay(TimerCheckError)) |
{ |
if(!BLITZ_CONNECTED) BlitzSchuhConnected = 1; else BlitzSchuhConnected = 0; |
if(!(FC.StatusFlags & FC_STATUS_FLY)) // do not change the Bit during flight |
{ |
if(!BLITZ_CONNECTED) BlitzSchuhConnected = 1; |
else BlitzSchuhConnected = 0; |
} |
TimerCheckError = SetDelay(1000); |
if(CompassValueErrorCount) CompassValueErrorCount--; |
if(++count5sec == 5) |
630,6 → 646,7 |
// initialize SPI0 to FC |
SPI0_Init(); |
// initialize i2c busses (needs Timer 1) |
InitCamCtrl(); |
I2CBus_Init(I2C0); |
I2CBus_Init(I2C1); |
// initialize fat16 partition on sd card (needs Timer 1) |