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
d344f75a
Commit
d344f75a
authored
Feb 07, 2016
by
MagoKimbra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cardreader.cpp
parent
dcca8c7e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
41 deletions
+9
-41
MK_Main.cpp
MK/module/MK_Main.cpp
+4
-13
cardreader.cpp
MK/module/sd/cardreader.cpp
+5
-28
No files found.
MK/module/MK_Main.cpp
View file @
d344f75a
...
@@ -5621,16 +5621,9 @@ inline void gcode_M220() {
...
@@ -5621,16 +5621,9 @@ inline void gcode_M220() {
* M221: Set extrusion percentage (M221 T0 S95)
* M221: Set extrusion percentage (M221 T0 S95)
*/
*/
inline
void
gcode_M221
()
{
inline
void
gcode_M221
()
{
if
(
code_seen
(
'S'
))
{
int
sval
=
code_value
();
if
(
code_seen
(
'T'
))
{
if
(
setTargetedExtruder
(
221
))
return
;
if
(
setTargetedExtruder
(
221
))
return
;
extruder_multiplier
[
target_extruder
]
=
sval
;
}
if
(
code_seen
(
'S'
))
extruder_multiplier
[
target_extruder
]
=
code_value
();
else
{
extruder_multiplier
[
active_extruder
]
=
sval
;
}
}
}
}
/**
/**
...
@@ -5639,9 +5632,7 @@ inline void gcode_M221() {
...
@@ -5639,9 +5632,7 @@ inline void gcode_M221() {
inline
void
gcode_M222
()
{
inline
void
gcode_M222
()
{
if
(
setTargetedExtruder
(
222
))
return
;
if
(
setTargetedExtruder
(
222
))
return
;
if
(
code_seen
(
'S'
))
{
if
(
code_seen
(
'S'
))
density_multiplier
[
target_extruder
]
=
code_value
();
density_multiplier
[
target_extruder
]
=
code_value
();
}
}
}
/**
/**
...
...
MK/module/sd/cardreader.cpp
View file @
d344f75a
...
@@ -99,8 +99,9 @@ void CardReader::lsDive(const char* prepend, SdFile parent, const char* const ma
...
@@ -99,8 +99,9 @@ void CardReader::lsDive(const char* prepend, SdFile parent, const char* const ma
nrFiles
++
;
nrFiles
++
;
break
;
break
;
case
LS_SerialPrint
:
case
LS_SerialPrint
:
createFilename
(
filename
,
p
);
ECHO_T
(
prepend
);
ECHO_T
(
prepend
);
ECHO_ET
(
longF
ilename
);
ECHO_ET
(
f
ilename
);
break
;
break
;
case
LS_GetFilename
:
case
LS_GetFilename
:
createFilename
(
filename
,
p
);
createFilename
(
filename
,
p
);
...
@@ -328,39 +329,15 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/,
...
@@ -328,39 +329,15 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/,
else
// relative path
else
// relative path
curDir
=
&
workDir
;
curDir
=
&
workDir
;
char
newName
[
FILENAME_LENGTH
+
2
];
if
(
strlen
((
char
*
)
fname
)
>=
9
)
{
// Generate 8.3 from longfile name
char
*
pExt
,
szExt
[
5
];
if
((
pExt
=
strchr
((
char
*
)
fname
,
'.'
))
!=
NULL
)
{
strncpy
(
szExt
,
pExt
,
4
);
szExt
[
4
]
=
0
;
if
(
pExt
>
(
char
*
)
fname
+
6
)
pExt
=
(
char
*
)
fname
+
6
;
}
else
{
szExt
[
0
]
=
0
;
pExt
=
(
char
*
)
fname
+
6
;
}
uint8_t
cb
=
pExt
-
(
char
*
)
fname
;
memcpy
(
newName
,
fname
,
cb
);
newName
[
cb
]
=
0
;
strcat
(
newName
,
"~1"
);
strcat
(
newName
,
szExt
);
}
else
{
memcpy
(
newName
,
fname
,
FILENAME_LENGTH
+
2
);
}
if
(
read
)
{
if
(
read
)
{
if
(
file
.
open
(
curDir
,
newN
ame
,
O_READ
))
{
if
(
file
.
open
(
curDir
,
fn
ame
,
O_READ
))
{
filesize
=
file
.
fileSize
();
filesize
=
file
.
fileSize
();
ECHO_MT
(
SERIAL_SD_FILE_OPENED
,
fname
);
ECHO_MT
(
SERIAL_SD_FILE_OPENED
,
fname
);
ECHO_EMV
(
SERIAL_SD_SIZE
,
filesize
);
ECHO_EMV
(
SERIAL_SD_SIZE
,
filesize
);
sdpos
=
0
;
sdpos
=
0
;
ECHO_EM
(
SERIAL_SD_FILE_SELECTED
);
ECHO_EM
(
SERIAL_SD_FILE_SELECTED
);
getfilename
(
0
,
newN
ame
);
getfilename
(
0
,
fn
ame
);
if
(
lcd_status
)
lcd_setstatus
(
longFilename
[
0
]
?
longFilename
:
fname
);
if
(
lcd_status
)
lcd_setstatus
(
longFilename
[
0
]
?
longFilename
:
fname
);
}
}
else
{
else
{
...
@@ -368,7 +345,7 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/,
...
@@ -368,7 +345,7 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/,
}
}
}
}
else
{
//write
else
{
//write
if
(
!
file
.
open
(
curDir
,
newN
ame
,
O_CREAT
|
O_APPEND
|
O_WRITE
|
O_TRUNC
))
{
if
(
!
file
.
open
(
curDir
,
fn
ame
,
O_CREAT
|
O_APPEND
|
O_WRITE
|
O_TRUNC
))
{
ECHO_LMT
(
ER
,
SERIAL_SD_OPEN_FILE_FAIL
,
fname
);
ECHO_LMT
(
ER
,
SERIAL_SD_OPEN_FILE_FAIL
,
fname
);
}
}
else
{
else
{
...
...
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