Skip to content

Commit 8c74b4a

Browse files
committed
fix some typos
1 parent 51c547a commit 8c74b4a

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

py/argcheck.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,16 @@ mp_float_t mp_arg_validate_obj_float_non_negative(mp_obj_t float_in, mp_float_t
189189
const mp_float_t f = (float_in == MP_OBJ_NULL)
190190
? default_for_null
191191
: mp_obj_get_float(float_in);
192-
if (f <= 0.0f) {
192+
if (f <= (mp_float_t)0.0) {
193193
mp_raise_ValueError_varg(translate("%q must be >= 0"), arg_name);
194194
}
195195
return f;
196196
}
197197

198198
size_t mp_arg_validate_length_with_name(mp_int_t i, size_t length, qstr arg_name, qstr length_name) {
199-
mp_raise_ValueError_varg(translate("%q length must be %q"), MP_QSTR_pressed, MP_QSTR_num_keys);
199+
if (i != (mp_int_t)length) {
200+
mp_raise_ValueError_varg(translate("%q length must be %q"), MP_QSTR_pressed, MP_QSTR_num_keys);
201+
}
200202
return (size_t)i;
201203
}
202204

shared-bindings/keypad/Keys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
//| class Keys:
3737
//| """Manage a set of independent keys."""
3838
//|
39-
//| def __init__(self, pins: Sequence[microcontroller.Pin], *, level_when_pressed: bool, pull: bool = True, interval: float = 0.020, max_events: int = 64) -> None:
39+
//| def __init__(self, pins: Sequence[microcontroller.Pin], *, value_when_pressed: bool, pull: bool = True, interval: float = 0.020, max_events: int = 64) -> None:
4040
//| """
4141
//| Create a `Keys` object that will scan keys attached to the given sequence of pins.
4242
//| Each key is independent and attached to its own pin.

shared-bindings/keypad/ShiftRegisterKeys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
//| class ShiftRegisterKeys:
3737
//| """Manage a set of keys attached to an incoming shift register."""
3838
//|
39-
//| def __init__(self, clock: microcontroller.Pin, data: microcontroller.Pin, latch: microcontroller.Pin, level_when_pressed: bool, interval: float = 0.020, max_events: int = 64) -> None:
39+
//| def __init__(self, clock: microcontroller.Pin, data: microcontroller.Pin, latch: microcontroller.Pin, value_when_pressed: bool, interval: float = 0.020, max_events: int = 64) -> None:
4040
//| """
4141
//| Create a `Keys` object that will scan keys attached to a parallel-in serial-out shift register
4242
//| like the 74HC165 or equivalent.

0 commit comments

Comments
 (0)