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

Slight general cleanup, enable dma-macros test, allow using virtual mem2mem channel on c2 #2200

Merged
merged 7 commits into from
Sep 20, 2024

Conversation

bugadani
Copy link
Contributor

@bugadani bugadani commented Sep 20, 2024

  • Record MSRV change in embassy crate
  • change cfgs to peripherals
  • use const blocks instead of interior mutable consts
  • remove some unnecessary internal type aliasses
  • enables dma_macros for ESP32 and S2
  • allow using MEM2MEM1 on ESP32C2. The DMA seems to ignore the peripheral selection bit for in-memory transactions

@bugadani bugadani added the skip-changelog No changelog modification needed label Sep 20, 2024
@bugadani bugadani changed the title Slight general cleanup Slight general cleanup, enable dma-macros test Sep 20, 2024
@bugadani bugadani changed the title Slight general cleanup, enable dma-macros test Slight general cleanup, enable dma-macros test, allow using virtual mem2mem channel on c2 Sep 20, 2024
Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is just meant to be a clean up PR, LGTM!

embassy_time_driver::time_driver_impl!(static DRIVER: EmbassyTimer = EmbassyTimer {
alarms: Mutex::new([ALARM_STATE_NONE; MAX_SUPPORTED_ALARM_COUNT]),
alarms: Mutex::new([const { AlarmState::new() }; MAX_SUPPORTED_ALARM_COUNT]),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooo fancy

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New toys with the 1.79 msrv :)

#[allow(clippy::declare_interior_mutable_const)]
const INIT: AtomicWaker = AtomicWaker::new();
static WAKERS: [AtomicWaker; NUM_I2C] = [INIT; NUM_I2C];
const NUM_I2C: usize = 1 + cfg!(i2c1) as usize;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice trick, we should do this in more places.

},
_ => panic!("Only SPI2 and SPI3 supported"),
}
dport
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This init_channel function can be removed and this code can be moved to either configure/configure_for_async or set_peripheral.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to modify this code too much lest your PR will probably conflict, but let's see :)

@jessebraham jessebraham added this pull request to the merge queue Sep 20, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 20, 2024
@bugadani
Copy link
Contributor Author

Failure looks like a network error if anything; rebased & retrying merge

@jessebraham
Copy link
Member

Failure looks like a network error if anything; rebased & retrying merge

Yeah I've seen this happen a few times before, has always succeeded in a subsequent run in my experience at least.

@bugadani bugadani added this pull request to the merge queue Sep 20, 2024
Merged via the queue into esp-rs:main with commit d4e463b Sep 20, 2024
28 checks passed
@bugadani bugadani deleted the cleanup branch September 20, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog No changelog modification needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants