Implement native function pointer check, addr conversion and register, update documents (#185)

Modified WASM runtime API:
- wasm_runtime_module_malloc()
- wasm_runtime_lookup_function()
Introduced runtime API
- wasm_runtime_register_natives()
This commit is contained in:
wenyongh
2020-03-04 20:12:38 +08:00
committed by GitHub
parent 2e36149e32
commit 0d3f304191
96 changed files with 2293 additions and 2317 deletions

View File

@ -10,13 +10,26 @@
#include "lvgl/lv_misc/lv_color.h"
#include "lvgl/lv_hal/lv_hal_indev.h"
extern void display_init(void);
extern void display_flush(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
const lv_color_t * color_p);
extern bool display_input_read(lv_indev_data_t * data);
extern void display_deinit(void);
extern void display_vdb_write(void *buf, lv_coord_t buf_w, lv_coord_t x,
lv_coord_t y, lv_color_t *color, lv_opa_t opa);
extern void display_flush(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
const lv_color_t * color);
extern bool display_input_read(lv_indev_data_t *data);
extern void display_vdb_write(void *buf,
lv_coord_t buf_w, lv_coord_t x, lv_coord_t y,
lv_color_t *color, lv_opa_t opa);
void display_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
const lv_color_t *color);
void display_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
const lv_color_t *color);
extern uint32_t time_get_ms(void);
#endif

View File

@ -119,27 +119,32 @@ void on_init()
* Initialize the Hardware Abstraction Layer (HAL) for the Littlev graphics library
*/
void display_flush_wrapper(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
const lv_color_t * color_p)
const lv_color_t * color_p)
{
display_flush(x1, y1, x2, y2, color_p);
lv_flush_ready();
}
void display_vdb_write_wrapper(uint8_t *buf, lv_coord_t buf_w, lv_coord_t x,
lv_coord_t y, lv_color_t color, lv_opa_t opa)
void display_vdb_write_wrapper(uint8_t *buf,
lv_coord_t buf_w, lv_coord_t x, lv_coord_t y,
lv_color_t color, lv_opa_t opa)
{
display_vdb_write(buf, buf_w, x, y, &color, opa);
}
extern void display_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
lv_color_t color_p);
extern void display_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
const lv_color_t * color_p);
void display_fill_wrapper(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
lv_color_t color)
{
display_fill(x1, y1, x2, y2, &color);
}
static void hal_init(void)
{
/* Add a display*/
lv_disp_drv_t disp_drv;
lv_disp_drv_init(&disp_drv); /*Basic initialization*/
disp_drv.disp_flush = display_flush_wrapper; /*Used when `LV_VDB_SIZE != 0` in lv_conf.h (buffered drawing)*/
disp_drv.disp_fill = display_fill; /*Used when `LV_VDB_SIZE == 0` in lv_conf.h (unbuffered drawing)*/
disp_drv.disp_fill = display_fill_wrapper; /*Used when `LV_VDB_SIZE == 0` in lv_conf.h (unbuffered drawing)*/
disp_drv.disp_map = display_map; /*Used when `LV_VDB_SIZE == 0` in lv_conf.h (unbuffered drawing)*/
#if LV_VDB_SIZE != 0
disp_drv.vdb_wr = display_vdb_write_wrapper;