* TickType: Make all functions const
* delay: Inline small functions
* Unexport the raw ets_delay_us()
The raw unsafe ets delay function is not useful in user programs.
Programs should use Ets::delay_us() instead.
* delay: Add some documentation comments
* delay: Implement Default for Delay
* delay: Remove unnecessary warning suppressions
* Improve system tick division and rounding
TICK_PERIOD_MS might include an error, if 1000 ms is not divisible by the configured tick rate.
Do not use it internally for converting between ms and ticks.
Also, always round up when dividing.
* Round delay times up
It's typically desired to round delay times up instead of down,
because a delay usually waits for a thing (e.g. hardware) to finish.
If we would round down, it is more likely to cause ill effects than
rounding up. The user code usually expects delaying a bit more.
In case of the coarse timer the "waiting a bit more" may be fairly
large. But if the user code uses a coarse timer for small delays
it's a problem in the user code.
This change also converts a couple of 'as' conversions to 'into()' calls.
* Export tick rate in Hz instead of tick period
because the division may introduce a rounding error on certain configurations.
* Make TickType::new_millis() pub
as counterpart to the existing as_millis()
* Ceil round Duration when converting to ms
We carefully saturate, even though it's unlikely that big durations
that overflow an u64 ms are supplied.
* delay: Replace constants with names
* Implement DelayNs::delay_ms()
The default implementation from embedded_hal is not ideal for
us, because it calls delay_ns() which we don't really support.
It causes unnecessary computation and rounding.
* rmt: wrap rmt_item32_t in a newtype
This makes it much easier to use `TxRmtDriver::start_iter` and
`TxRmtDriver::start_iter_blocking` (#113).
* examples/rmt_musical_buzzer: fix for ESP32
Possibly broken by #97, possibly never worked. The ESP-IDF repo
specifically excludes the ESP32 from the RMT musical buzzer demo
because its RMT unit lacks hardware looping. Before this change, the
demo would simply hang when trying to play the second note possibly
because the ESP32 RMT unit does not support asynchronous stopping.
As an added bonus, this example is now much easier to modify to
experiment with 1-bit chiptune synthesis by making every symbol
(cycle) accessible in the ISR iterator.
* rmt: remove Pulse::into_rmt_item in favor of Symbol::new
Also, factor Pulse pairs into function arguments for ease of use.
* don't touch pullups on reset while init PinDriver
ivan i am a sinner
clippy + fmt
clippy
more sinning in RTC
* fix missing unsafe
* cleanup
* extend the usage of reset_without_pull on drop + added changelog
* replace mem_froget with drop
This should provide a slightly user-friendlier error message in the case that a user enables a different `restore-state` in `critical-section`.
Right now it's possible to e.g. enable the `std` feature on `critical-section`; `cargo` will not complain but `rustc` will complain about the return types of the `CriticalSection::enter` implementation.
Version change: "1" -> "1.1"
`src/uart.rs` uses `EnumSet::EMPTY` for a `const fn`.
`EnumSet::EMPTY` is not available in 1.0.0, but first introduced in 1.1.