8000 extmod/modonewire: Make _onewire module configurable via macro option. · micropython/micropython@d41f6dd · GitHub
[go: up one dir, main page]

Skip to content

Commit d41f6dd

Browse files
committed
extmod/modonewire: Make _onewire module configurable via macro option.
Signed-off-by: Damien George <damien@micropython.org>
1 parent afe0634 commit d41f6dd

File tree

6 files changed

+13
-0
lines changed

6 files changed

+13
-0
lines changed

extmod/modonewire.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
#include "py/obj.h"
3131
#include "py/mphal.h"
3232

33+
#if MICROPY_PY_ONEWIRE
34+
3335
/******************************************************************************/
3436
// Low-level 1-Wire routines
3537

@@ -160,3 +162,5 @@ const mp_obj_module_t mp_module_onewire = {
160162
.base = { &mp_type_module },
161163
.globals = (mp_obj_dict_t *)&onewire_module_globals,
162164
};
165+
166+
#endif // MICROPY_PY_ONEWIRE

ports/esp32/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@
182182
#define MICROPY_PY_WEBREPL (1)
183183
#define MICROPY_PY_FRAMEBUF (1)
184184
#define MICROPY_PY_BTREE (1)
185+
#define MICROPY_PY_ONEWIRE (1)
185186
#define MICROPY_PY_USOCKET_EVENTS (MICROPY_PY_WEBREPL)
186187
#define MICROPY_PY_BLUETOOTH_RANDOM_ADDR (1)
187188
#define MICROPY_PY_BLUETOOTH_DEFAULT_GAP_NAME ("ESP32")

ports/esp8266/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
#define MICROPY_PY_MACHINE_SPI (1)
8787
#define MICROPY_PY_MACHINE_SOFTSPI (1)
8888
#define MICROPY_PY_UWEBSOCKET (1)
89+
#define MICROPY_PY_ONEWIRE (1)
8990
#define MICROPY_PY_WEBREPL (1)
9091
#define MICROPY_PY_WEBREPL_DELAY (20)
9192
#define MICROPY_PY_WEBREPL_STATIC_FILEBUF (1)

ports/mimxrt/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ uint32_t trng_random_u32(void);
130130
#define MICROPY_PY_MACHINE_SPI (1)
131131
#define MICROPY_PY_MACHINE_SOFTSPI (1)
132132
#define MICROPY_PY_FRAMEBUF (1)
133+
#define MICROPY_PY_ONEWIRE (1)
133134

134135
// Use VfsLfs2's types for fileio/textio
135136
#define mp_type_fileio mp_type_vfs_lfs2_fileio

ports/rp2/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138
#define MICROPY_PY_MACHINE_SPI_LSB (SPI_LSB_FIRST)
139139
#define MICROPY_PY_MACHINE_SOFTSPI (1)
140140
#define MICROPY_PY_FRAMEBUF (1)
141+
#define MICROPY_PY_ONEWIRE (1)
141142
#define MICROPY_VFS (1)
142143
#define MICROPY_VFS_LFS2 (1)
143144
#define MICROPY_VFS_FAT (1)

py/mpconfig.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,6 +1517,11 @@ typedef double mp_float_t;
15171517
#define MICROPY_PY_BTREE (0)
15181518
#endif
15191519

1520+
// Whether to provide the low-level "_onewire" module
1521+
#ifndef MICROPY_PY_ONEWIRE
1522+
#define MICROPY_PY_ONEWIRE (0)
1523+
#endif
1524+
15201525
/*****************************************************************************/
15211526
/* Hooks for a port to add builtins */
15221527

0 commit comments

Comments
 (0)
0