From 64d28272333b9951097237c0b9b66cb736f1dd79 Mon Sep 17 00:00:00 2001 From: Glenn Ruben Bakke Date: Thu, 29 Dec 2016 17:03:15 +0100 Subject: [PATCH] nrf5/lcd: Adding lcd_mono_fb.c to source list in the makefile. Adding define in implementation to de-select the file from being included. Adding module to PORT BUILTIN in mpconfigport.h --- nrf5/Makefile | 1 + nrf5/lcd_mono_fb.c | 4 ++++ nrf5/mpconfigport.h | 11 ++++++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/nrf5/Makefile b/nrf5/Makefile index 42b402f258..c5dc610d9b 100644 --- a/nrf5/Makefile +++ b/nrf5/Makefile @@ -146,6 +146,7 @@ SRC_C += \ modnetwork.c \ timer.c \ rtc.c \ + lcd_mono_fb.c \ #ifeq ($(SD), ) diff --git a/nrf5/lcd_mono_fb.c b/nrf5/lcd_mono_fb.c index b369eb9e2f..31b9aeb0d1 100644 --- a/nrf5/lcd_mono_fb.c +++ b/nrf5/lcd_mono_fb.c @@ -34,6 +34,8 @@ #include "lcd_mono_fb.h" #include "font_petme128_8x8.h" +#if MICROPY_PY_LCD_MONO_FB + #define LCD_BLACK 0 #define LCD_WHITE 1 @@ -312,3 +314,5 @@ const mp_obj_module_t mp_module_lcd_mono_fb = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t*)&lcd_mono_fb_module_globals, }; + +#endif // MICROPY_PY_LCD_MONO_FB diff --git a/nrf5/mpconfigport.h b/nrf5/mpconfigport.h index 88c220f3be..0af3531a43 100644 --- a/nrf5/mpconfigport.h +++ b/nrf5/mpconfigport.h @@ -129,6 +129,8 @@ #define MICROPY_PY_NETWORK (1) #endif +#define MICROPY_PY_LCD_MONO_FB (0) + #define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1) #define MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE (0) @@ -160,6 +162,7 @@ extern const struct _mp_obj_module_t mp_module_utime; extern const struct _mp_obj_module_t mp_module_uos; extern const struct _mp_obj_module_t mp_module_usocket; extern const struct _mp_obj_module_t mp_module_network; +extern const struct _mp_obj_module_t mp_module_lcd_mono_fb; #if MICROPY_PY_USOCKET #define SOCKET_BUILTIN_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_usocket), (mp_obj_t)&mp_module_usocket }, @@ -175,6 +178,11 @@ extern const struct _mp_obj_module_t mp_module_network; #define NETWORK_BUILTIN_MODULE #endif +#if MICROPY_PY_LCD_MONO_FB +#define LCD_MONO_FB_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_lcd_mono_fb), (mp_obj_t)&mp_module_lcd_mono_fb }, +#else +#define LCD_MONO_FB_MODULE +#endif #if BLUETOOTH_SD extern const struct _mp_obj_module_t ble_module; @@ -187,6 +195,7 @@ extern const struct _mp_obj_module_t ble_module; { MP_OBJ_NEW_QSTR(MP_QSTR_uos), (mp_obj_t)&mp_module_uos }, \ SOCKET_BUILTIN_MODULE \ NETWORK_BUILTIN_MODULE \ + LCD_MONO_FB_MODULE \ #else @@ -196,7 +205,7 @@ extern const struct _mp_obj_module_t ble_module; { MP_OBJ_NEW_QSTR(MP_QSTR_machine), (mp_obj_t)&machine_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_utime), (mp_obj_t)&mp_module_utime }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_uos), (mp_obj_t)&mp_module_uos }, \ - + LCD_MONO_FB_MODULE \ #endif // BLUETOOTH_SD