Skip to content

Commit 11c110e

Browse files
committed
synthio: remove 'none' case from lfo_tick
1 parent c084ab9 commit 11c110e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

shared-module/synthio/__init__.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -550,11 +550,7 @@ void shared_bindings_synthio_lfo_tick(uint32_t sample_rate) {
550550
}
551551

552552
mp_float_t synthio_block_slot_get(synthio_block_slot_t *slot) {
553-
if (slot->obj == mp_const_none) {
554-
return MICROPY_FLOAT_CONST(0.);
555-
}
556-
557-
// all numbers previously converted to float in synthio_block_assign_slot
553+
// all numbers (and None!) previously converted to float in synthio_block_assign_slot
558554
if (mp_obj_is_float(slot->obj)) {
559555
return mp_obj_get_float(slot->obj);
560556
}
@@ -594,7 +590,7 @@ void synthio_block_assign_slot(mp_obj_t obj, synthio_block_slot_t *slot, qstr ar
594590
return;
595591
}
596592

597-
mp_float_t value;
593+
mp_float_t value = MICROPY_FLOAT_CONST(0.);
598594
if (obj != mp_const_none && !mp_obj_get_float_maybe(obj, &value)) {
599595
mp_raise_TypeError_varg(translate("%q must be of type %q, not %q"), arg_name, MP_QSTR_BlockInput, mp_obj_get_type_qstr(obj));
600596
}

0 commit comments

Comments
 (0)