Rev 727 | Rev 732 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 727 | Rev 731 | ||
---|---|---|---|
Line 357... | Line 357... | ||
357 | LED_RED_ON; |
357 | LED_RED_ON; |
358 | sprintf(ErrorMSG,"ERR:Motor restart "); |
358 | sprintf(ErrorMSG,"ERR:Motor restart "); |
359 | newErrorCode = 23; |
359 | newErrorCode = 23; |
360 | DebugOut.StatusRed |= AMPEL_BL; |
360 | DebugOut.StatusRed |= AMPEL_BL; |
361 | } |
361 | } |
362 | else if(BL_MinOfMaxPWM < 30 && !ErrorCode) |
362 | else if(BL_MinOfMaxPWM && BL_MinOfMaxPWM < 30 && !ErrorCode) |
363 | { |
363 | { |
364 | u16 i; |
364 | u16 i; |
365 | for(i = 0; i < 12; i++) if(Motor[i].MaxPWM == BL_MinOfMaxPWM) break; |
365 | for(i = 0; i < 16; i++) if(Motor[i].MaxPWM == BL_MinOfMaxPWM) break; // find the motor number |
366 | LED_RED_ON; |
366 | LED_RED_ON; |
367 | sprintf(ErrorMSG,"ERR:BL%2d Test:%2d ",i+1,BL_MinOfMaxPWM); |
367 | sprintf(ErrorMSG,"ERR:BL%2d Test:%2d ",i+1,BL_MinOfMaxPWM); |
368 | newErrorCode = 32; |
368 | newErrorCode = 32; |
369 | DebugOut.StatusRed |= AMPEL_BL; |
369 | DebugOut.StatusRed |= AMPEL_BL; |
370 | } |
370 | } |
Line 577... | Line 577... | ||
577 | if(FC.StatusFlags & FC_STATUS_FLY) |
577 | if(FC.StatusFlags & FC_STATUS_FLY) |
578 | { |
578 | { |
579 | NaviData.FlyingTime++; // we want to count the battery-time |
579 | NaviData.FlyingTime++; // we want to count the battery-time |
580 | TimeSinceMotorStart++; |
580 | TimeSinceMotorStart++; |
581 | } |
581 | } |
582 | 582 | ||
- | 583 | if(EE_Parameter.Revision == 0) RequestConfigFromFC = 1; |
|
583 | if(SerialLinkOkay) SerialLinkOkay--; |
584 | if(SerialLinkOkay) SerialLinkOkay--; |
584 | if(SerialLinkOkay < 250 - 6) NCFlags |= NC_FLAG_NOSERIALLINK; // 6 seconds timeout for serial communication |
585 | if(SerialLinkOkay < 250 - 6) NCFlags |= NC_FLAG_NOSERIALLINK; // 6 seconds timeout for serial communication |
585 | else NCFlags &= ~NC_FLAG_NOSERIALLINK; |
586 | else NCFlags &= ~NC_FLAG_NOSERIALLINK; |
586 | if(StopNavigation && (Parameter.NaviGpsModeControl >= 50) && (Parameter.GlobalConfig & FC_CFG_GPS_AKTIV)) BeepTime = 1000; |
587 | if(StopNavigation && (Parameter.NaviGpsModeControl >= 50) && (Parameter.GlobalConfig & FC_CFG_GPS_AKTIV)) BeepTime = 1000; |
587 | } |
588 | } |
Line 667... | Line 668... | ||
667 | GetNaviCtrlVersion(); |
668 | GetNaviCtrlVersion(); |
668 | DebugOut.StatusGreen = AMPEL_NC | AMPEL_COMPASS; // NC and MK3Mag |
669 | DebugOut.StatusGreen = AMPEL_NC | AMPEL_COMPASS; // NC and MK3Mag |
669 | DebugOut.StatusRed = 0x00; |
670 | DebugOut.StatusRed = 0x00; |
670 | UART1_PutString("\r\n++++++++++++++++++++++++++++++++++++++++++"); |
671 | UART1_PutString("\r\n++++++++++++++++++++++++++++++++++++++++++"); |
671 | Compass_Init(); |
672 | Compass_Init(); |
672 | - | ||
673 | #ifdef FOLLOW_ME |
673 | #ifdef FOLLOW_ME |
674 | TransmitAlsoToFC = 1; |
674 | TransmitAlsoToFC = 1; |
675 | UART1_PutString("\r\n++++++++++++++++++++++++++++++++++++++++++"); |
675 | UART1_PutString("\r\n++++++++++++++++++++++++++++++++++++++++++"); |
676 | UART1_PutString("\n\r FOLLOW-ME Transmitter only!"); |
676 | UART1_PutString("\n\r FOLLOW-ME Transmitter only!"); |
677 | UART1_PutString("\r\n++++++++++++++++++++++++++++++++++++++++++\r\n\r\n"); |
677 | UART1_PutString("\r\n++++++++++++++++++++++++++++++++++++++++++\r\n\r\n"); |
Line 685... | Line 685... | ||
685 | } |
685 | } |
686 | #endif |
686 | #endif |
687 | if(IamMaster == SLAVE) UART1_PutString(" SLAVE\r\n"); |
687 | if(IamMaster == SLAVE) UART1_PutString(" SLAVE\r\n"); |
688 | if(IamMaster == MASTER) UART1_PutString(" MASTER\r\n"); |
688 | if(IamMaster == MASTER) UART1_PutString(" MASTER\r\n"); |
Line -... | Line 689... | ||
- | 689 | ||
- | 690 | // +++++++++++++++++++++++++++++++++++++++ |
|
- | 691 | // ++ check CamCtrl version (if connected) |
|
- | 692 | if(Compass_I2CPort == NCMAG_PORT_INTERN) |
|
- | 693 | { |
|
- | 694 | if(I2CBus_LockBuffer(I2C0,3)) I2CBus_Transmission(I2C0, CAM_SLAVE_ADDRESS, &ToCamCtrl, 4, &CamCtrl_UpdateData, sizeof(FromCamCtrl)); |
|
- | 695 | } |
|
- | 696 | else CamCtrlTimeout = 0; // disable CamCtrl communication if external compass is connected |
|
689 | 697 | // +++++++++++++++++++++++++++++++++++++++ |
|
690 | if(UBX_Setup() == 0) UBX_Setup(); // inits the GPS-Module via ubx -> try twice |
698 | if(UBX_Setup() == 0) UBX_Setup(); // inits the GPS-Module via ubx -> try twice |
691 | GPS_Init(); |
699 | GPS_Init(); |
692 | // ---------- Prepare the isr driven |
700 | // ---------- Prepare the isr driven |
693 | // set to absolute lowest priority |
701 | // set to absolute lowest priority |
Line 710... | Line 718... | ||
710 | if(UART_VersionInfo.HWMajor >= 30) |
718 | if(UART_VersionInfo.HWMajor >= 30) |
711 | { |
719 | { |
712 | EXT2_Init(); // External Output EXT2 |
720 | EXT2_Init(); // External Output EXT2 |
713 | CanbusInit(); |
721 | CanbusInit(); |
714 | } |
722 | } |
- | 723 | if(FromCamCtrl.CamStatus) |
|
- | 724 | { |
|
- | 725 | u8 msg[30]; |
|
- | 726 | sprintf(msg, " CamCtrl found V%i.%02i \r\n",1 + FromCamCtrl.Version / 100, FromCamCtrl.Version % 100); |
|
- | 727 | UART1_PutString(msg); |
|
- | 728 | } |
|
- | 729 | else UART1_PutString(" No CamCtrl connected \r\n"); |
|
715 | // ++++++++++++++++++++++++++++++++++++++++++++++ |
730 | // ++++++++++++++++++++++++++++++++++++++++++++++ |
716 | for (;;) // the endless main loop |
731 | for (;;) // the endless main loop |
717 | { |
732 | { |
718 | PollingTimeout = 5; |
733 | PollingTimeout = 5; |
719 | Polling(); |
734 | Polling(); |