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
315cf588
Commit
315cf588
authored
May 21, 2016
by
MagoKimbra
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'refs/remotes/origin/master' into dev
parents
62b0e7f2
e30b5fb7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
30 deletions
+37
-30
Configuration_Store.cpp
MK/Configuration_Store.cpp
+30
-24
MK_Main.cpp
MK/module/MK_Main.cpp
+5
-4
ultralcd_implementation_hitachi_HD44780.h
MK/module/lcd/ultralcd_implementation_hitachi_HD44780.h
+1
-1
printcounter.cpp
MK/module/printcounter/printcounter.cpp
+1
-1
No files found.
MK/Configuration_Store.cpp
View file @
315cf588
...
...
@@ -933,20 +933,20 @@ void ConfigSD_ResetDefault() {
card
.
setroot
(
true
);
card
.
startWrite
((
char
*
)
CFG_SD_FILE
,
false
);
char
buff
[
CFG_SD_MAX_VALUE_LEN
];
ltoa
(
print_job_counter
.
data
.
completePrints
,
buff
,
10
);
card
.
unparseKeyLine
(
cfgSD_KEY
[
SD_CFG_CPR
],
buff
);
ltoa
(
print_job_counter
.
data
.
printer_usage_filament
,
buff
,
10
);
card
.
unparseKeyLine
(
cfgSD_KEY
[
SD_CFG_FIL
],
buff
);
ltoa
(
print_job_counter
.
data
.
numberPrints
,
buff
,
10
);
card
.
unparseKeyLine
(
cfgSD_KEY
[
SD_CFG_NPR
],
buff
);
#if HAS(POWER_CONSUMPTION_SENSOR)
ltoa
(
power_consumption_hour
,
buff
,
10
);
card
.
unparseKeyLine
(
cfgSD_KEY
[
SD_CFG_PWR
],
buff
);
#endif
ltoa
(
print_job_counter
.
data
.
numberPrints
,
buff
,
10
);
card
.
unparseKeyLine
(
cfgSD_KEY
[
SD_CFG_NPR
],
buff
);
ltoa
(
print_job_counter
.
data
.
completePrints
,
buff
,
10
);
card
.
unparseKeyLine
(
cfgSD_KEY
[
SD_CFG_CPR
],
buff
);
ltoa
(
print_job_counter
.
data
.
printTime
,
buff
,
10
);
card
.
unparseKeyLine
(
cfgSD_KEY
[
SD_CFG_TPR
],
buff
);
ltoa
(
print_job_counter
.
data
.
printer_usage_seconds
,
buff
,
10
);
card
.
unparseKeyLine
(
cfgSD_KEY
[
SD_CFG_TME
],
buff
);
ltoa
(
print_job_counter
.
data
.
print
er_usage_filament
,
buff
,
10
);
card
.
unparseKeyLine
(
cfgSD_KEY
[
SD_CFG_
FIL
],
buff
);
ltoa
(
print_job_counter
.
data
.
print
Time
,
buff
,
10
);
card
.
unparseKeyLine
(
cfgSD_KEY
[
SD_CFG_
TPR
],
buff
);
card
.
closeFile
();
card
.
setlast
();
...
...
@@ -966,44 +966,48 @@ void ConfigSD_ResetDefault() {
k_len
=
CFG_SD_MAX_KEY_LEN
;
v_len
=
CFG_SD_MAX_VALUE_LEN
;
card
.
parseKeyLine
(
key
,
value
,
k_len
,
v_len
);
if
(
k_len
==
0
||
v_len
==
0
)
break
;
// no valid key or value founded
k_idx
=
ConfigSD_KeyIndex
(
key
);
if
(
k_idx
==
-
1
)
continue
;
// unknow key ignore it
switch
(
k_idx
)
{
#if HAS(POWER_CONSUMPTION_SENSOR)
case
SD_CFG_PWR
:
{
if
(
addValue
)
power_consumption_hour
+=
(
unsigned
long
)
atol
(
value
);
else
power_consumption_hour
=
(
unsigned
long
)
atol
(
value
);
case
SD_CFG_CPR
:
{
if
(
addValue
)
print_job_counter
.
data
.
completePrints
+=
(
unsigned
long
)
atol
(
value
);
else
print_job_counter
.
data
.
completePrints
=
(
unsigned
long
)
atol
(
value
);
}
break
;
case
SD_CFG_FIL
:
{
if
(
addValue
)
print_job_counter
.
data
.
printer_usage_filament
+=
(
unsigned
long
)
atol
(
value
);
else
print_job_counter
.
data
.
printer_usage_filament
=
(
unsigned
long
)
atol
(
value
);
}
break
;
#endif
case
SD_CFG_NPR
:
{
if
(
addValue
)
print_job_counter
.
data
.
numberPrints
+=
(
unsigned
long
)
atol
(
value
);
else
print_job_counter
.
data
.
numberPrints
=
(
unsigned
long
)
atol
(
value
);
}
break
;
case
SD_CFG_CPR
:
{
if
(
addValue
)
print_job_counter
.
data
.
completePrints
+=
(
unsigned
long
)
atol
(
value
);
else
print_job_counter
.
data
.
completePrints
=
(
unsigned
long
)
atol
(
value
);
}
break
;
case
SD_CFG_TPR
:
{
if
(
addValue
)
print_job_counter
.
data
.
printTime
+=
(
unsigned
long
)
atol
(
value
);
else
print_job_counter
.
data
.
printTime
=
(
unsigned
long
)
atol
(
value
);
#if HAS(POWER_CONSUMPTION_SENSOR)
case
SD_CFG_PWR
:
{
if
(
addValue
)
power_consumption_hour
+=
(
unsigned
long
)
atol
(
value
);
else
power_consumption_hour
=
(
unsigned
long
)
atol
(
value
);
}
break
;
#endif
case
SD_CFG_TME
:
{
if
(
addValue
)
print_job_counter
.
data
.
printer_usage_seconds
+=
(
unsigned
long
)
atol
(
value
);
else
print_job_counter
.
data
.
printer_usage_seconds
=
(
unsigned
long
)
atol
(
value
);
}
break
;
case
SD_CFG_
FIL
:
{
if
(
addValue
)
print_job_counter
.
data
.
print
er_usage_filament
+=
(
unsigned
long
)
atol
(
value
);
else
print_job_counter
.
data
.
print
er_usage_filament
=
(
unsigned
long
)
atol
(
value
);
case
SD_CFG_
TPR
:
{
if
(
addValue
)
print_job_counter
.
data
.
print
Time
+=
(
unsigned
long
)
atol
(
value
);
else
print_job_counter
.
data
.
print
Time
=
(
unsigned
long
)
atol
(
value
);
}
break
;
}
}
card
.
closeFile
();
card
.
setlast
();
config_readed
=
true
;
...
...
@@ -1012,6 +1016,7 @@ void ConfigSD_ResetDefault() {
int
ConfigSD_KeyIndex
(
char
*
key
)
{
// At the moment a binary search algorithm is used for simplicity, if it will be necessary (Eg. tons of key), an hash search algorithm will be implemented.
int
begin
=
0
,
end
=
SD_CFG_END
-
1
,
middle
,
cond
;
while
(
begin
<=
end
)
{
middle
=
(
begin
+
end
)
/
2
;
cond
=
strcmp
(
cfgSD_KEY
[
middle
],
key
);
...
...
@@ -1019,6 +1024,7 @@ void ConfigSD_ResetDefault() {
else
if
(
cond
<
0
)
begin
=
middle
+
1
;
else
end
=
middle
-
1
;
}
return
-
1
;
}
...
...
MK/module/MK_Main.cpp
View file @
315cf588
...
...
@@ -1907,6 +1907,7 @@ inline void do_blocking_move_to_z(float z) { do_blocking_move_to(current_positio
for
(
int
y
=
0
;
y
<
AUTO_BED_LEVELING_GRID_POINTS
;
y
++
)
{
ECHO_S
(
DB
);
for
(
int
x
=
0
;
x
<
AUTO_BED_LEVELING_GRID_POINTS
;
x
++
)
{
if
(
bed_level
[
x
][
y
]
>=
0
)
ECHO_M
(
" "
);
ECHO_VM
(
bed_level
[
x
][
y
],
" "
,
3
);
}
ECHO_E
;
...
...
@@ -3118,10 +3119,10 @@ void gcode_get_destination() {
if
(
next_feedrate
>
0.0
)
feedrate
=
next_feedrate
;
}
if
(
code_seen
(
'P'
))
{
if
(
code_seen
(
'P'
))
destination
[
E_AXIS
]
=
(
code_value
()
*
density_multiplier
[
previous_extruder
]
/
100
)
+
current_position
[
E_AXIS
];
}
if
(
!
DEBUGGING
(
DRYRUN
))
print_job_counter
.
data
.
printer_usage_filament
+=
(
destination
[
E_AXIS
]
-
current_position
[
E_AXIS
]);
#if ENABLED(RFID_MODULE)
...
...
@@ -5423,7 +5424,7 @@ inline void gcode_M104() {
* stand by mode, for instance in a dual extruder setup, without affecting
* the running print timer.
*/
if
(
temp
<=
(
EXTRUDE_MINTEMP
)
/
2
)
{
if
(
temp
<=
(
EXTRUDE_MINTEMP
)
/
2
)
{
print_job_counter
.
stop
();
LCD_MESSAGEPGM
(
WELCOME_MSG
);
}
...
...
MK/module/lcd/ultralcd_implementation_hitachi_HD44780.h
View file @
315cf588
...
...
@@ -50,7 +50,7 @@ extern volatile uint8_t buttons; //an extended version of the last checked butt
#define EN_C (_BV(BLEN_C))
#endif
#if BUTTON_EXISTS(B
TN_B
ACK)
#if BUTTON_EXISTS(BACK)
#define BLEN_D 3
#define EN_D (_BV(BLEN_D))
#endif
...
...
MK/module/printcounter/printcounter.cpp
View file @
315cf588
...
...
@@ -55,7 +55,7 @@ void PrintCounter::showStats() {
ECHO_EV
(
this
->
data
.
numberPrints
-
this
->
data
.
completePrints
-
((
this
->
isRunning
()
||
this
->
isPaused
())
?
1
:
0
));
// Removes 1 from failures with an active counter
day
=
(
this
->
data
.
printTime
/
60
/
60
/
24
)
;
day
=
this
->
data
.
printTime
/
60
/
60
/
24
;
hours
=
(
this
->
data
.
printTime
/
60
/
60
)
%
24
;
minutes
=
(
this
->
data
.
printTime
/
60
)
%
60
;
...
...
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