Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
termostato_iot
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
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
andrea.tambani@studenti.unimi.it
termostato_iot
Commits
6de14865
Commit
6de14865
authored
Dec 16, 2023
by
tamba
Browse files
Options
Downloads
Patches
Plain Diff
thermo_task aggiornato
parent
a9724ef8
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
main/main.c
+5
-21
5 additions, 21 deletions
main/main.c
with
5 additions
and
21 deletions
main/main.c
+
5
−
21
View file @
6de14865
...
...
@@ -386,36 +386,20 @@ static void thermo_task()
localtime_r
(
&
raw
,
&
current_time_struct
);
/*
caso con programmazione oraria settimanale attiva,
verifica se l'ora corrente è compresa in un intervallo di programmazione
e se la temperatura corr
r
ente è inferiore alla temperatura desiderata
verifica se l'ora corrente è compresa in un intervallo di programmazione
o se la programmazione oraria è disattivata
e se la temperatura corrente è inferiore alla temperatura desiderata
, se necessario accende il riscaldamento
*/
if
(
main_switch
==
true
&&
prog_switch
==
true
&&
time_in_interval
(
&
current_time_struct
,
week_prog
[
current_time_struct
.
tm_wday
],
TIME_INTERVALS_PER_DAY
)
&&
current_temp
<
target_temp
)
if
(
main_switch
==
true
&&
((
prog_switch
==
true
&&
time_in_interval
(
&
current_time_struct
,
week_prog
[
current_time_struct
.
tm_wday
],
TIME_INTERVALS_PER_DAY
)
)
||
prog_switch
==
false
)
&&
current_temp
<
target_temp
)
{
gpio_set_level
(
RELAY
,
1
);
thermo_on
=
true
;
xEventGroupSetBits
(
global_variable_update_group
,
THERMO_STATUS_UPDATE_BIT_PUBLISHER_TASK
);
}
/*
caso con programmazione oraria settimanale disattivata, verifica solo se la temperatura corrrente è inferiore alla temperatura
desiderata
*/
else
if
(
main_switch
==
true
&&
prog_switch
==
false
&&
current_temp
<
target_temp
)
{
gpio_set_level
(
RELAY
,
1
);
thermo_on
=
true
;
xEventGroupSetBits
(
global_variable_update_group
,
THERMO_STATUS_UPDATE_BIT_PUBLISHER_TASK
);
}
//raggiungimento della temperatura desiderata più il delta (programmazione temporale attiva)
else
if
(
main_switch
==
true
&&
prog_switch
==
true
&&
time_in_interval
(
&
current_time_struct
,
week_prog
[
current_time_struct
.
tm_wday
],
TIME_INTERVALS_PER_DAY
)
&&
thermo_on
==
true
&&
current_temp
<=
(
target_temp
+
delta_temp
));
//raggiungimento della temperatura desiderata più il delta (programmazione temporale non attiva)
//raggiungimento della temperatura desiderata più il delta
else
if
(
main_switch
==
true
&&
prog_switch
==
false
&&
thermo_on
==
true
&&
current_temp
<=
(
target_temp
+
delta_temp
));
else
if
(
main_switch
==
true
&&
((
prog_switch
==
true
&&
time_in_interval
(
&
current_time_struct
,
week_prog
[
current_time_struct
.
tm_wday
],
TIME_INTERVALS_PER_DAY
))
||
prog_switch
==
false
)
&&
thermo_on
==
true
&&
current_temp
<=
(
target_temp
+
delta_temp
));
//sotto la temperatura di base il riscaldamento parte comunque
...
...
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