Go to the source code of this file.
|
struct | i_code_region_t |
|
struct | code_region_t |
|
How To Define and Use your own CODE_REGION ! Example:
static void __code_region_example_on_enter(void *obj_ptr, void *local_ptr) { printf("-------enter-------\r\n"); }
static void __code_region_example_on_leave(void *obj_ptr,void *local_ptr) { printf("-------leave-------\r\n"); }
const static i_code_region_t __example_code_region = { .OnEnter = __code_region_example_on_enter, .OnLeave = __code_region_example_on_leave, };
void main(void)
{
...
code_region(&__example_code_region, NULL){
printf("\tbody\r\n");
}
...
}
Output:
----—enter----— body ----—leave----—
! - Note
- How to use code_region() ! Syntax: ! code_region(<Address of i_code_region_t obj>, <Object Address>) { ! //! put your code here ! } ! !
-
<Address of i_code_region_t obj>: this can be NULL, if so, ! DEFAULT_CODE_REGION_NONE will be used. ! !
-
<Object Address>: it is the address of the object you want to pass to ! your OnEnter and OnLeave functions. It can be NULL ! !
-
A local object will be generated from users' stack, the size is specified ! by i_code_region_t.chLocalSize. The address of this local object will ! be passed to your OnEnter and OnLeave functions. You can use it to ! store some local status. ! ! ! ! DEFAULT_CODE_REGION_ATOM_CODE //!< interrupt-safe region ! DEFAULT_CODE_REGION_NONE //!< do nothing !
|
#define | COMPILER_PATCH_CODE_REGION_LOCAL_SIZE 4 |
|
#define | __CODE_REGION_SIMPLE(__REGION_ADDR, __CODE) |
|
#define | __CODE_REGION_SIMPLE_START(__REGION_ADDR) |
|
#define | __CODE_REGION_SIMPLE_END(__REGION_ADDR) |
|
#define | EXIT_CODE_REGION() code_region_ptr->ptMethods->OnLeave(code_region_ptr->target_ptr, local) |
|
#define | exit_code_region() EXIT_CODE_REGION() |
|
#define | CODE_REGION(__REGION_ADDR) __CODE_REGION((__REGION_ADDR)) |
|
#define | code_region(__region_addr) __CODE_REGION((__region_addr)) |
|
#define | CODE_REGION_START(__REGION_ADDR) __CODE_REGION_START((__REGION_ADDR)) |
|
#define | CODE_REGION_END() __CODE_REGION_END() |
|
#define | CODE_REGION_SIMPLE(__REGION_ADDR, __CODE) __CODE_REGION_SIMPLE((__REGION_ADDR), __CODE) |
|
#define | code_region_simple(__REGION_ADDR, __CODE) __CODE_REGION_SIMPLE((__REGION_ADDR), __CODE) |
|
#define | CODE_REGION_SIMPLE_START(__REGION_ADDR) __CODE_REGION_SIMPLE_START((__REGION_ADDR)) |
|
#define | CODE_REGION_SIMPLE_END() __CODE_REGION_SIMPLE_END() |
|
const code_region_t | DEFAULT_CODE_REGION_NONE |
|
◆ COMPILER_PATCH_CODE_REGION_LOCAL_SIZE
#define COMPILER_PATCH_CODE_REGION_LOCAL_SIZE 4 |
◆ __CODE_REGION_SIMPLE
#define __CODE_REGION_SIMPLE |
( |
|
__REGION_ADDR, |
|
|
|
__CODE |
|
) |
| |
Value: do {
if (
NULL != (__REGION_ADDR)) { \
__CODE; \
} }while(0);
#define COMPILER_PATCH_CODE_REGION_LOCAL_SIZE
Definition code_region.h:107
#define NULL
Definition lvgl.h:26
unsigned char uint8_t
Definition lvgl.h:40
Definition code_region.h:268
void * target_ptr
Definition code_region.h:269
i_code_region_t * methods_ptr
Definition code_region.h:270
void(* OnLeave)(void *obj_ptr, void *local_ptr)
Definition code_region.h:265
void(* OnEnter)(void *obj_ptr, void *local_ptr)
Definition code_region.h:264
◆ __CODE_REGION_SIMPLE_START
#define __CODE_REGION_SIMPLE_START |
( |
|
__REGION_ADDR | ) |
|
Value: do {
if (
NULL != (__REGION_ADDR)) { \
◆ __CODE_REGION_SIMPLE_END
#define __CODE_REGION_SIMPLE_END |
( |
|
__REGION_ADDR | ) |
|
Value: code_region_ptr->methods_ptr->OnLeave( \
code_region_ptr->target_ptr, local); \
} } while(0);
◆ EXIT_CODE_REGION
#define EXIT_CODE_REGION |
( |
| ) |
code_region_ptr->ptMethods->OnLeave(code_region_ptr->target_ptr, local) |
◆ exit_code_region
◆ CODE_REGION
#define CODE_REGION |
( |
|
__REGION_ADDR | ) |
__CODE_REGION((__REGION_ADDR)) |
◆ code_region
#define code_region |
( |
|
__region_addr | ) |
__CODE_REGION((__region_addr)) |
◆ CODE_REGION_START
#define CODE_REGION_START |
( |
|
__REGION_ADDR | ) |
__CODE_REGION_START((__REGION_ADDR)) |
◆ CODE_REGION_END
#define CODE_REGION_END |
( |
| ) |
__CODE_REGION_END() |
◆ CODE_REGION_SIMPLE
◆ code_region_simple
◆ CODE_REGION_SIMPLE_START
◆ CODE_REGION_SIMPLE_END
◆ DEFAULT_CODE_REGION_NONE