Subversion Repositories FlightCtrl

Rev

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

Rev 2058 Rev 2059
Line 34... Line 34...
34
  static uint8_t setHeightLatch = 0;
34
  static uint8_t setHeightLatch = 0;
Line 35... Line 35...
35
 
35
 
36
  if (height > maxHeightThisFlight)
36
  if (height > maxHeightThisFlight)
Line -... Line 37...
-
 
37
    maxHeightThisFlight = height;
-
 
38
 
37
    maxHeightThisFlight = height;
39
  // debugOut.analog[25] = dynamicParams.heightSetting;
38
 
40
 
39
  if (staticParams.bitConfig & CFG_SIMPLE_HC_HOLD_SWITCH) {
41
  if (staticParams.bitConfig & CFG_SIMPLE_HC_HOLD_SWITCH) {
-
 
42
    // If switch is activated in config, the MaxHeight parameter is a switch value: ON in both ends of the range; OFF in the middle.
40
    // If switch is activated in config, the MaxHeight parameter is a switch value: ON in both ends of the range; OFF in the middle.
43
    // if (dynamicParams.heightSetting < 40 || dynamicParams.heightSetting > 255 - 40) {
41
    if (dynamicParams.heightSetting < 40 || dynamicParams.heightSetting > 255 - 40) {
44
    if (dynamicParams.heightSetting >= 255/3) {
42
      // Switch is ON
45
      // Switch is ON
43
      if (setHeightLatch <= LATCH_TIME) {
46
      if (setHeightLatch <= LATCH_TIME) {
44
        if (setHeightLatch == LATCH_TIME) {
47
        if (setHeightLatch == LATCH_TIME) {
Line 75... Line 78...
75
      }
78
      }
76
    }
79
    }
77
  }
80
  }
Line 78... Line 81...
78
 
81
 
79
  // height, in meters (so the division factor is: 100)
82
  // height, in meters (so the division factor is: 100)
80
  debugOut.analog[24] = (117100 - filteredAirPressure) / 100;
83
  // debugOut.analog[24] = (117100 - filteredAirPressure) / 100;
81
  // Calculated 0 alt number: 108205
84
  // Calculated 0 alt number: 108205
82
  // Experimental 0 alt number: 117100
85
  // Experimental 0 alt number: 117100
Line 83... Line 86...
83
}
86
}