Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
marlin-anet-a8
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
785143a0
Commit
785143a0
authored
10 years ago
by
Scott Lahteine
Browse files
Options
Downloads
Patches
Plain Diff
Expand on More RAM concept, address minor bugs
parent
0cbbba08
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Marlin/cardreader.cpp
+11
-6
11 additions, 6 deletions
Marlin/cardreader.cpp
with
11 additions
and
6 deletions
Marlin/cardreader.cpp
+
11
−
6
View file @
785143a0
...
...
@@ -11,7 +11,7 @@
CardReader
::
CardReader
()
{
#if SORT_USES_MORE_RAM
#if
defined(SDCARD_SORT_ALPHA) &&
SORT_USES_MORE_RAM
sortnames
=
NULL
;
sort_count
=
0
;
#endif
...
...
@@ -558,6 +558,13 @@ void CardReader::closefile(bool store_location)
void
CardReader
::
getfilename
(
const
uint8_t
nr
)
{
#if defined(SDCARD_SORT_ALPHA) && SORT_USES_MORE_RAM
if
(
nr
<
sort_count
)
{
strcpy
(
diveFilename
,
sortnames
[
nr
]);
return
;
}
#endif
curDir
=&
workDir
;
lsAction
=
LS_GetFilename
;
nrFiles
=
nr
;
...
...
@@ -642,9 +649,7 @@ void CardReader::getfilename_sorted(const uint8_t nr) {
*/
void
CardReader
::
presort
()
{
#if SORT_USES_MORE_RAM
flush_presort
();
#endif
uint16_t
fileCnt
=
getnrfilenames
();
if
(
fileCnt
>
0
)
{
...
...
@@ -652,7 +657,7 @@ void CardReader::presort()
if
(
fileCnt
>
SORT_LIMIT
)
fileCnt
=
SORT_LIMIT
;
#if SORT_USES_MORE_RAM
sortnames
=
malloc
(
fileCnt
*
sizeof
(
char
*
));
sortnames
=
(
char
**
)
malloc
(
fileCnt
*
sizeof
(
char
*
));
sort_count
=
fileCnt
;
#elif SORT_USES_RAM
char
*
sortnames
[
fileCnt
];
...
...
@@ -748,7 +753,7 @@ void CardReader::flush_presort() {
#endif
}
#endif
#endif
// SDCARD_SORT_ALPHA
void
CardReader
::
printingHasFinished
()
{
...
...
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