esp32-wasm-base icon indicating copy to clipboard operation
esp32-wasm-base copied to clipboard

Promote task context to Esp object

Open ryankurte opened this issue 5 years ago • 1 comments

An extremely hacky mechanism for passing task context was implemented to support the runtime configuration of WASM tasks.

https://github.com/ryankurte/rust-esp32-wasm/blob/ed4de9e1032454fac802f9735913c63bd4cfbcdf/base/main/wasm.c#L75

https://github.com/ryankurte/rust-esp32-wasm/blob/ed4de9e1032454fac802f9735913c63bd4cfbcdf/base/main/wasm.c#L338

Now this is working it should be promoted to the top level Esp object so we can also use it to cleanly exit (by polling on the task->running variable) and other such things...

Tasks:

  • [ ] Move argc and argv to Esp::take function

ryankurte avatar Feb 07 '20 09:02 ryankurte

Actually, it would probably be better to leverage Thread Local Storage (TLS) to store a reference to the WasmTask_t object so all of the awful wasm hacks can be removed...

ryankurte avatar Feb 07 '20 10:02 ryankurte