basecmd: Avoid calling malloc() from main code

Introduce a new board function alloc_chunk() to allocate dynamic
memory.  This allows the board code to implement memory allocations
without using the standard malloc() interface.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2017-05-06 22:29:08 -04:00
parent 8f1d0c2a7c
commit f331936969
6 changed files with 66 additions and 45 deletions

View File

@@ -14,7 +14,8 @@ uint8_t timer_is_before(uint32_t time1, uint32_t time2);
uint32_t timer_read_time(void);
void timer_periodic(void);
size_t alloc_maxsize(size_t reqsize);
void *alloc_chunk(size_t size);
void *alloc_chunks(size_t size, size_t count, size_t *avail);
uint16_t crc16_ccitt(char *buf, uint8_t len);