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
43a5e682
Commit
43a5e682
authored
May 07, 2016
by
MagoKimbra
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'refs/remotes/origin/master' into dev
parents
292cd03a
a2c58bb2
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
77 additions
and
42 deletions
+77
-42
language_an.h
MK/module/language/language_an.h
+1
-0
language_bg.h
MK/module/language/language_bg.h
+1
-0
language_ca.h
MK/module/language/language_ca.h
+1
-0
language_cn.h
MK/module/language/language_cn.h
+1
-0
language_da.h
MK/module/language/language_da.h
+1
-0
language_de.h
MK/module/language/language_de.h
+1
-0
language_en.h
MK/module/language/language_en.h
+1
-0
language_es.h
MK/module/language/language_es.h
+1
-0
language_eu.h
MK/module/language/language_eu.h
+1
-0
language_fi.h
MK/module/language/language_fi.h
+1
-0
language_fr.h
MK/module/language/language_fr.h
+1
-0
language_it.h
MK/module/language/language_it.h
+1
-0
language_kana.h
MK/module/language/language_kana.h
+1
-0
language_kana_utf8.h
MK/module/language/language_kana_utf8.h
+1
-0
language_nl.h
MK/module/language/language_nl.h
+1
-0
language_pl.h
MK/module/language/language_pl.h
+1
-0
language_pt-br.h
MK/module/language/language_pt-br.h
+1
-0
language_pt.h
MK/module/language/language_pt.h
+1
-0
language_ru.h
MK/module/language/language_ru.h
+1
-0
temperature.cpp
MK/module/temperature/temperature.cpp
+47
-41
temperature.h
MK/module/temperature/temperature.h
+11
-1
No files found.
MK/module/language/language_an.h
View file @
43a5e682
...
@@ -74,6 +74,7 @@
...
@@ -74,6 +74,7 @@
#define MSG_PID_P "PID-P"
#define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I"
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_H1 " H1"
#define MSG_H1 " H1"
#define MSG_H2 " H2"
#define MSG_H2 " H2"
#define MSG_H3 " H3"
#define MSG_H3 " H3"
...
...
MK/module/language/language_bg.h
View file @
43a5e682
...
@@ -74,6 +74,7 @@
...
@@ -74,6 +74,7 @@
#define MSG_PID_P "PID-P"
#define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I"
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_H1 " H1"
#define MSG_H1 " H1"
#define MSG_H2 " H2"
#define MSG_H2 " H2"
#define MSG_H3 " H3"
#define MSG_H3 " H3"
...
...
MK/module/language/language_ca.h
View file @
43a5e682
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
#define MSG_PID_P "PID-P"
#define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I"
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_H1 " H1"
#define MSG_H1 " H1"
#define MSG_H2 " H2"
#define MSG_H2 " H2"
#define MSG_H3 " H3"
#define MSG_H3 " H3"
...
...
MK/module/language/language_cn.h
View file @
43a5e682
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
#define MSG_PID_P "PID-P"
#define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I"
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_H1 " H1"
#define MSG_H1 " H1"
#define MSG_H2 " H2"
#define MSG_H2 " H2"
#define MSG_H3 " H3"
#define MSG_H3 " H3"
...
...
MK/module/language/language_da.h
View file @
43a5e682
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
#define MSG_PID_P "PID-P"
#define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I"
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_H1 " H1"
#define MSG_H1 " H1"
#define MSG_H2 " H2"
#define MSG_H2 " H2"
#define MSG_H3 " H3"
#define MSG_H3 " H3"
...
...
MK/module/language/language_de.h
View file @
43a5e682
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
#define MSG_PID_P "PID-P"
#define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I"
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_H1 " H1"
#define MSG_H1 " H1"
#define MSG_H2 " H2"
#define MSG_H2 " H2"
#define MSG_H3 " H3"
#define MSG_H3 " H3"
...
...
MK/module/language/language_en.h
View file @
43a5e682
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
#define MSG_PID_P "PID-P"
#define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I"
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_H1 " H1"
#define MSG_H1 " H1"
#define MSG_H2 " H2"
#define MSG_H2 " H2"
#define MSG_H3 " H3"
#define MSG_H3 " H3"
...
...
MK/module/language/language_es.h
View file @
43a5e682
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
#define MSG_PID_P "PID-P"
#define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I"
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_H1 " H1"
#define MSG_H1 " H1"
#define MSG_H2 " H2"
#define MSG_H2 " H2"
#define MSG_H3 " H3"
#define MSG_H3 " H3"
...
...
MK/module/language/language_eu.h
View file @
43a5e682
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
#define MSG_PID_P "PID-P"
#define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I"
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_H1 " H1"
#define MSG_H1 " H1"
#define MSG_H2 " H2"
#define MSG_H2 " H2"
#define MSG_H3 " H3"
#define MSG_H3 " H3"
...
...
MK/module/language/language_fi.h
View file @
43a5e682
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
#define MSG_PID_P "PID-P"
#define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I"
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_H1 " H1"
#define MSG_H1 " H1"
#define MSG_H2 " H2"
#define MSG_H2 " H2"
#define MSG_H3 " H3"
#define MSG_H3 " H3"
...
...
MK/module/language/language_fr.h
View file @
43a5e682
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
#define MSG_PID_P "PID-P"
#define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I"
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_H1 " H1"
#define MSG_H1 " H1"
#define MSG_H2 " H2"
#define MSG_H2 " H2"
#define MSG_H3 " H3"
#define MSG_H3 " H3"
...
...
MK/module/language/language_it.h
View file @
43a5e682
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
#define MSG_PID_P "PID-P"
#define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I"
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_H1 " H1"
#define MSG_H1 " H1"
#define MSG_H2 " H2"
#define MSG_H2 " H2"
#define MSG_H3 " H3"
#define MSG_H3 " H3"
...
...
MK/module/language/language_kana.h
View file @
43a5e682
...
@@ -75,6 +75,7 @@
...
@@ -75,6 +75,7 @@
#define MSG_PID_P "PID-P"
#define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I"
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_H1 " H1"
#define MSG_H1 " H1"
#define MSG_H2 " H2"
#define MSG_H2 " H2"
#define MSG_H3 " H3"
#define MSG_H3 " H3"
...
...
MK/module/language/language_kana_utf8.h
View file @
43a5e682
...
@@ -78,6 +78,7 @@
...
@@ -78,6 +78,7 @@
#define MSG_PID_P "PID-P"
#define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I"
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_H1 " H1"
#define MSG_H1 " H1"
#define MSG_H2 " H2"
#define MSG_H2 " H2"
#define MSG_H3 " H3"
#define MSG_H3 " H3"
...
...
MK/module/language/language_nl.h
View file @
43a5e682
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
#define MSG_PID_P "PID-P"
#define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I"
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_H1 " H1"
#define MSG_H1 " H1"
#define MSG_H2 " H2"
#define MSG_H2 " H2"
#define MSG_H3 " H3"
#define MSG_H3 " H3"
...
...
MK/module/language/language_pl.h
View file @
43a5e682
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
#define MSG_PID_P "PID-P"
#define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I"
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_H1 " H1"
#define MSG_H1 " H1"
#define MSG_H2 " H2"
#define MSG_H2 " H2"
#define MSG_H3 " H3"
#define MSG_H3 " H3"
...
...
MK/module/language/language_pt-br.h
View file @
43a5e682
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
#define MSG_PID_P "PID-P"
#define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I"
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_H1 " H1"
#define MSG_H1 " H1"
#define MSG_H2 " H2"
#define MSG_H2 " H2"
#define MSG_H3 " H3"
#define MSG_H3 " H3"
...
...
MK/module/language/language_pt.h
View file @
43a5e682
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
#define MSG_PID_P "PID-P"
#define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I"
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_H1 " H1"
#define MSG_H1 " H1"
#define MSG_H2 " H2"
#define MSG_H2 " H2"
#define MSG_H3 " H3"
#define MSG_H3 " H3"
...
...
MK/module/language/language_ru.h
View file @
43a5e682
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
#define MSG_PID_P "PID-P"
#define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I"
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_H1 " H1"
#define MSG_H1 " H1"
#define MSG_H2 " H2"
#define MSG_H2 " H2"
#define MSG_H3 " H3"
#define MSG_H3 " H3"
...
...
MK/module/temperature/temperature.cpp
View file @
43a5e682
...
@@ -100,14 +100,15 @@ unsigned char soft_pwm_bed;
...
@@ -100,14 +100,15 @@ unsigned char soft_pwm_bed;
enum
TRState
{
TRReset
,
TRInactive
,
TRFirstHeating
,
TRStable
,
TRRunaway
};
enum
TRState
{
TRReset
,
TRInactive
,
TRFirstHeating
,
TRStable
,
TRRunaway
};
void
thermal_runaway_protection
(
TRState
*
state
,
millis_t
*
timer
,
float
temperature
,
float
target_temperature
,
int
heater_id
,
int
period_seconds
,
int
hysteresis_degc
);
void
thermal_runaway_protection
(
TRState
*
state
,
millis_t
*
timer
,
float
temperature
,
float
target_temperature
,
int
heater_id
,
int
period_seconds
,
int
hysteresis_degc
);
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
static
TRState
thermal_runaway_state_machine
[
4
]
=
{
TRReset
,
TRReset
,
TRReset
,
TRReset
};
static
TRState
thermal_runaway_state_machine
[
HOTENDS
]
=
{
TRReset
};
static
millis_t
thermal_runaway_timer
[
4
];
// = {0,0,0,0
};
static
millis_t
thermal_runaway_timer
[
HOTENDS
]
=
{
0
};
#endif
#endif
#if ENABLED(THERMAL_PROTECTION_BED) && TEMP_SENSOR_BED != 0
#if ENABLED(THERMAL_PROTECTION_BED) && TEMP_SENSOR_BED != 0
static
TRState
thermal_runaway_bed_state_machine
=
TRReset
;
static
TRState
thermal_runaway_bed_state_machine
=
TRReset
;
static
millis_t
thermal_runaway_bed_timer
;
static
millis_t
thermal_runaway_bed_timer
;
#endif
#endif
#endif
#endif
#if HAS(POWER_CONSUMPTION_SENSOR)
#if HAS(POWER_CONSUMPTION_SENSOR)
int
current_raw_powconsumption
=
0
;
//Holds measured power consumption
int
current_raw_powconsumption
=
0
;
//Holds measured power consumption
static
unsigned
long
raw_powconsumption_value
=
0
;
static
unsigned
long
raw_powconsumption_value
=
0
;
...
@@ -1321,6 +1322,9 @@ void disable_all_heaters() {
...
@@ -1321,6 +1322,9 @@ void disable_all_heaters() {
for
(
int
i
=
0
;
i
<
HOTENDS
;
i
++
)
setTargetHotend
(
0
,
i
);
for
(
int
i
=
0
;
i
<
HOTENDS
;
i
++
)
setTargetHotend
(
0
,
i
);
setTargetBed
(
0
);
setTargetBed
(
0
);
// If all heaters go down then for sure our print job has stopped
print_job_timer
.
stop
();
#define DISABLE_HEATER(NR) { \
#define DISABLE_HEATER(NR) { \
target_temperature[NR] = 0; \
target_temperature[NR] = 0; \
soft_pwm[NR] = 0; \
soft_pwm[NR] = 0; \
...
@@ -1355,59 +1359,61 @@ void disable_all_heaters() {
...
@@ -1355,59 +1359,61 @@ void disable_all_heaters() {
}
}
#if ENABLED(HEATER_0_USES_MAX6675)
#if ENABLED(HEATER_0_USES_MAX6675)
#define MAX6675_HEAT_INTERVAL 250u
#define MAX6675_HEAT_INTERVAL 250u
static
millis_t
next_max6675_ms
=
0
;
int
max6675_temp
=
2000
;
static
int
read_max6675
()
{
#if ENABLED(MAX6675_IS_MAX31855)
uint32_t
max6675_temp
=
2000
;
#define MAX6675_ERROR_MASK 7
#define MAX6675_DISCARD_BITS 18
#else
uint16_t
max6675_temp
=
2000
;
#define MAX6675_ERROR_MASK 4
#define MAX6675_DISCARD_BITS 3
#endif
millis_t
ms
=
millis
();
int
Temperature
::
read_max6675
()
{
if
(
ms
<
next_max6675_ms
)
static
millis_t
next_max6675_ms
=
0
;
return
max6675_temp
;
next_max6675_ms
=
ms
+
MAX6675_HEAT_INTERVAL
;
millis_t
ms
=
millis
()
;
max6675_temp
=
0
;
if
(
PENDING
(
ms
,
next_max6675_ms
))
return
(
int
)
max6675_temp
;
#ifdef PRR
next_max6675_ms
=
ms
+
MAX6675_HEAT_INTERVAL
;
CBI
(
PRR
,
PRSPI
);
#elif defined(PRR0)
CBI
(
PRR0
,
PRSPI
);
#endif
CBI
(
#ifdef PRR
PRR
#elif defined(PRR0)
PRR0
#endif
,
PRSPI
);
SPCR
=
_BV
(
MSTR
)
|
_BV
(
SPE
)
|
_BV
(
SPR0
);
SPCR
=
_BV
(
MSTR
)
|
_BV
(
SPE
)
|
_BV
(
SPR0
);
// enable TT_MAX6675
WRITE
(
MAX6675_SS
,
0
);
// enable TT_MAX6675
WRITE
(
MAX6675_SS
,
0
);
// ensure 100ns delay - a bit extra is fine
// ensure 100ns delay - a bit extra is fine
asm
(
"nop"
);
// 50ns on 20Mhz, 62.5ns on 16Mhz
asm
(
"nop"
);
//50ns on 20Mhz, 62.5ns on 16Mhz
asm
(
"nop"
);
// 50ns on 20Mhz, 62.5ns on 16Mhz
asm
(
"nop"
);
//50ns on 20Mhz, 62.5ns on 16Mhz
// read MSB
// Read a big-endian temperature value
SPDR
=
0
;
max6675_temp
=
0
;
for
(;
!
TEST
(
SPSR
,
SPIF
););
for
(
uint8_t
i
=
sizeof
(
max6675_temp
);
i
--
;)
{
max6675_temp
=
SPDR
;
SPDR
=
0
;
max6675_temp
<<=
8
;
for
(;
!
TEST
(
SPSR
,
SPIF
););
max6675_temp
|=
SPDR
;
// read LSB
if
(
i
>
0
)
max6675_temp
<<=
8
;
// shift left if not the last byte
SPDR
=
0
;
for
(;
!
TEST
(
SPSR
,
SPIF
););
max6675_temp
|=
SPDR
;
// disable TT_MAX6675
WRITE
(
MAX6675_SS
,
1
);
if
(
max6675_temp
&
4
)
{
// thermocouple open
max6675_temp
=
4000
;
}
else
{
max6675_temp
=
max6675_temp
>>
3
;
}
}
return
max6675_temp
;
WRITE
(
MAX6675_SS
,
1
);
// disable TT_MAX6675
if
(
max6675_temp
&
MAX6675_ERROR_MASK
)
max6675_temp
=
4000
;
// thermocouple open
else
max6675_temp
>>=
MAX6675_DISCARD_BITS
;
return
(
int
)
max6675_temp
;
}
}
#endif // HEATER_0_USES_MAX6675
#endif // HEATER_0_USES_MAX6675
...
...
MK/module/temperature/temperature.h
View file @
43a5e682
...
@@ -127,13 +127,23 @@ FORCE_INLINE float degTargetBed() { return target_temperature_bed; }
...
@@ -127,13 +127,23 @@ FORCE_INLINE float degTargetBed() { return target_temperature_bed; }
void
start_watching_heater
(
int
h
=
0
);
void
start_watching_heater
(
int
h
=
0
);
#endif
#endif
#if ENABLED(THERMAL_PROTECTION_BED)
void
start_watching_bed
();
#endif
FORCE_INLINE
void
setTargetHotend
(
const
float
&
celsius
,
uint8_t
hotend
)
{
FORCE_INLINE
void
setTargetHotend
(
const
float
&
celsius
,
uint8_t
hotend
)
{
target_temperature
[
HOTEND_ARG
]
=
celsius
;
target_temperature
[
HOTEND_ARG
]
=
celsius
;
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
start_watching_heater
(
HOTEND_ARG
);
start_watching_heater
(
HOTEND_ARG
);
#endif
#endif
}
}
FORCE_INLINE
void
setTargetBed
(
const
float
&
celsius
)
{
target_temperature_bed
=
celsius
;
}
FORCE_INLINE
void
setTargetBed
(
const
float
&
celsius
)
{
target_temperature_bed
=
celsius
;
#if ENABLED(THERMAL_PROTECTION_BED)
start_watching_bed
();
#endif
}
FORCE_INLINE
bool
isHeatingHotend
(
uint8_t
hotend
)
{
return
target_temperature
[
HOTEND_ARG
]
>
current_temperature
[
HOTEND_ARG
];
}
FORCE_INLINE
bool
isHeatingHotend
(
uint8_t
hotend
)
{
return
target_temperature
[
HOTEND_ARG
]
>
current_temperature
[
HOTEND_ARG
];
}
FORCE_INLINE
bool
isHeatingBed
()
{
return
target_temperature_bed
>
current_temperature_bed
;
}
FORCE_INLINE
bool
isHeatingBed
()
{
return
target_temperature_bed
>
current_temperature_bed
;
}
...
...
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