This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Start structures like in C++

How do I start the values ​​as in the example C++ code?

struct Gains{
    uint8_t totalGain         = FORCE_FEEDBACK_MAXGAIN;
   uint8_t constantGain      = FORCE_FEEDBACK_MAXGAIN;
   uint8_t rampGain          = FORCE_FEEDBACK_MAXGAIN;
   uint8_t squareGain        = FORCE_FEEDBACK_MAXGAIN;
   uint8_t sineGain          = FORCE_FEEDBACK_MAXGAIN;
   uint8_t triangleGain      = FORCE_FEEDBACK_MAXGAIN;
   uint8_t sawtoothdownGain  = FORCE_FEEDBACK_MAXGAIN;
   uint8_t sawtoothupGain    = FORCE_FEEDBACK_MAXGAIN;
   uint8_t springGain        = FORCE_FEEDBACK_MAXGAIN;
   uint8_t damperGain        = FORCE_FEEDBACK_MAXGAIN;
   uint8_t inertiaGain       = FORCE_FEEDBACK_MAXGAIN;
   uint8_t frictionGain      = FORCE_FEEDBACK_MAXGAIN;
   uint8_t customGain        = FORCE_FEEDBACK_MAXGAIN;
};

struct EffectParams{
    int32_t springMaxPosition = 0;
    int32_t springPosition = 0;

    int32_t damperMaxVelocity = 0;
    int32_t damperVelocity = 0;

    int32_t inertiaMaxAcceleration = 0;
    int32_t inertiaAcceleration = 0;

    int32_t frictionMaxPositionChange = 0;
    int32_t frictionPositionChange = 0;
};
   //force feedback gain
   struct Gains* m_gains;

   //force feedback effect params
   struct EffectParams* m_effect_params;

Parents Reply Children