Subversion Repositories FlightCtrl

Rev

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

Rev 2045 Rev 2048
Line 1... Line 1...
1
#include <inttypes.h>
1
#include <inttypes.h>
2
#include "analog.h"
2
#include "analog.h"
3
#include "attitude.h"
3
#include "attitude.h"
4
#include "uart0.h"
4
#include "uart0.h"
5
#include "configuration.h"
5
#include "configuration.h"
-
 
6
#include "controlMixer.h"
Line 6... Line 7...
6
 
7
 
7
// for digital / LED debug.
8
// for digital / LED debug.
Line 8... Line 9...
8
#include "output.h"
9
#include "output.h"
Line 82... Line 83...
82
  // Experimental 0 alt number: 117100
83
  // Experimental 0 alt number: 117100
83
}
84
}
Line 84... Line 85...
84
 
85
 
85
// takes 180-200 usec (with integral term). That is too heavy!!!
86
// takes 180-200 usec (with integral term). That is too heavy!!!
-
 
87
// takes 100 usec without integral term.
-
 
88
void HC_periodicTaskAndPRTY(int16_t* PRTY) {
86
// takes 100 usec without integral term.
89
  HC_periodicTask();
87
uint16_t HC_getThrottle(uint16_t throttle) {
90
  int16_t throttle = PRTY[CONTROL_THROTTLE];
88
  int32_t height = analog_getHeight();
91
  int32_t height = analog_getHeight();
89
  int32_t heightError = rampedTargetHeight - height;
-
 
90
 
-
 
91
  //static int32_t lastHeight;
92
  int32_t heightError = rampedTargetHeight - height;
92
  int16_t dHeight = analog_getDHeight();
93
  int16_t dHeight = analog_getDHeight();
Line 93... Line 94...
93
  //lastHeight = height;
94
  //lastHeight = height;
94
 
95
 
Line 173... Line 174...
173
  } else
174
  } else
174
    debugOut.digital[0] &= ~DEBUG_HOVERTHROTTLE;
175
    debugOut.digital[0] &= ~DEBUG_HOVERTHROTTLE;
Line 175... Line 176...
175
 
176
 
Line 176... Line 177...
176
    */
177
    */
177
 
178
 
Line 178... Line 179...
178
  return throttle;
179
  PRTY[CONTROL_THROTTLE] = throttle;
179
}
180
}
180
 
181