Subversion Repositories FlightCtrl

Rev

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

Rev 2132 Rev 2135
Line 161... Line 161...
161
 
161
 
162
  PRYT[CONTROL_ELEVATOR]   = RCChannel(CH_ELEVATOR)   - rcTrim.trim[CH_ELEVATOR];
162
  PRYT[CONTROL_ELEVATOR]   = RCChannel(CH_ELEVATOR)   - rcTrim.trim[CH_ELEVATOR];
163
  PRYT[CONTROL_AILERONS]   = RCChannel(CH_AILERONS)   - rcTrim.trim[CH_AILERONS];
163
  PRYT[CONTROL_AILERONS]   = RCChannel(CH_AILERONS)   - rcTrim.trim[CH_AILERONS];
164
  PRYT[CONTROL_RUDDER]     = RCChannel(CH_RUDDER)     - rcTrim.trim[CH_RUDDER];
164
  PRYT[CONTROL_RUDDER]     = RCChannel(CH_RUDDER)     - rcTrim.trim[CH_RUDDER];
-
 
165
  PRYT[CONTROL_THROTTLE]   = RCChannel(CH_THROTTLE);  // no trim on throttle!
-
 
166
 
-
 
167
  debugOut.analog[20] = PRYT[CONTROL_ELEVATOR];
-
 
168
  debugOut.analog[21] = PRYT[CONTROL_AILERONS];
-
 
169
  debugOut.analog[22] = PRYT[CONTROL_RUDDER];
165
  PRYT[CONTROL_THROTTLE]   = RCChannel(CH_THROTTLE);  // no trim on throttle!
170
  debugOut.analog[23] = PRYT[CONTROL_THROTTLE];
Line 166... Line 171...
166
}
171
}
167
 
172
 
168
/*
173
/*
169
 * Get other channel value
174
 * Get other channel value
170
 */
175
 */
171
int16_t RC_getVariable(uint8_t varNum) {
176
int16_t RC_getVariable(uint8_t varNum) {
172
  if (varNum < 4)
177
  if (varNum < 4) {
-
 
178
    // 0th variable is 5th channel (1-based) etc.
-
 
179
    int16_t result = (RCChannel(varNum + CH_POTS) / 6) + channelMap.variableOffset;
-
 
180
    if (varNum<2) debugOut.analog[18+varNum] = result;
173
    // 0th variable is 5th channel (1-based) etc.
181
    return result;
174
    return (RCChannel(varNum + CH_POTS) >> 3) + channelMap.variableOffset;
182
  }
175
  /*
183
  /*
176
   * Let's just say:
184
   * Let's just say:
177
   * The RC variable i is hardwired to channel i, i>=4
185
   * The RC variable i is hardwired to channel i, i>=4