mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-10-02 14:44:32 +00:00
Refactor overclock test for RP2040: add unused imports conditionally and ensure placeholder main function for non-RP2040 targets
This commit is contained in:
parent
3c559378a5
commit
7fa59a6b31
@ -1,14 +1,23 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
#![no_main]
|
#![no_main]
|
||||||
|
#![cfg_attr(not(feature = "rp2040"), allow(unused_imports))]
|
||||||
|
|
||||||
#[cfg(feature = "rp2040")]
|
#[cfg(feature = "rp2040")]
|
||||||
teleprobe_meta::target!(b"rpi-pico");
|
teleprobe_meta::target!(b"rpi-pico");
|
||||||
|
|
||||||
|
#[cfg(feature = "rp2040")]
|
||||||
use defmt::{assert, assert_eq, info};
|
use defmt::{assert, assert_eq, info};
|
||||||
|
#[cfg(feature = "rp2040")]
|
||||||
use embassy_executor::Spawner;
|
use embassy_executor::Spawner;
|
||||||
|
#[cfg(feature = "rp2040")]
|
||||||
use embassy_rp::config::Config;
|
use embassy_rp::config::Config;
|
||||||
|
#[cfg(feature = "rp2040")]
|
||||||
use embassy_rp::gpio::{Input, Pull};
|
use embassy_rp::gpio::{Input, Pull};
|
||||||
|
#[cfg(feature = "rp2040")]
|
||||||
use embassy_rp::pwm::{Config as PwmConfig, Pwm};
|
use embassy_rp::pwm::{Config as PwmConfig, Pwm};
|
||||||
|
#[cfg(feature = "rp2040")]
|
||||||
use embassy_time::{Instant, Timer};
|
use embassy_time::{Instant, Timer};
|
||||||
|
#[cfg(feature = "rp2040")]
|
||||||
use {defmt_rtt as _, panic_probe as _};
|
use {defmt_rtt as _, panic_probe as _};
|
||||||
|
|
||||||
#[cfg(feature = "rp2040")]
|
#[cfg(feature = "rp2040")]
|
||||||
@ -60,3 +69,11 @@ async fn main(_spawner: Spawner) {
|
|||||||
info!("Overclock test successful");
|
info!("Overclock test successful");
|
||||||
cortex_m::asm::bkpt();
|
cortex_m::asm::bkpt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(feature = "rp2040"))]
|
||||||
|
#[embassy_executor::main]
|
||||||
|
async fn main(_spawner: embassy_executor::Spawner) {
|
||||||
|
// This is an empty placeholder main function for non-RP2040 targets
|
||||||
|
// It should never be called since the test only runs on RP2040
|
||||||
|
cortex_m::asm::bkpt();
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user