Subversion Repositories FlightCtrl

Rev

Rev 1793 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1793 Rev 1799
Line 48... Line 48...
48
// +  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48
// +  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49
// +  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
49
// +  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
50
// +  POSSIBILITY OF SUCH DAMAGE.
50
// +  POSSIBILITY OF SUCH DAMAGE.
51
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
51
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
52
#include "main.h"
52
#include "main.h"
53
 
-
 
-
 
53
//MartinW MaxSize is 63488 bytes
Line 54... Line 54...
54
 
54
 
55
unsigned char PlatinenVersion = 10;
55
unsigned char PlatinenVersion = 10;
56
unsigned char SendVersionToNavi = 1;
56
unsigned char SendVersionToNavi = 1;
57
unsigned char BattLowVoltageWarning = 94;
57
unsigned char BattLowVoltageWarning = 94;
Line 100... Line 100...
100
                        Piep(cells, 200);
100
                        Piep(cells, 200);
101
                        printf(" %d Cells ", cells);
101
                        printf(" %d Cells ", cells);
102
                }
102
                }
103
        }
103
        }
104
        else BattLowVoltageWarning = EE_Parameter.UnterspannungsWarnung;
104
        else BattLowVoltageWarning = EE_Parameter.UnterspannungsWarnung;
105
        if(print) printf(" Low warning level: %d.%d",BattLowVoltageWarning/10,BattLowVoltageWarning%10);
105
        if(print) printf("Low warning level: %d.%d",BattLowVoltageWarning/10,BattLowVoltageWarning%10);
106
}
106
}
Line 107... Line 107...
107
 
107
 
108
//############################################################################
108
//############################################################################
109
//Hauptprogramm
109
//Hauptprogramm
Line 168... Line 168...
168
        motor_read = 0;  // read the first I2C-Data
168
        motor_read = 0;  // read the first I2C-Data
169
        SendMotorData();
169
        SendMotorData();
170
        timer = SetDelay(500);
170
        timer = SetDelay(500);
171
        while(!(BLFlags & BLFLAG_TX_COMPLETE) && !CheckDelay(timer)); //wait for complete transfer
171
        while(!(BLFlags & BLFLAG_TX_COMPLETE) && !CheckDelay(timer)); //wait for complete transfer
Line 172... Line 172...
172
 
172
 
173
    printf("\n\rFound BL-Ctrl: ");
173
    printf("\n\rFound BLC: "); ///
174
    timer = SetDelay(4000);
174
    timer = SetDelay(4000);
175
        for(i=0; i < MAX_MOTORS; i++)
175
        for(i=0; i < MAX_MOTORS; i++)
176
        {
176
        {
177
                SendMotorData();
177
                SendMotorData();
Line 193... Line 193...
193
        }
193
        }
194
        for(i=0; i < MAX_MOTORS; i++)
194
        for(i=0; i < MAX_MOTORS; i++)
195
        {
195
        {
196
                if(!(Motor[i].State & MOTOR_STATE_PRESENT_MASK) && Mixer.Motor[i][0] > 0)
196
                if(!(Motor[i].State & MOTOR_STATE_PRESENT_MASK) && Mixer.Motor[i][0] > 0)
197
                {
197
                {
198
                        printf("\n\r\n\r!! MISSING BL-CTRL: %d !!",i+1);
198
                        printf("\n\r\n\r! MISSING BL-CTRL: %d !",i+1);///
199
                        ServoActive = 2; // just in case the FC would be used as camera-stabilizer
199
                        ServoActive = 2; // just in case the FC would be used as camera-stabilizer
200
                }
200
                }
201
                Motor[i].State &= ~MOTOR_STATE_ERROR_MASK; // clear error counter
201
                Motor[i].State &= ~MOTOR_STATE_ERROR_MASK; // clear error counter
202
        }
202
        }
203
        printf("\n\r===================================");
203
        printf("\n\r="); //MartinW; removed =
Line 204... Line 204...
204
 
204
 
Line 205... Line 205...
205
    if(RequiredMotors < FoundMotors) VersionInfo.HardwareError[1] |= FC_ERROR1_MIXER;
205
    if(RequiredMotors < FoundMotors) VersionInfo.HardwareError[1] |= FC_ERROR1_MIXER;
206
 
206
 
Line 227... Line 227...
227
        if((FlugMinutenGesamt == 0xFFFF) || (FlugMinuten == 0xFFFF))
227
        if((FlugMinutenGesamt == 0xFFFF) || (FlugMinuten == 0xFFFF))
228
        {
228
        {
229
                FlugMinuten = 0;
229
                FlugMinuten = 0;
230
                FlugMinutenGesamt = 0;
230
                FlugMinutenGesamt = 0;
231
        }
231
        }
232
    printf("\n\rFlight-time %u min  Total:%u min", FlugMinuten, FlugMinutenGesamt);
232
    printf("\n\rFlighttime %u min  Total:%u min", FlugMinuten, FlugMinutenGesamt);///
Line 233... Line 233...
233
 
233
 
234
        printf("\n\rControl: ");
234
        printf("\n\rControl: ");
235
        if (EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) printf("HeadingHold");
235
        if (EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) printf("HeadingHold");
-
 
236
        else printf("Normal (ACC-Mode)");
-
 
237
       
Line -... Line 238...
-
 
238
#ifdef NODISPLAY                        // MartinW; for no MKT Display main.h
236
        else printf("Normal (ACC-Mode)");
239
 
-
 
240
#warning : "### no MKTool Display ###"
-
 
241
    LcdClear();
237
 
242
        #endif
238
    LcdClear();
243
       
239
    I2CTimeout = 5000;
244
    I2CTimeout = 5000;
Line 240... Line 245...
240
    WinkelOut.Orientation = 1;
245
    WinkelOut.Orientation = 1;
Line 241... Line 246...
241
    LipoDetection(1);
246
    LipoDetection(1);
242
 
247
 
243
        LIBFC_ReceiverInit(EE_Parameter.Receiver);
248
        LIBFC_ReceiverInit(EE_Parameter.Receiver);
244
 
249
 
Line 245... Line 250...
245
        printf("\n\r===================================\n\r");
250
        printf("\n\r=\n\r");/// Martinw; removed =