Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MarlinKimbra
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
MarlinKimbra
Commits
2929f763
Commit
2929f763
authored
Mar 22, 2015
by
Simone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update temperature.cpp
parent
f07d5f18
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
temperature.cpp
MarlinKimbra/temperature.cpp
+4
-3
No files found.
MarlinKimbra/temperature.cpp
View file @
2929f763
...
@@ -1656,10 +1656,11 @@ ISR(TIMER0_COMPB_vect) {
...
@@ -1656,10 +1656,11 @@ ISR(TIMER0_COMPB_vect) {
case
Measure_POWCONSUMPTION
:
case
Measure_POWCONSUMPTION
:
#if HAS_POWER_CONSUMPTION_SENSOR
#if HAS_POWER_CONSUMPTION_SENSOR
// raw_powconsumption_value += ADC; //remove to use an IIR filter approach
// raw_powconsumption_value += ADC; //remove to use an IIR filter approach
if
(
ADC
>
512
)
{
//check that ADC is reading a voltage > 2.5 volts, otherwise don't take in the data.
if
(
ADC
<
(
POWER_ZERO
*
1023
)
/
5.0
)
{
//check that ADC is reading a voltage > POWER_ZERO volts.
raw_powconsumption_value
-=
(
raw_powconsumption_value
>>
7
);
//multiply raw_powconsumption_value by 127/128
ADC
+=
unsigned
long
((
POWER_ZERO
*
1023
)
/
5.0
);
raw_powconsumption_value
+=
((
unsigned
long
)
ADC
<<
7
);
//add new ADC reading
}
}
raw_powconsumption_value
-=
(
raw_powconsumption_value
>>
7
);
//multiply raw_powconsumption_value by 127/128
raw_powconsumption_value
+=
((
unsigned
long
)
ADC
<<
7
);
//add new ADC reading
#endif
#endif
temp_state
=
PrepareTemp_0
;
temp_state
=
PrepareTemp_0
;
temp_count
++
;
temp_count
++
;
...
...
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