kopia lustrzana https://github.com/micropython/micropython
extmod/modmachine: Add MICROPY_PY_MACHINE_SIGNAL configuration option.
Enabled by default. Signed-off-by: Damien George <damien@micropython.org>pull/14089/head
rodzic
c231c89651
commit
23ccbcf230
|
@ -24,12 +24,11 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "py/mpconfig.h"
|
|
||||||
#if MICROPY_PY_MACHINE
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
|
|
||||||
|
#if MICROPY_PY_MACHINE_SIGNAL
|
||||||
|
|
||||||
#include "extmod/modmachine.h"
|
#include "extmod/modmachine.h"
|
||||||
#include "extmod/virtpin.h"
|
#include "extmod/virtpin.h"
|
||||||
|
|
||||||
|
@ -181,4 +180,4 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||||
locals_dict, &signal_locals_dict
|
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
|
#if MICROPY_PY_MACHINE_PIN_BASE
|
||||||
{ MP_ROM_QSTR(MP_QSTR_PinBase), MP_ROM_PTR(&machine_pinbase_type) },
|
{ MP_ROM_QSTR(MP_QSTR_PinBase), MP_ROM_PTR(&machine_pinbase_type) },
|
||||||
#endif
|
#endif
|
||||||
|
#if MICROPY_PY_MACHINE_SIGNAL
|
||||||
{ MP_ROM_QSTR(MP_QSTR_Signal), MP_ROM_PTR(&machine_signal_type) },
|
{ MP_ROM_QSTR(MP_QSTR_Signal), MP_ROM_PTR(&machine_signal_type) },
|
||||||
|
#endif
|
||||||
|
|
||||||
// Classes for software bus protocols.
|
// Classes for software bus protocols.
|
||||||
#if MICROPY_PY_MACHINE_SOFTI2C
|
#if MICROPY_PY_MACHINE_SOFTI2C
|
||||||
|
|
|
@ -1702,6 +1702,11 @@ typedef double mp_float_t;
|
||||||
#define MICROPY_PY_MACHINE_PULSE (0)
|
#define MICROPY_PY_MACHINE_PULSE (0)
|
||||||
#endif
|
#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
|
#ifndef MICROPY_PY_MACHINE_I2C
|
||||||
#define MICROPY_PY_MACHINE_I2C (0)
|
#define MICROPY_PY_MACHINE_I2C (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
Ładowanie…
Reference in New Issue