From 53ad681ed1786601ca5eccb60f8fd950b8bc47d7 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 8 Apr 2016 11:08:37 +0100 Subject: extmod: Add initial framebuf module. --- py/builtin.h | 1 + py/mpconfig.h | 4 ++++ py/objmodule.c | 3 +++ py/py.mk | 1 + py/qstrdefs.h | 9 +++++++++ 5 files changed, 18 insertions(+) (limited to 'py') diff --git a/py/builtin.h b/py/builtin.h index e3e68e151..35d8910bd 100644 --- a/py/builtin.h +++ b/py/builtin.h @@ -106,6 +106,7 @@ extern const mp_obj_module_t mp_module_ussl; extern const mp_obj_module_t mp_module_machine; extern const mp_obj_module_t mp_module_lwip; extern const mp_obj_module_t mp_module_websocket; +extern const mp_obj_module_t mp_module_framebuf; // extmod functions MP_DECLARE_CONST_FUN_OBJ(pyb_mount_obj); diff --git a/py/mpconfig.h b/py/mpconfig.h index 6c2db2f1f..bbf055513 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -845,6 +845,10 @@ typedef double mp_float_t; #define MICROPY_PY_WEBSOCKET (0) #endif +#ifndef MICROPY_PY_FRAMEBUF +#define MICROPY_PY_FRAMEBUF (0) +#endif + /*****************************************************************************/ /* Hooks for a port to add builtins */ diff --git a/py/objmodule.c b/py/objmodule.c index 5fd7b82c5..d2a4d893c 100644 --- a/py/objmodule.c +++ b/py/objmodule.c @@ -196,6 +196,9 @@ STATIC const mp_rom_map_elem_t mp_builtin_module_table[] = { #if MICROPY_PY_WEBSOCKET { MP_ROM_QSTR(MP_QSTR_websocket), MP_ROM_PTR(&mp_module_websocket) }, #endif +#if MICROPY_PY_FRAMEBUF + { MP_ROM_QSTR(MP_QSTR_framebuf), MP_ROM_PTR(&mp_module_framebuf) }, +#endif // extra builtin modules as defined by a port MICROPY_PORT_BUILTIN_MODULES diff --git a/py/py.mk b/py/py.mk index 899f333c6..3cfc6712a 100644 --- a/py/py.mk +++ b/py/py.mk @@ -170,6 +170,7 @@ PY_O_BASENAME = \ ../extmod/modussl.o \ ../extmod/modurandom.o \ ../extmod/modwebsocket.o \ + ../extmod/modframebuf.o \ ../extmod/fsusermount.o \ ../extmod/vfs_fat.o \ ../extmod/vfs_fat_ffconf.o \ diff --git a/py/qstrdefs.h b/py/qstrdefs.h index f5e06f1a5..d8c7ccc42 100644 --- a/py/qstrdefs.h +++ b/py/qstrdefs.h @@ -761,3 +761,12 @@ Q(flush) #if MICROPY_PY_WEBSOCKET Q(websocket) #endif + +#if MICROPY_PY_FRAMEBUF +Q(framebuf) +Q(FrameBuffer1) +Q(fill) +Q(pixel) +Q(scroll) +Q(text) +#endif -- cgit v1.2.3