mp_flipper_app.c 451 B

12345678910111213141516171819
  1. #include <furi.h>
  2. #include <port/micropython_embed.h>
  3. int32_t mp_flipper_app(void* p) {
  4. UNUSED(p);
  5. const size_t memory_size = memmgr_get_free_heap() * 0.5;
  6. const size_t stack_size = 2 * 1024;
  7. uint8_t* memory = malloc(memory_size * sizeof(uint8_t));
  8. mp_embed_init(memory + stack_size, memory_size - stack_size, memory);
  9. mp_embed_exec_str("print('hello world!');");
  10. mp_embed_deinit();
  11. free(memory);
  12. return 0;
  13. }