aboutsummaryrefslogtreecommitdiff
path: root/tests/rp/src/bin
diff options
context:
space:
mode:
author1-rafael-1 <[email protected]>2025-05-01 18:38:03 +0200
committer1-rafael-1 <[email protected]>2025-05-01 18:38:03 +0200
commit7fa59a6b31c7c9744e5cdef3826bc4e726736606 (patch)
tree12e8a9531afc831ed30b9a10eac1edca861a6110 /tests/rp/src/bin
parent3c559378a5f3662134cb7db2d902302d7cb8f937 (diff)
Refactor overclock test for RP2040: add unused imports conditionally and ensure placeholder main function for non-RP2040 targets
Diffstat (limited to 'tests/rp/src/bin')
-rw-r--r--tests/rp/src/bin/overclock.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/rp/src/bin/overclock.rs b/tests/rp/src/bin/overclock.rs
index c7b9180a0..c4393dde4 100644
--- a/tests/rp/src/bin/overclock.rs
+++ b/tests/rp/src/bin/overclock.rs
@@ -1,14 +1,23 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![cfg_attr(not(feature = "rp2040"), allow(unused_imports))]
4
3#[cfg(feature = "rp2040")] 5#[cfg(feature = "rp2040")]
4teleprobe_meta::target!(b"rpi-pico"); 6teleprobe_meta::target!(b"rpi-pico");
5 7
8#[cfg(feature = "rp2040")]
6use defmt::{assert, assert_eq, info}; 9use defmt::{assert, assert_eq, info};
10#[cfg(feature = "rp2040")]
7use embassy_executor::Spawner; 11use embassy_executor::Spawner;
12#[cfg(feature = "rp2040")]
8use embassy_rp::config::Config; 13use embassy_rp::config::Config;
14#[cfg(feature = "rp2040")]
9use embassy_rp::gpio::{Input, Pull}; 15use embassy_rp::gpio::{Input, Pull};
16#[cfg(feature = "rp2040")]
10use embassy_rp::pwm::{Config as PwmConfig, Pwm}; 17use embassy_rp::pwm::{Config as PwmConfig, Pwm};
18#[cfg(feature = "rp2040")]
11use embassy_time::{Instant, Timer}; 19use embassy_time::{Instant, Timer};
20#[cfg(feature = "rp2040")]
12use {defmt_rtt as _, panic_probe as _}; 21use {defmt_rtt as _, panic_probe as _};
13 22
14#[cfg(feature = "rp2040")] 23#[cfg(feature = "rp2040")]
@@ -60,3 +69,11 @@ async fn main(_spawner: Spawner) {
60 info!("Overclock test successful"); 69 info!("Overclock test successful");
61 cortex_m::asm::bkpt(); 70 cortex_m::asm::bkpt();
62} 71}
72
73#[cfg(not(feature = "rp2040"))]
74#[embassy_executor::main]
75async fn main(_spawner: embassy_executor::Spawner) {
76 // This is an empty placeholder main function for non-RP2040 targets
77 // It should never be called since the test only runs on RP2040
78 cortex_m::asm::bkpt();
79}