Add defmt support to new flash types

This commit is contained in:
Rasmus Melchior Jacobsen 2023-03-30 09:17:14 +02:00
parent 02caec9482
commit a78e10e003

View File

@ -9,6 +9,8 @@ pub use common::*;
pub use crate::_generated::flash_regions::*; pub use crate::_generated::flash_regions::*;
pub use crate::pac::{FLASH_BASE, FLASH_SIZE, WRITE_SIZE}; pub use crate::pac::{FLASH_BASE, FLASH_SIZE, WRITE_SIZE};
#[derive(Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct FlashRegion { pub struct FlashRegion {
pub bank: FlashBank, pub bank: FlashBank,
pub base: u32, pub base: u32,
@ -19,6 +21,7 @@ pub struct FlashRegion {
} }
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct FlashSector { pub struct FlashSector {
pub bank: FlashBank, pub bank: FlashBank,
pub index_in_bank: u8, pub index_in_bank: u8,
@ -27,6 +30,7 @@ pub struct FlashSector {
} }
#[derive(Clone, Copy, Debug, PartialEq)] #[derive(Clone, Copy, Debug, PartialEq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum FlashBank { pub enum FlashBank {
Bank1 = 0, Bank1 = 0,
Bank2 = 1, Bank2 = 1,