Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Heizung
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
c3pb
Heizung
Commits
929677b8
Commit
929677b8
authored
1 year ago
by
Benjamin Koch
Browse files
Options
Downloads
Patches
Plain Diff
bugfix: 1.5 char timeout was off by a factor of 1000
parent
30743dc6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
firmware/rust1/src/rs485.rs
+2
-2
2 additions, 2 deletions
firmware/rust1/src/rs485.rs
with
2 additions
and
2 deletions
firmware/rust1/src/rs485.rs
+
2
−
2
View file @
929677b8
...
@@ -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
);
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment