Skip to content
Snippets Groups Projects
Commit 929677b8 authored by Benjamin Koch's avatar Benjamin Koch
Browse files

bugfix: 1.5 char timeout was off by a factor of 1000

parent 30743dc6
No related branches found
No related tags found
No related merge requests found
...@@ -242,10 +242,10 @@ impl<H: RS485Handler> RS485<H> { ...@@ -242,10 +242,10 @@ impl<H: RS485Handler> RS485<H> {
// We need two clocks for each loop. // We need two clocks for each loop.
//let timeout_start_value = (SM_FREQ as f32 * 0.86e-3 / 2.) as u32; //let timeout_start_value = (SM_FREQ as f32 * 0.86e-3 / 2.) as u32;
let symbols_per_byte = if self.uart_parity == Parity::ParityNone { 10 } else { 11 }; let symbols_per_byte = if self.uart_parity == Parity::ParityNone { 10 } else { 11 };
let timeout_seconds = 1.5 * symbols_per_byte as f32 * 1000. / self.uart_baud_rate as f32; let timeout_seconds = 1.5 * symbols_per_byte as f32 / self.uart_baud_rate as f32;
let timeout_start_value = (SM_FREQ as f32 * timeout_seconds / 2.) as u32; let timeout_start_value = (SM_FREQ as f32 * timeout_seconds / 2.) as u32;
sm.tx().push(timeout_start_value); sm.tx().push(timeout_start_value);
info!("timeout_start_value: {} = 0x{:08x}", timeout_start_value, timeout_start_value); info!("timeout_start_value: {} = 0x{:08x}, {} sec, clkdiv 0x{:08x}", timeout_start_value, timeout_start_value, timeout_seconds, cfg.clock_divider.to_bits());
// switch to the real program and join FIFOs // switch to the real program and join FIFOs
unsafe { common.free_instr(loaded_program.used_memory); }; unsafe { common.free_instr(loaded_program.used_memory); };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment