Skip to content

Commit

Permalink
Display cache information
Browse files Browse the repository at this point in the history
  • Loading branch information
ceigel committed Jan 12, 2021
1 parent 8b727db commit 71d7dd9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,20 @@ fn rfid_read_card(rfid_reader: &mut RFIDReaderType) -> Option<mfrc522::Uid> {
atqa.and_then(|atqa| rfid_reader.select(&atqa)).ok()
}

fn print_cache_states() {
let icache_state = if cortex_m::peripheral::SCB::icache_enabled() {
"enabled"
} else {
"disabled"
};
let dcache_state = if cortex_m::peripheral::SCB::dcache_enabled() {
"enabled"
} else {
"disabled"
};
debug!("ICache {}", icache_state);
debug!("ICache {}", dcache_state);
}
#[app(device = stm32l4xx_hal::stm32, monotonic = rtic::cyccnt::CYCCNT, peripherals = true)]
const APP: () = {
struct Resources {
Expand Down Expand Up @@ -422,6 +436,7 @@ const APP: () = {
let leds_cyclic_time = time_computer.to_cycles(LEDS_CYCLIC_TIME);
let battery_reader_cyclic_time = time_computer.to_cycles(BATTERY_READER_CYCLIC_TIME);

print_cache_states();
info!("Init finished");
state_leds.set_state(state::State::Init(state::InitState::InitFinished));
init::LateResources {
Expand Down

0 comments on commit 71d7dd9

Please sign in to comment.