* RMT: Remove duplicate conditionals
The next check,
config.memsize > NUM_CHANNELS - T::CHANNEL
just below includes this case and exits with the same error.
* RMT: move chip-specific code to chip_specific modules
Moves configure_clock and clear_memsizes from Rmt methods to the chip_specific
sub-modules:
- configure_clock dispatches to functions from chip_specific anyway,
using the same #cfg attributes as the chip_specific module
- clear_memsizes also uses the same #cfg attributes, and it deals with
low-level register access, which is generally contained in the chip_specific
module
* RMT: small refactor of divider calculation using let-else
The same check as before, but slightly more concise, and getting rid of
the explicit cast.
* RMT: simplify is_memory_blocks_available and set_memory_blocks_unavailable
by removing unnecessary checks for special-case values that actually behave the
same as the general case that is handled in the loops
* RMT: merge is_memory_blocks_available and set_memory_blocks_unavailable
Both are only used in conjunction anyway.
There's a TOCTOU issue here: ChannelCreator is Send + Sync, so it can be
used from ISR context or on different cores for multicore targets.
This commit does not address that yet, but is a first step to fixing the
race condition, which would require making the check-then-modify atomic
(atomic per channel would probably be sufficient).
* RMT: move reserve_memory from trait to chip_specific module
Mainly, this also fixes incorrect indexig of ch_tx_conf0, ch_rx_conf0
for some chips (esp32s3, esp32c3, ...).
It also allows for some deduplication of the logic in reserve_memory.
Generally, since this function deals with the collection of all channels
rather than just a single one, it feels more natural to move it to the
module rather than the per-channel trait.
* RMT: avoid race condition via critical_section
This is not a great solution, but resolving this in a better way seems
to require more design work: The PAC crates don't seem to provide atomic
CAS operations on registers, thus it is not easily possible to reserve
the memory belonging to another channel than the current one without
causing a race condition: Another channel could be used to concurrently
reserve the same memory, either from an ISR context, or from another
core on multi-core chips.
* RMT: Release channel RAM on Channel drop
This should allow it to be re-used, either by other subsequent channels,
or by the initial channel if it was used for a non-'static lifetime and
is re-initialized.
* RMT: add global STATE and use it to control channel RAM access
Right now, this removes the use of critical_section previously
introduced as a stopgap solution to a race condition.
It will generally be useful to track state in a global static atomic for adding
fully interrupt-driven transfers later on.
* RMT: Fix regression form #3292 where tx transaction doesn't write
enough data
The idea is to fill half of the available RAM in on each threshold
event. Increasing the amount of available RAM in this calculation was
forgotten when adding support for extended channel RAM.
* Create `command` submodule, extract build-related args/actions
* Extract run-related args/actions
* Fix clippy warnings
* Update `README.md` for xtask package
* Fix order of positional arguments for examples
* Update workflows and cargo aliases
* Inline function which is only called in one place
* Update HIL workflow
* Copy eFuse field definitions from `espflash` repo, make required changes to get building again
* Clean up functions for reading eFuse fields a bit
* Make reading the MAC address chip-agnostic
* Remove eFuse field generation from `xtask` package
* Remove `read_field_be` function, as it's not really required
* Fix clippy lint errors
* Update `CHANGELOG.md`
---------
Co-authored-by: Scott Mabin <scott@mabez.dev>
* Group optional dependencies
* Separate version from crate name
* Restore defmt-log mutual exclusivity
* Gate ufmt
* Remove usb-device
* Feature-gate unsable dependencies behind unstable
* S2: assume single core for portable-atomic
* Clean up feature flag docs
* Sack debug
* Fix clippy
* Update examples
* Fix usb-otg feature
* Fix fmt
* Add version to log dep
* Also mark bluetooth private
* Correct changelog/MG
* Clean up esp-hal-embassy
* Clean up ieee802154
* Clean up esp-println
* Move the timestamp function up
* Move info from readme to feature docs
* Clean up esp-storage
* Clean up esp-wifi
* Fix examples
* Add a note for the private features
* Have one place for phy calibration
* Offer phy calibration modes other than FULL
* Add config for initial power save mode
* CHANGELOG.md
* Fixes after rebase
* Remove initial-power-save-mode
* Rebase adjustments
* Clean up systimer conditional cfgs
* Seal and clean up e-h-embassy timebase
* Remove separate collection trait
* Panic if EmbassyTimer::init is called multiple times
* Changelog
* Make documentation respect ESP32
* Add test case
* Split into files
* Do not clear interrupt status bits in handler
* Document changes
* Refactor gpio tests to test the default interrupt handler by default
* Fix typo
* Extract mk_static
* Write a bit about interrupt handling
* Various fixes
* Test that the future doesn't resolve for a preceding interrupt
* Add multi-core test
* ESP32: handle GPIO interrupt on the listening core
* Fix multi-core edge case
* WIP
* Clean up init_gpio
* Expand docs a bit
* Remove Input/OutputConnection
* Not everything has PCNT and it's not important for the example
* Remove Frozen, enable input when creating the signal
* Hide fields, add getters
* Update MG
* Add force GPIO matrix fns
* Fix formatting
* Mention latency in the docs
* Rename number to gpio_number
* Deduplicate pin setup code
* Reword associated peripheral
* Rename with_inverted_input/output
* Remove link to doc-hidden OutputSignal
* Fix link syntax
* Make sure to enable relevant interrupts
* Fix more
* Make `current_runlevel` public
* Check that interrupts are enabled when initializing
* Try to be more honest in `is_in_isr`
* Adjust log levels
* Really fix ESP32 COEX
* Improve COEX example
* fmt
* CHANGELOG
* CHANGELOG
* Clarify on `esp_bt_controller_config_t`
* Take INTENABLE into account
* Test esp-wifi init fails
* Simplify test code
* Clarify comment
* fmt
* Rename
* Adapt the test
* Revert unrelated changes (esp_bt_controller_config_t)
* Align Xtensa (current_runlevel)
* Additional test
* Change test
* inter-state
* inter-state (2)
* warnings fix
* fix warnings
* fmt + changelogs
* another unsafe extern "C" doode
* real fmt now
* MSRV + format
* Ignore unsafe_op_in_unsafe_fn lint for now in esp-hal and esp-wifi
* msrv + fmt
* ugh....
* get lcd_cam example right
* expr_2021 -> expr experiment
* gagagugu
* reviews
* more unneeded unsafes (help)
* finish esp-hal unsafe cleanup
* each unsafe call is marked separately
fmt
* should be good now (?)
* piece was never an option...
* dumb
* Add basic OTA functionality
* Return Result from Ota::new
* Restructured
* Enable `ota` by default
* Include metadata to let tooling know we need an ota-data partition
* More docs
* CHANGELOG.md
* Make OSX happy to run tests
* Another try
* OSX...
* OSX, again
* Add tests
* Prefer ROM CRC function
* Unconditionally include the "ota" feature
* Renaming and docs
* de-noise tests
* De-duplicate
* Address more review comments
* Review comments and Clippy