Add fiber_user_data to yotta mappings; fix some errors

This commit is contained in:
Michal Moskal 2019-01-20 18:29:29 +00:00 committed by Joe Finney
parent 415e5ebed2
commit 15ebed2ad5
3 changed files with 11 additions and 2 deletions

View File

@ -149,6 +149,11 @@ extern uint32_t __etext;
#define SYSTEM_TICK_PERIOD_MS 6
#endif
// Enable used_data field in Fiber structure (for thread-local data)
#ifndef MICROBIT_FIBER_USER_DATA
#define MICROBIT_FIBER_USER_DATA 0
#endif
//
// Message Bus:
// Default behaviour for event handlers, if not specified in the listen() call

View File

@ -15,6 +15,10 @@
#define MICROBIT_NESTED_HEAP_SIZE YOTTA_CFG_MICROBIT_DAL_NESTED_HEAP_PROPORTION
#endif
#ifdef YOTTA_CFG_MICROBIT_DAL_FIBER_USER_DATA
#define MICROBIT_FIBER_USER_DATA YOTTA_CFG_MICROBIT_DAL_FIBER_USER_DATA
#endif
#ifdef YOTTA_CFG_MICROBIT_DAL_REUSE_SD
#define MICROBIT_HEAP_REUSE_SD YOTTA_CFG_MICROBIT_DAL_REUSE_SD
#endif

View File

@ -553,7 +553,7 @@ int invoke(void (*entry_fn)(void))
currentFiber->flags |= MICROBIT_FIBER_FLAG_FOB;
entry_fn();
#if CONFIG_ENABLED(MICROBIT_FIBER_USER_DATA)
f->user_data = 0;
currentFiber->user_data = 0;
#endif
currentFiber->flags &= ~MICROBIT_FIBER_FLAG_FOB;
@ -619,7 +619,7 @@ int invoke(void (*entry_fn)(void *), void *param)
currentFiber->flags |= MICROBIT_FIBER_FLAG_FOB;
entry_fn(param);
#if CONFIG_ENABLED(MICROBIT_FIBER_USER_DATA)
f->user_data = 0;
currentFiber->user_data = 0;
#endif
currentFiber->flags &= ~MICROBIT_FIBER_FLAG_FOB;