diff --git a/CHANGELOG.md b/CHANGELOG.md index 25d0e51ff..95e651b44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,12 +35,14 @@ - Fixed `DriveBase.angle()` getting an incorrectly rounded gyro value, which could cause `turn(360)` to be off by a degree ([support#1844]). - Fixed `hub` silently ignoring non-orthogonal base axis when it should raise. +- Fixed not handling negative duration in `Speaker.beep()` ([support#1996]). [pybricks-micropython#274]: https://github.com/pybricks/pybricks-micropython/pull/274 [support#943]: https://github.com/pybricks/support/issues/943 [support#1886]: https://github.com/pybricks/support/issues/1886 [support#1844]: https://github.com/pybricks/support/issues/1844 -[support#1875]: https://github.com/pybricks/support/issues/1975 +[support#1975]: https://github.com/pybricks/support/issues/1975 +[support#1996]: https://github.com/pybricks/support/issues/1996 ## [3.6.0b2] - 2024-10-15 diff --git a/pybricks/common/pb_type_speaker.c b/pybricks/common/pb_type_speaker.c index 6f41e8d16..676677995 100644 --- a/pybricks/common/pb_type_speaker.c +++ b/pybricks/common/pb_type_speaker.c @@ -152,7 +152,7 @@ static mp_obj_t pb_type_Speaker_beep(size_t n_args, const mp_obj_t *pos_args, mp pb_type_Speaker_start_beep(frequency, self->sample_attenuator); if (duration < 0) { - duration = 0; + return mp_const_none; } self->beep_end_time = mp_hal_ticks_ms() + (uint32_t)duration;