From 7aa689823eee9a9c19050e313ce4665b9e192f1b Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 2 Jul 2020 09:27:14 -0400 Subject: [PATCH] Added type hints to analogio --- shared-bindings/analogio/AnalogIn.c | 10 +++++----- shared-bindings/analogio/AnalogOut.c | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/shared-bindings/analogio/AnalogIn.c b/shared-bindings/analogio/AnalogIn.c index 400784b390..84a4bf5f43 100644 --- a/shared-bindings/analogio/AnalogIn.c +++ b/shared-bindings/analogio/AnalogIn.c @@ -70,7 +70,7 @@ STATIC mp_obj_t analogio_analogin_make_new(const mp_obj_type_t *type, return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self, ) -> None: //| """Turn off the AnalogIn and release the pin for other use.""" //| ... //| @@ -86,13 +86,13 @@ STATIC void check_for_deinit(analogio_analogin_obj_t *self) { raise_deinited_error(); } } -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> None: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -104,7 +104,7 @@ STATIC mp_obj_t analogio_analogin___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogin___exit___obj, 4, 4, analogio_analogin___exit__); -//| value: Any = ... +//| value: int = ... //| """The value on the analog pin between 0 and 65535 inclusive (16-bit). (read-only) //| //| Even if the underlying analog to digital converter (ADC) is lower @@ -124,7 +124,7 @@ const mp_obj_property_t analogio_analogin_value_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| reference_voltage: Any = ... +//| reference_voltage: Optional[float] = ... //| """The maximum voltage measurable (also known as the reference voltage) as a //| `float` in Volts.""" //| diff --git a/shared-bindings/analogio/AnalogOut.c b/shared-bindings/analogio/AnalogOut.c index a8edcc0ae1..f020096472 100644 --- a/shared-bindings/analogio/AnalogOut.c +++ b/shared-bindings/analogio/AnalogOut.c @@ -66,7 +66,7 @@ STATIC mp_obj_t analogio_analogout_make_new(const mp_obj_type_t *type, mp_uint_t return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self, ) -> None: //| """Turn off the AnalogOut and release the pin for other use.""" //| ... //| @@ -79,13 +79,13 @@ STATIC mp_obj_t analogio_analogout_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(analogio_analogout_deinit_obj, analogio_analogout_deinit); -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> None: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -97,7 +97,7 @@ STATIC mp_obj_t analogio_analogout___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogout___exit___obj, 4, 4, analogio_analogout___exit__); -//| value: Any = ... +//| value: None = ... //| """The value on the analog pin between 0 and 65535 inclusive (16-bit). (write-only) //| //| Even if the underlying digital to analog converter (DAC) is lower