Subversion Repositories FlightCtrl

Rev

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

Rev 2109 Rev 2110
Line 112... Line 112...
112
        // Analog data should have been ready but is not!!
112
        // Analog data should have been ready but is not!!
113
        debugOut.digital[0] |= DEBUG_MAINLOOP_TIMER;
113
        debugOut.digital[0] |= DEBUG_MAINLOOP_TIMER;
114
      } else {
114
      } else {
115
        debugOut.digital[0] &= ~DEBUG_MAINLOOP_TIMER;
115
        debugOut.digital[0] &= ~DEBUG_MAINLOOP_TIMER;
116
      }
116
      }
117
      J4HIGH;
117
      PD2HIGH;
118
      // This is probably the correct order:
118
      // This is probably the correct order:
119
      // The attitude computation should not depend on anything from control (except maybe the estimation of control activity level)
119
      // The attitude computation should not depend on anything from control (except maybe the estimation of control activity level)
120
      // The control may depend on attitude - for example, attitude control uses pitch and roll angles, compass control uses yaw angle etc.
120
      // The control may depend on attitude - for example, attitude control uses pitch and roll angles, compass control uses yaw angle etc.
121
      // Flight control uses results from both.
121
      // Flight control uses results from both.
122
      calculateFlightAttitude();
122
      calculateFlightAttitude();
123
      controlMixer_periodicTask();
123
      controlMixer_periodicTask();
124
      commands_handleCommands();
124
      commands_handleCommands();
125
      flight_control();
125
      flight_control();
126
      J4LOW;
126
      PD2LOW;
Line 127... Line 127...
127
 
127
 
128
      // Allow Serial Data Transmit if motors must not updated or motors are not running
128
      // Allow Serial Data Transmit if motors must not updated or motors are not running
129
      if (!runFlightControl || !isFlying) {
129
      if (!runFlightControl || !isFlying) {
130
        usart0_transmitTxData();
130
        usart0_transmitTxData();