You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
299 B

struct control_t
{
float value;
float step;
};
static inline void control_setstep(struct control_t *control, float value, uint32_t samples)
{
control->step = (value - control->value) / samples;
}
static inline void control_tick(struct control_t *control)
{
control->value += control->step;
}