riscv-rust / e310x-hal

Implementation of the `embedded-hal` traits for E310x microcontrollers
17 stars 18 forks source link

use atomic-polyfill #54

Closed romancardenas closed 1 year ago

romancardenas commented 1 year ago

This PR substitutes imports to core::sync::atomic to atomic_polyfill. In this way, we can now build e310x-hal for riscv32imc-unknown-none-elf targets.

The E310X board does NOT support the lr nor the sc atomic instructions (...). Thus, atomic functions such as compare_exchange trigger an exception. For those projects that use these functions (e.g., RTIC), we need to allow builds for riscv32imc-unknown-none-elf and let atomic-polyfill do the trick.

romancardenas commented 1 year ago

BTW, this relates to #53