Possible failsafe fix for a MHz transmitter

Possible failsafe fix for a MHz transmitter

Postby shitHappens » Mon Jun 20, 2016 7:55 pm

I noticed failsafe doesn't work with my old 35MHz transmitter/receiver. So I tried to find a solution by changing the software...
I actually managed it by adding the line: "else failsafeCnt = failsafeCnt+1;" in the RX.ccp file:

Code: Select all
/**************************************************************************************/
/***************               Standard RX Pins reading            ********************/
/**************************************************************************************/
#if defined(STANDARD_RX)

#if defined(FAILSAFE) && !defined(PROMICRO)
   // predefined PC pin block (thanks to lianj)  - Version with failsafe
  #define RX_PIN_CHECK(pin_pos, rc_value_pos)                        \
    if (mask & PCInt_RX_Pins[pin_pos]) {                             \
      if (!(pin & PCInt_RX_Pins[pin_pos])) {                         \
        dTime = cTime-edgeTime[pin_pos];                             \
        if (900<dTime && dTime<2200) {                               \
          rcValue[rc_value_pos] = dTime;                             \
          if((rc_value_pos==THROTTLEPIN || rc_value_pos==YAWPIN ||   \
              rc_value_pos==PITCHPIN || rc_value_pos==ROLLPIN)       \
              && dTime>FAILSAFE_DETECT_TRESHOLD)                     \
                GoodPulses |= (1<<rc_value_pos);                     \
          //here I added "else failsafeCnt = failsafeCnt+1;"               
        }  else failsafeCnt = failsafeCnt+1;                         \
      } else edgeTime[psin_pos] = cTime;                              \
    }
#else
   // predefined PC pin block (thanks to lianj)  - Version without failsafe
  #define RX_PIN_CHECK(pin_pos, rc_value_pos)                        \
    if (mask & PCInt_RX_Pins[pin_pos]) {                             \
      if (!(pin & PCInt_RX_Pins[pin_pos])) {                         \
        dTime = cTime-edgeTime[pin_pos];                             \
        if (900<dTime && dTime<2200) {                               \
          rcValue[rc_value_pos] = dTime;                             \
        }                                                            \
      } else edgeTime[pin_pos] = cTime;                              \
    }
#endif


So because I'm not experienced with the MultiWii software my question is if this change could cause any problems or if someone already has an other or better solution for my problem.
Btw I tested it holding the copter but not flying.
I'm using the version 2.4.
shitHappens
 
Posts: 1
Joined: Mon Jun 20, 2016 7:33 pm

Return to Ideas

Who is online

Users browsing this forum: No registered users and 1 guest