From: Johann D. <jo...@Do...> - 2002-01-30 23:06:51
|
Hi, I am changing the ff_effect struct. I went for the 1-parameter-1-effect scheme (actually it's really (1,2)-parameter(s)-1-effect). New effect types: * FF_DAMPER This effect really is the former FF_FRICTION. * FF_INERTIA * FF_RAMP Note that this effect is not periodic. Reasons: 1. PID does not define it as a periodic effect 2. A periodic ramp is just a sawtooth up or down I wonder if we still need the FF_CONSTANT, as it's just a special case of FF_RAMP. * FF_CUSTOM It's not new actually. I just did not remember it was there. New or changed structures: * Ramp effects struct ff_ramp_effect { _s16 start_level; _s16 end_level; struct ff_shape shape; } * Friction No new structure. We can use the ff_interactive, according to PID. What is its meaning is still not clear. I would guess the following: force = f(position, direction) force.direction = -direction force.magnitude = p(position), p being the function described at page 12. The ff_interactive_effect structure has changed: struct ff_interactive_effect { __u16 right_saturation[2]; /* Max level when joystick is on the right */ __u16 left_saturation[2]; /* Max level when joystick in on the left */ __s16 right_coeff[2]; /* Indicates how fast the force grows when the joystick moves to the right */ __s16 left_coeff[2]; /* Same for left side */ __u16 deadband[2]; /* Size of area where no force is produced */ __s16 center[2]; /* Position of dead zone */ }; Note the arrays. There is one value for each axis. The axis mumber has become useless and has therefore been droped. * ff_periodic_effect: struct ff_periodic_effect { __u16 waveform; /* Kind of wave (sine, square...) */ __u16 period; /* in ms */ __s16 magnitude; /* Peak value */ __s16 offset; /* Mean value of wave (roughly) */ __u16 phase; /* 'Horizontal' shift */ struct ff_shape shape; /* Only used if waveform == FF_CUSTOM */ __u32 custom_len; /* Number of samples */ __s16 *custom_data; /* Buffer of samples */ /* Note: the data pointed by custom_data is copied by the driver. You can * therefore dispose of the memory after the upload/update */ }; The _u32 for the number of samples is a bit oversized, maybe. I think that's all for now. Comments and critics welcome. -- Johann Deneux |