Skip to content

Commit 092cefc

Browse files
committed
add stack_thunk_yield()
1 parent e7f29a9 commit 092cefc

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Diff for: cores/esp8266/StackThunk.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,20 @@
2727
#include <stdint.h>
2828
#include <stdlib.h>
2929
#include <stdio.h>
30-
#include "pgmspace.h"
30+
3131
#include "debug.h"
3232
#include "StackThunk.h"
33+
34+
#include <pgmspace.h>
3335
#include <ets_sys.h>
36+
3437
#include <umm_malloc/umm_malloc.h>
3538
#include <umm_malloc/umm_heap_select.h>
3639

3740
extern "C" {
3841

42+
extern void optimistic_yield(uint32_t);
43+
3944
uint32_t *stack_thunk_ptr = NULL;
4045
uint32_t *stack_thunk_top = NULL;
4146
uint32_t *stack_thunk_save = NULL; /* Saved A1 while in BearSSL */
@@ -150,4 +155,9 @@ void stack_thunk_fatal_smashing()
150155
__stack_chk_fail();
151156
}
152157

158+
void stack_thunk_yield()
159+
{
160+
optimistic_yield(10000);
161+
}
162+
153163
}

Diff for: cores/esp8266/StackThunk.h

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
extern "C" {
3232
#endif
3333

34+
extern void stack_thunk_yield(void);
35+
3436
extern void stack_thunk_add_ref();
3537
extern void stack_thunk_del_ref();
3638
extern void stack_thunk_repaint();

0 commit comments

Comments
 (0)