Skip to content

Commit deca3b8

Browse files
Merge pull request #33 from Neotron-Compute/tweak-bus-comms
Tweak bus comms
2 parents 9d93f3a + 1dffab8 commit deca3b8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,12 @@ impl Hardware {
370370
/// MCP23S17 CS pin disable time (between transactions). At least 50ns, we give 100ns.
371371
const CS_IO_DISABLE_CPU_CLOCKS: u32 = 100 / Self::NS_PER_CLOCK_CYCLE;
372372

373-
/// Give the device 2us (2 clocks @ 1 MHz) to get ready.
374-
const CS_BUS_SETUP_CPU_CLOCKS: u32 = 2000 / Self::NS_PER_CLOCK_CYCLE;
373+
/// Give the device 10us to get ready.
374+
///
375+
/// This seems to reduce the error rate on the BMC link to an acceptable level.
376+
const CS_BUS_SETUP_CPU_CLOCKS: u32 = 10_000 / Self::NS_PER_CLOCK_CYCLE;
375377

376-
/// Give the device 2us (2 clocks @ 1 MHz) before we take away CS.
378+
/// Give the device 2000ns before we take away CS.
377379
const CS_BUS_HOLD_CPU_CLOCKS: u32 = 2000 / Self::NS_PER_CLOCK_CYCLE;
378380

379381
/// Give the device 10us when we do a retry.
@@ -1554,7 +1556,7 @@ extern "C" fn block_dev_eject(dev_id: u8) -> common::Result<()> {
15541556
/// Sleep the CPU until the next interrupt.
15551557
extern "C" fn power_idle() {
15561558
// cortex_m::asm::wfe();
1557-
// cortex_m::asm::delay(20_000_000);
1559+
cortex_m::asm::delay(1_000_000);
15581560
}
15591561

15601562
/// TODO: Get the monotonic run-time of the system from SysTick.

0 commit comments

Comments
 (0)