ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts
1.0
ESP8266ILI9341DisplayProject
Main Page
Related Pages
Data Structures
Files
File List
Globals
yield
cont_util.c
Go to the documentation of this file.
1
/*
2
cont_util.s - continuations support for Xtensa call0 ABI
3
Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
4
This file is part of the esp8266 core for Arduino environment.
5
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Lesser General Public
8
License as published by the Free Software Foundation; either
9
version 2.1 of the License, or (at your option) any later version.
10
11
This library is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
Lesser General Public License for more details.
15
16
You should have received a copy of the GNU Lesser General Public
17
License along with this library; if not, write to the Free Software
18
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20
21
#include "
cont.h
"
22
#include <stddef.h>
23
#include "
ets_sys.h
"
24
25
#define CONT_STACKGUARD 0xfeefeffe
26
27
void
cont_init
(
cont_t
* cont)
28
{
29
cont->
stack_guard1
=
CONT_STACKGUARD
;
30
cont->
stack_guard2
=
CONT_STACKGUARD
;
31
cont->
stack_end
= cont->
stack
+ (
sizeof
(cont->
stack
) / 4);
32
cont->
struct_start
= (
unsigned
*) cont;
33
}
34
35
36
int
cont_check
(
cont_t
* cont)
37
{
38
if
(cont->
stack_guard1
!=
CONT_STACKGUARD
|| cont->
stack_guard2
!=
CONT_STACKGUARD
)
return
1;
39
40
return
0;
41
}
42
43
44
bool
cont_can_yield
(
cont_t
* cont)
45
{
46
return
!
ETS_INTR_WITHINISR
() &&
47
cont->
pc_ret
!= 0 && cont->
pc_yield
== 0;
48
}
cont_::pc_ret
void(* pc_ret)(void)
Definition:
cont.h:32
ETS_INTR_WITHINISR
bool ETS_INTR_WITHINISR()
Definition:
ets_sys.h:65
cont_::stack
unsigned stack[CONT_STACKSIZE/4]
Definition:
cont.h:43
cont_::stack_guard2
unsigned stack_guard2
Definition:
cont.h:45
cont_check
int cont_check(cont_t *cont)
Definition:
cont_util.c:36
cont_init
void cont_init(cont_t *cont)
Definition:
cont_util.c:27
cont.h
ets_sys.h
cont_::pc_yield
void(* pc_yield)(void)
Definition:
cont.h:35
CONT_STACKGUARD
#define CONT_STACKGUARD
Definition:
cont_util.c:25
cont_can_yield
bool cont_can_yield(cont_t *cont)
Definition:
cont_util.c:44
cont_
Definition:
cont.h:30
cont_::stack_guard1
unsigned stack_guard1
Definition:
cont.h:41
cont_::stack_end
unsigned * stack_end
Definition:
cont.h:38
cont_::struct_start
unsigned * struct_start
Definition:
cont.h:46
Generated on Wed Jan 31 2018 21:22:16 for ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts by
1.8.11