Subversion Repositories FlightCtrl

Rev

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

Rev 1872 Rev 1960
Line 38... Line 38...
38
}
38
}
Line 39... Line 39...
39
 
39
 
40
void EC_update() {
40
void EC_update() {
41
        if (externalControlActive) {
41
        if (externalControlActive) {
42
                externalControlActive--;
42
                externalControlActive--;
43
                EC_PRTY[CONTROL_PITCH] = externalControl.pitch * (int16_t) staticParams.StickP;
43
                EC_PRTY[CONTROL_PITCH] = externalControl.pitch * (int16_t) staticParams.stickP;
44
                EC_PRTY[CONTROL_ROLL] = externalControl.roll * (int16_t) staticParams.StickP;
44
                EC_PRTY[CONTROL_ROLL] = externalControl.roll * (int16_t) staticParams.stickP;
45
                EC_PRTY[CONTROL_THROTTLE] = externalControl.throttle;
45
                EC_PRTY[CONTROL_THROTTLE] = externalControl.throttle;
46
                EC_PRTY[CONTROL_YAW] = externalControl.yaw; // No stickP or similar??????
46
                EC_PRTY[CONTROL_YAW] = externalControl.yaw; // No stickP or similar??????
47
        } else {
47
        } else {
48
                EC_PRTY[CONTROL_PITCH] = EC_PRTY[CONTROL_ROLL] = EC_PRTY[CONTROL_THROTTLE] = EC_PRTY[CONTROL_YAW] = 0;
48
                EC_PRTY[CONTROL_PITCH] = EC_PRTY[CONTROL_ROLL] = EC_PRTY[CONTROL_THROTTLE] = EC_PRTY[CONTROL_YAW] = 0;
Line 56... Line 56...
56
 
56
 
57
        if (externalControlActive)
57
        if (externalControlActive)
58
                // Configured and heard from
58
                // Configured and heard from
Line 59... Line 59...
59
                return SIGNAL_OK;
59
                return SIGNAL_OK;
60
 
60
 
61
        if (!(externalControl.config & 0x01 && dynamicParams.ExternalControl > 128))
61
        if (!(externalControl.config & 0x01 && dynamicParams.externalControl > 128))
Line 62... Line 62...
62
                // External control is not even configured.
62
                // External control is not even configured.
63
                return NO_SIGNAL;
63
                return NO_SIGNAL;