Skip to content

Commit 6918a95

Browse files
committed
Error if trying to change divisor after object creation.
1 parent d67bad0 commit 6918a95

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

locale/circuitpython.pot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3127,7 +3127,7 @@ msgid "division by zero"
31273127
msgstr ""
31283128

31293129
#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c
3130-
msgid "divisor must be 4"
3130+
msgid "divisor cannot be changed after object creation"
31313131
msgstr ""
31323132

31333133
#: extmod/ulab/code/numpy/vector.c

ports/espressif/common-hal/rotaryio/IncrementalEncoder.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,5 +135,5 @@ mp_int_t common_hal_rotaryio_incrementalencoder_get_divisor(rotaryio_incremental
135135
}
136136

137137
void common_hal_rotaryio_incrementalencoder_set_divisor(rotaryio_incrementalencoder_obj_t *self, mp_int_t divisor) {
138-
self->divisor = divisor;
138+
mp_raise_ValueError(translate("divisor cannot be changed after object creation"));
139139
}

0 commit comments

Comments
 (0)