extmod/modmachine: Add MICROPY_PY_MACHINE_SIGNAL configuration option.

Enabled by default.

Signed-off-by: Damien George <damien@micropython.org>
pull/14089/head
Damien George 2024-03-14 10:58:41 +11:00
rodzic c231c89651
commit 23ccbcf230
3 zmienionych plików z 11 dodań i 5 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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

Wyświetl plik

@ -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