From d250b9044a6e5168dfe2dc8875d355408cbf6601 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Wed, 20 Jan 2010 10:44:24 +0000 Subject: [PATCH] Missed a file --- control.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 control.h diff --git a/control.h b/control.h new file mode 100644 index 0000000..846c033 --- /dev/null +++ b/control.h @@ -0,0 +1,16 @@ + +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; +}