Skip to content

Commit

Permalink
Remove binary_info blocks from most examples. (#3385)
Browse files Browse the repository at this point in the history
  • Loading branch information
CBJamo authored Oct 1, 2024
1 parent e6ce810 commit bc01808
Show file tree
Hide file tree
Showing 45 changed files with 8 additions and 445 deletions.
12 changes: 1 addition & 11 deletions examples/rp23/src/bin/adc.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! This example test the ADC (Analog to Digital Conversion) of the RS2040 pin 26, 27 and 28.
//! This example test the ADC (Analog to Digital Conversion) of the RP2350A pins 26, 27 and 28.
//! It also reads the temperature sensor in the chip.

#![no_std]
Expand All @@ -17,16 +17,6 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"example"),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"Blinky"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

bind_interrupts!(struct Irqs {
ADC_IRQ_FIFO => InterruptHandler;
});
Expand Down
10 changes: 0 additions & 10 deletions examples/rp23/src/bin/adc_dma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"example"),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"Blinky"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

bind_interrupts!(struct Irqs {
ADC_IRQ_FIFO => InterruptHandler;
});
Expand Down
10 changes: 0 additions & 10 deletions examples/rp23/src/bin/assign_resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"example"),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"Blinky"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

#[embassy_executor::main]
async fn main(spawner: Spawner) {
// initialize the peripherals
Expand Down
11 changes: 7 additions & 4 deletions examples/rp23/src/bin/blinky.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,23 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
// Program metadata for `picotool info`.
// This isn't needed, but it's recomended to have these minimal entries.
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"example"),
embassy_rp::binary_info::rp_program_name!(c"Blinky Example"),
embassy_rp::binary_info::rp_program_description!(
c"This example tests the RP Pico on board LED, connected to gpio 25"
),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"Blinky"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

#[embassy_executor::main]
async fn main(_spawner: Spawner) {
let p = embassy_rp::init(Default::default());
let mut led = Output::new(p.PIN_2, Level::Low);
let mut led = Output::new(p.PIN_25, Level::Low);

loop {
info!("led on!");
Expand Down
10 changes: 0 additions & 10 deletions examples/rp23/src/bin/blinky_two_channels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,6 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"example"),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"Blinky"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

enum LedState {
Toggle,
}
Expand Down
10 changes: 0 additions & 10 deletions examples/rp23/src/bin/blinky_two_tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,6 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"example"),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"Blinky"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

type LedType = Mutex<ThreadModeRawMutex, Option<Output<'static>>>;
static LED: LedType = Mutex::new(None);

Expand Down
10 changes: 0 additions & 10 deletions examples/rp23/src/bin/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,6 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"example"),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"Blinky"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

#[embassy_executor::main]
async fn main(_spawner: Spawner) {
let p = embassy_rp::init(Default::default());
Expand Down
10 changes: 0 additions & 10 deletions examples/rp23/src/bin/debounce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"example"),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"Blinky"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

pub struct Debouncer<'a> {
input: Input<'a>,
debounce: Duration,
Expand Down
10 changes: 0 additions & 10 deletions examples/rp23/src/bin/flash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"example"),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"Flash"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

const ADDR_OFFSET: u32 = 0x100000;
const FLASH_SIZE: usize = 2 * 1024 * 1024;

Expand Down
10 changes: 0 additions & 10 deletions examples/rp23/src/bin/gpio_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"example"),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"Blinky"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

/// It requires an external signal to be manually triggered on PIN 16. For
/// example, this could be accomplished using an external power source with a
/// button so that it is possible to toggle the signal from low to high.
Expand Down
10 changes: 0 additions & 10 deletions examples/rp23/src/bin/gpout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"example"),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"Blinky"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

#[embassy_executor::main]
async fn main(_spawner: Spawner) {
let p = embassy_rp::init(Default::default());
Expand Down
10 changes: 0 additions & 10 deletions examples/rp23/src/bin/i2c_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"example"),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"Blinky"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

bind_interrupts!(struct Irqs {
I2C1_IRQ => InterruptHandler<I2C1>;
});
Expand Down
10 changes: 0 additions & 10 deletions examples/rp23/src/bin/i2c_async_embassy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"example"),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"Blinky"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

// Our anonymous hypotetical temperature sensor could be:
// a 12-bit sensor, with 100ms startup time, range of -40*C - 125*C, and precision 0.25*C
// It requires no configuration or calibration, works with all i2c bus speeds,
Expand Down
10 changes: 0 additions & 10 deletions examples/rp23/src/bin/i2c_blocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"example"),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"Blinky"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

#[allow(dead_code)]
mod mcp23017 {
pub const ADDR: u8 = 0x20; // default addr
Expand Down
10 changes: 0 additions & 10 deletions examples/rp23/src/bin/i2c_slave.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"example"),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"Blinky"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

bind_interrupts!(struct Irqs {
I2C0_IRQ => i2c::InterruptHandler<I2C0>;
I2C1_IRQ => i2c::InterruptHandler<I2C1>;
Expand Down
10 changes: 0 additions & 10 deletions examples/rp23/src/bin/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,6 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"example"),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"Blinky"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

static COUNTER: AtomicU32 = AtomicU32::new(0);
static PWM: Mutex<CriticalSectionRawMutex, RefCell<Option<Pwm>>> = Mutex::new(RefCell::new(None));
static ADC: Mutex<CriticalSectionRawMutex, RefCell<Option<(Adc<Blocking>, adc::Channel)>>> =
Expand Down
10 changes: 0 additions & 10 deletions examples/rp23/src/bin/multicore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"example"),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"Blinky"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

static mut CORE1_STACK: Stack<4096> = Stack::new();
static EXECUTOR0: StaticCell<Executor> = StaticCell::new();
static EXECUTOR1: StaticCell<Executor> = StaticCell::new();
Expand Down
10 changes: 0 additions & 10 deletions examples/rp23/src/bin/multiprio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,6 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"example"),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"Blinky"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

#[embassy_executor::task]
async fn run_high() {
loop {
Expand Down
10 changes: 0 additions & 10 deletions examples/rp23/src/bin/otp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,6 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"OTP Read Example"),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"OTP Read Example"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

#[embassy_executor::main]
async fn main(_spawner: Spawner) {
let _ = embassy_rp::init(Default::default());
Expand Down
10 changes: 0 additions & 10 deletions examples/rp23/src/bin/pio_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"example"),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"Blinky"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

bind_interrupts!(struct Irqs {
PIO0_IRQ_0 => InterruptHandler<PIO0>;
});
Expand Down
10 changes: 0 additions & 10 deletions examples/rp23/src/bin/pio_dma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"example"),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"Blinky"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

bind_interrupts!(struct Irqs {
PIO0_IRQ_0 => InterruptHandler<PIO0>;
});
Expand Down
10 changes: 0 additions & 10 deletions examples/rp23/src/bin/pio_hd44780.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ use {defmt_rtt as _, panic_probe as _};
#[used]
pub static IMAGE_DEF: ImageDef = ImageDef::secure_exe();

// Program metadata for `picotool info`
#[link_section = ".bi_entries"]
#[used]
pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
embassy_rp::binary_info::rp_program_name!(c"example"),
embassy_rp::binary_info::rp_cargo_version!(),
embassy_rp::binary_info::rp_program_description!(c"Blinky"),
embassy_rp::binary_info::rp_program_build_attribute!(),
];

bind_interrupts!(pub struct Irqs {
PIO0_IRQ_0 => InterruptHandler<PIO0>;
});
Expand Down
Loading

0 comments on commit bc01808

Please sign in to comment.