diff options
| author | dherrada <dylan.herrada@adafruit.com> | 2020-07-03 10:51:39 -0400 |
|---|---|---|
| committer | dherrada <dylan.herrada@adafruit.com> | 2020-07-03 10:51:39 -0400 |
| commit | a2c7e2795b4d9ba5d8592d1fe3e6d8c7422c65af (patch) | |
| tree | 594bf7657309c0710d62d42a0775619f5615790f | |
| parent | 41f12a7a6c8424257adcd49a549d4258cd9814e4 (diff) | |
Added type hints to ps2io
| -rw-r--r-- | shared-bindings/ps2io/Ps2.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/shared-bindings/ps2io/Ps2.c b/shared-bindings/ps2io/Ps2.c index fd82591d5..b4a741030 100644 --- a/shared-bindings/ps2io/Ps2.c +++ b/shared-bindings/ps2io/Ps2.c @@ -87,7 +87,7 @@ STATIC mp_obj_t ps2io_ps2_make_new(const mp_obj_type_t *type, size_t n_args, con return MP_OBJ_FROM_PTR(self); } -//| def deinit(self) -> Any: +//| def deinit(self) -> None: //| """Deinitialises the Ps2 and releases any hardware resources for reuse.""" //| ... //| @@ -104,13 +104,13 @@ STATIC void check_for_deinit(ps2io_ps2_obj_t *self) { } } -//| def __enter__(self) -> Any: +//| def __enter__(self) -> Ps2: //| """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.""" //| ... @@ -122,7 +122,7 @@ STATIC mp_obj_t ps2io_ps2_obj___exit__(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ps2io_ps2___exit___obj, 4, 4, ps2io_ps2_obj___exit__); -//| def popleft(self) -> Any: +//| def popleft(self) -> byte: //| """Removes and returns the oldest received byte. When buffer //| is empty, raises an IndexError exception.""" //| ... @@ -139,7 +139,7 @@ STATIC mp_obj_t ps2io_ps2_obj_popleft(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(ps2io_ps2_popleft_obj, ps2io_ps2_obj_popleft); -//| def sendcmd(self, byte: int) -> Any: +//| def sendcmd(self, byte: int) -> int: //| """Sends a command byte to PS/2. Returns the response byte, typically //| the general ack value (0xFA). Some commands return additional data //| which is available through :py:func:`popleft()`. @@ -164,7 +164,7 @@ STATIC mp_obj_t ps2io_ps2_obj_sendcmd(mp_obj_t self_in, mp_obj_t ob) { } MP_DEFINE_CONST_FUN_OBJ_2(ps2io_ps2_sendcmd_obj, ps2io_ps2_obj_sendcmd); -//| def clear_errors(self) -> Any: +//| def clear_errors(self) -> int: //| """Returns and clears a bitmap with latest recorded communication errors. //| //| Reception errors (arise asynchronously, as data is received): @@ -202,7 +202,7 @@ STATIC mp_obj_t ps2io_ps2_obj_clear_errors(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(ps2io_ps2_clear_errors_obj, ps2io_ps2_obj_clear_errors); -//| def __len__(self) -> Any: +//| def __len__(self) -> Union[bool, int, None]: //| """Returns the number of received bytes in buffer, available //| to :py:func:`popleft()`.""" //| ... |
