extmod/modmachine: Add MICROPY_PY_MACHINE_SIGNAL configuration option.
Enabled by default. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
c231c89651
commit
23ccbcf230
|
@ -24,12 +24,11 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "py/mpconfig.h"
|
||||
#if MICROPY_PY_MACHINE
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "py/runtime.h"
|
||||
|
||||
#if MICROPY_PY_MACHINE_SIGNAL
|
||||
|
||||
#include "extmod/modmachine.h"
|
||||
#include "extmod/virtpin.h"
|
||||
|
||||
|
@ -181,4 +180,4 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
|||
locals_dict, &signal_locals_dict
|
||||
);
|
||||
|
||||
#endif // MICROPY_PY_MACHINE
|
||||
#endif // MICROPY_PY_MACHINE_SIGNAL
|
||||
|
|
|
@ -186,7 +186,9 @@ static const mp_rom_map_elem_t machine_module_globals_table[] = {
|
|||
#if MICROPY_PY_MACHINE_PIN_BASE
|
||||
{ MP_ROM_QSTR(MP_QSTR_PinBase), MP_ROM_PTR(&machine_pinbase_type) },
|
||||
#endif
|
||||
#if MICROPY_PY_MACHINE_SIGNAL
|
||||
{ MP_ROM_QSTR(MP_QSTR_Signal), MP_ROM_PTR(&machine_signal_type) },
|
||||
#endif
|
||||
|
||||
// Classes for software bus protocols.
|
||||
#if MICROPY_PY_MACHINE_SOFTI2C
|
||||
|
|
|
@ -1702,6 +1702,11 @@ typedef double mp_float_t;
|
|||
#define MICROPY_PY_MACHINE_PULSE (0)
|
||||
#endif
|
||||
|
||||
// Whether to provide the "machine.Signal" class
|
||||
#ifndef MICROPY_PY_MACHINE_SIGNAL
|
||||
#define MICROPY_PY_MACHINE_SIGNAL (MICROPY_PY_MACHINE)
|
||||
#endif
|
||||
|
||||
#ifndef MICROPY_PY_MACHINE_I2C
|
||||
#define MICROPY_PY_MACHINE_I2C (0)
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue