History

Updated leaf for sampling on h7.

mulshine committed 7 years ago

Commit d0fbdd51 parent 8e6e5973 files · +14 −3Browse files

Unified · Split

3 files
  1. LEAF/Inc/leaf-mempool.h +3 −1
  2. LEAF/Inc/leaf-sample.h +1 −1
  3. LEAF/Src/leaf-mempool.c +10 −1
LEAF/Inc/leaf-mempool.h+3−1
@@ -50,7 +50,7 @@ extern "C" { · 49 unmodified lines
50 50
51//==============================================================================51//==============================================================================
52 52
53#define MPOOL_POOL_SIZE 100000053#define MPOOL_POOL_SIZE 500000
54#define MPOOL_ALIGN_SIZE (8)54#define MPOOL_ALIGN_SIZE (8)
55 55
56//#define size_t unsigned long56//#define size_t unsigned long
@@ -91,6 +91,8 @@ size_t leaf_pool_get_size(void); · 34 unmodified lines
91size_t leaf_pool_get_used(void);91size_t leaf_pool_get_used(void);
92 92
93void* leaf_pool_get_pool(void);93void* leaf_pool_get_pool(void);
94
95void leaf_mempool_overrun(void);
94 96
95//==============================================================================97//==============================================================================
96 98
LEAF/Inc/leaf-sample.h+1−1
@@ -64,7 +64,7 @@ extern "C" { · 63 unmodified lines
64 Normal,64 Normal,
65 Loop,65 Loop,
66 BackAndForth,66 BackAndForth,
67 ModeNil67 SampleModeNil
68 } Mode;68 } Mode;
69 69
70 typedef struct _tSamplePlayer70 typedef struct _tSamplePlayer
LEAF/Src/leaf-mempool.c+10−1
@@ -121,7 +121,11 @@ void* mpool_alloc(size_t size, mpool_t* pool) · 120 unmodified lines
121 121
122void* leaf_alloc(size_t size)122void* leaf_alloc(size_t size)
123{123{
124 return mpool_alloc(size, &leaf_pool);124 void* block = mpool_alloc(size, &leaf_pool);
125
126 if (block == NULL) leaf_mempool_overrun();
127
128 return block;
125}129}
126 130
127void mpool_free(void* ptr, mpool_t* pool)131void mpool_free(void* ptr, mpool_t* pool)
@@ -191,3 +195,8 @@ static inline size_t mpool_align(size_t size) { · 63 unmodified lines
191 return (size + (MPOOL_ALIGN_SIZE - 1)) & ~(MPOOL_ALIGN_SIZE - 1);195 return (size + (MPOOL_ALIGN_SIZE - 1)) & ~(MPOOL_ALIGN_SIZE - 1);
192}196}
193 197
198void leaf_mempool_overrun(void)
199{
200
201}
202

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t