Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fractional divider support for RMT hal #2127

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions esp-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Previously unavailable memory is available via `.dram2_uninit` section (#2079)
- You can now use `Input`, `Output`, `OutputOpenDrain` and `Flex` pins as EXTI and RTCIO wakeup sources (#2095)
- Added `Rtc::set_current_time` to allow setting RTC time, and `Rtc::current_time` to getting RTC time while taking into account boot time (#1883)
- Add RMT fractional divider support.
Tnze marked this conversation as resolved.
Show resolved Hide resolved

### Changed

Expand Down
7 changes: 6 additions & 1 deletion esp-hal/src/rmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2541,7 +2541,12 @@ mod clock_divider_solver {
} else if a < b {
l = m;
} else {
unreachable!();
// unreachable!();
Tnze marked this conversation as resolved.
Show resolved Hide resolved
return Some(Self {
div_num: quotient,
div_b: m.numerator,
div_a: m.denominator,
});
}
}
}
Expand Down