Skip to content

Commit

Permalink
add stack_thunk_yield()
Browse files Browse the repository at this point in the history
  • Loading branch information
mcspr committed Sep 2, 2024
1 parent e7f29a9 commit 092cefc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cores/esp8266/StackThunk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,20 @@
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include "pgmspace.h"

#include "debug.h"
#include "StackThunk.h"

#include <pgmspace.h>
#include <ets_sys.h>

#include <umm_malloc/umm_malloc.h>
#include <umm_malloc/umm_heap_select.h>

extern "C" {

extern void optimistic_yield(uint32_t);

uint32_t *stack_thunk_ptr = NULL;
uint32_t *stack_thunk_top = NULL;
uint32_t *stack_thunk_save = NULL; /* Saved A1 while in BearSSL */
Expand Down Expand Up @@ -150,4 +155,9 @@ void stack_thunk_fatal_smashing()
__stack_chk_fail();
}

void stack_thunk_yield()
{
optimistic_yield(10000);
}

}
2 changes: 2 additions & 0 deletions cores/esp8266/StackThunk.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
extern "C" {
#endif

extern void stack_thunk_yield(void);

extern void stack_thunk_add_ref();
extern void stack_thunk_del_ref();
extern void stack_thunk_repaint();
Expand Down

0 comments on commit 092cefc

Please sign in to comment.