nrf5/drivers: Renaming display module to mp_module prefix as it is going to be inbuilt. ifdef'ing all submodules based on type of display configured through mpconfigport.h

This commit is contained in:
Glenn Ruben Bakke 2017-01-04 17:20:00 +01:00
parent 6b492cd8c4
commit 2b92438d94
1 changed files with 14 additions and 4 deletions

View File

@ -26,21 +26,31 @@
#include "py/obj.h"
#if MICROPY_PY_DISPLAY
#include "epaper/moddisplay_epaper.h"
#include "lcd/moddisplay_lcd.h"
#include "oled/moddisplay_oled.h"
STATIC const mp_map_elem_t display_module_globals_table[] = {
STATIC const mp_map_elem_t mp_module_display_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_display) },
#if MICROPY_PY_DISPLAY_EPAPER
{ MP_OBJ_NEW_QSTR(MP_QSTR_epaper), (mp_obj_t)&display_epaper_module },
#endif
#if MICROPY_PY_DISPLAY_LCD
{ MP_OBJ_NEW_QSTR(MP_QSTR_lcd), (mp_obj_t)&display_lcd_module},
#endif
#if MICROPY_PY_DISPLAY_OLED
{ MP_OBJ_NEW_QSTR(MP_QSTR_oled), (mp_obj_t)&display_oled_module },
#endif
};
STATIC MP_DEFINE_CONST_DICT(display_module_globals, display_module_globals_table);
STATIC MP_DEFINE_CONST_DICT(mp_module_display_globals, mp_module_display_globals_table);
const mp_obj_module_t display_module = {
const mp_obj_module_t mp_module_display = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t*)&display_module_globals,
.globals = (mp_obj_dict_t*)&mp_module_display_globals,
};
#endif // MICROPY_PY_DISPLAY