Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
DIOT Monitoring Module
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
6
Issues
6
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
DIOT Monitoring Module
Commits
a98dc5b9
Commit
a98dc5b9
authored
Sep 19, 2023
by
Alén Arias Vázquez
😎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- main.c: change type to float
- main.c: equalize when error linear value to 0xFFFF
parent
972b05bc
Pipeline
#4875
passed with stage
in 1 minute and 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
main.c
main_fw/src/main.c
+6
-6
No files found.
main_fw/src/main.c
View file @
a98dc5b9
...
...
@@ -53,12 +53,12 @@ static uint16_t fan_ramp_up_count __xMR = 0;
#endif
/* MAX Speed Datasheet: 3600.0 */
#define FAN_MAX_RPMS 1500.0
#define FAN_MAX_RPMS 1500.0
f
#define FAN_MAX_FAIL_CNT 100
#define FAN_DEAD_WORD 0xFFFF
static
volatile
uint16_t
tacho_cnt
[
3
]
__xMR
;
static
volatile
uint16_
t
tacho_rpm
[
3
]
__xMR
;
static
volatile
uint16_
t
tacho_rpm_prev
[
3
]
__xMR
;
static
volatile
floa
t
tacho_rpm
[
3
]
__xMR
;
static
volatile
floa
t
tacho_rpm_prev
[
3
]
__xMR
;
static
volatile
uint16_t
tacho_rpm_fail_cnt
[
3
]
__xMR
;
// when fan_cmdrpm is 0, setfrpms and temp_curve_points_y represent
...
...
@@ -247,7 +247,7 @@ void __xMR update_rpm()
}
else
{
tacho_rpm_fail_cnt
[
0
]
++
;
if
(
tacho_rpm_fail_cnt
[
0
]
>=
FAN_MAX_FAIL_CNT
)
{
frpms_lin
[
0
]
=
float_to_linear
(
FAN_DEAD_WORD
)
;
frpms_lin
[
0
]
=
FAN_DEAD_WORD
;
}
else
{
frpms_lin
[
0
]
=
float_to_linear
(
tacho_rpm_prev
[
0
]);
}
...
...
@@ -270,7 +270,7 @@ void __xMR update_rpm()
}
else
{
tacho_rpm_fail_cnt
[
1
]
++
;
if
(
tacho_rpm_fail_cnt
[
1
]
>=
FAN_MAX_FAIL_CNT
)
{
frpms_lin
[
1
]
=
float_to_linear
(
FAN_DEAD_WORD
)
;
frpms_lin
[
1
]
=
FAN_DEAD_WORD
;
}
else
{
frpms_lin
[
1
]
=
float_to_linear
(
tacho_rpm_prev
[
1
]);
}
...
...
@@ -293,7 +293,7 @@ void __xMR update_rpm()
}
else
{
tacho_rpm_fail_cnt
[
2
]
++
;
if
(
tacho_rpm_fail_cnt
[
2
]
>=
FAN_MAX_FAIL_CNT
)
{
frpms_lin
[
2
]
=
float_to_linear
(
FAN_DEAD_WORD
)
;
frpms_lin
[
2
]
=
FAN_DEAD_WORD
;
}
else
{
frpms_lin
[
2
]
=
float_to_linear
(
tacho_rpm_prev
[
2
]);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment