Skip to content

Use portable-atomic on embassy-executor #5698

Description

@langbeck

When developing to an ESP32C3 (RISCV32 IMC) that doesn't have proper atomic support, operations such as AtomicPtr::compare_exchange doesn't exist. That's necessary when enabling embassy-executor's rtos-trace feature by src/raw/trace.rs.

On 'src/raw/mod.rs' we already have this for AVR:

#[cfg(not(feature = "arch-avr"))]
use core::sync::atomic::AtomicPtr;

...

#[cfg(feature = "arch-avr")]
use portable_atomic::AtomicPtr;

Doing the same for RISCV and modifying src/raw/trace.rs's imports, should fix this.
Another suggestion would be adding a portable-atomic feature and a internal atomic module that controls which atomic flavor we're using.

Environment

  • embassy-executor-0.9.1
  • Cargo 1.94.0
  • Rust 1.88
  • Arch RISCV32 IMC

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions