basecmd: Generalize the "move queue" runtime storage

Detect the maximum size of each "move queue" item during the
configuration phase instead of using the stepper move struct.  This
allows the stepper code to be contained entirely in stepper.c and it
allows for future run time allocations from other types of objects.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-03-08 11:29:27 -05:00
parent affdbbf9ca
commit 37bac916e7
3 changed files with 86 additions and 42 deletions

View file

@ -3,16 +3,9 @@
#include <stdint.h> // uint8_t
struct move {
uint32_t interval;
int16_t add;
uint16_t count;
struct move *next;
uint8_t flags;
};
void move_free(struct move *m);
struct move *move_alloc(void);
void move_free(void *m);
void *move_alloc(void);
void move_request_size(int size);
void *lookup_oid(uint8_t oid, void *type);
void *alloc_oid(uint8_t oid, void *type, uint16_t size);
void *next_oid(uint8_t *i, void *type);