Commit Graph

44 Commits

Author SHA1 Message Date
D.R.racer
7011014abb Save 16 bytes - pass ls_param by value to functions
... as ls_param is a 1-byte structure it is more conservative to pass it
to functions by value than by a pointer
2021-04-20 06:50:37 +02:00
Voinea Dragos
2129bcf315 M20 T 2021-04-19 14:48:50 +03:00
Yuri D'Elia
23c75da727 Fix Crash/PP recovery position on instructions with comments
PR #2967 altered the way ``sdpos_atomic`` was set, causing issues in the
crashdetect/powerpanic recovery offset if the instruction being
recovered happens to contain a comment.

Previously ``sdpos`` was assumed to be a single byte prior to the last
read character. sdpos+1 would thus position the index to the next
instruction. With gcode-filtering in place, sdpos is left just before
the comment, while the actual read position is at the newline. This
causes to parser to resume in the middle of the comment.

Change the value returned by cardreader::get_sdpos() to always return
the last read position, as everybody expects (!!).

This avoids the +1, and correctly sets the resume position to the next
valid instruction without overhead.
2021-04-19 06:30:37 +02:00
Alex Voinea
28f21c8630
Fix bubblesort sorting speed. ShellSort is probably broken 2021-02-26 19:17:14 +02:00
Alex Voinea
1c1ff722c0
Move sort_order to stack during ::presort 2021-02-10 18:16:26 +02:00
Alex Voinea
b4de57c365
Merge branch 'MK3' into MK3_NEW_SD_COMPILATION 2021-02-10 17:08:28 +02:00
DRracer
7aa4595211
Merge branch 'MK3' into thumbnails2 2021-02-10 12:15:57 +01:00
D.R.racer
c1ead75a73 Remove commented debug code
the whole PR is ready for review after successfull tests
2021-02-10 11:18:59 +01:00
Alex Voinea
a830d5b6b7
getfilename_next 2021-02-09 20:31:02 +02:00
Alex Voinea
8d1c5cbb27
Fix position table offset 2021-02-09 20:29:06 +02:00
Alex Voinea
d2a7c62b50
Merge branch 'MK3' into MK3_NEW_SD_COMPILATION 2021-02-09 16:17:43 +02:00
Alex Voinea
c739aa9003 M23 full path support. 2021-02-07 21:51:44 +02:00
Voinea Dragos
52f7a71dce More fixes that were extracted from #2405 2021-02-06 14:59:11 +02:00
Alex Voinea
84d043d41b Fix WorkDirDepth limit (for good this time) 2021-02-04 17:52:42 +02:00
Alex Voinea
d25b4a6bc9 Remove dead code (SDSORT_GCODE) 2021-02-03 19:18:13 +02:00
Alex Voinea
e52e68d4c1 Merge branch 'MK3' into MK3_NEW_SD_COMPILATION 2021-02-03 18:30:36 +02:00
Alex Voinea
4c977cc335 Merge branch 'MK3' into MK3_NEW_SD_COMPILATION 2021-02-03 18:28:18 +02:00
Alex Voinea
5c9d202871 Change MAX_DIR_DEPTH from 10 to 6
You can't run M23 with so many directories as the length of the command will exceed the maximum allowed by cmdqueue
2021-02-02 19:08:19 +02:00
Alex Voinea
b6d56bc0f4 Change M27 argument from L to P as that makes more sense (path vs LFN)) 2021-02-01 14:54:37 +02:00
Voinea Dragos
6b6205d2f6 M27 refactoring and M27 L initial implementation 2021-01-31 15:06:20 +02:00
D.R.racer
7279de7403 Separate reading G-code files and writing to a file
- extract common strings
- cleanup openFileWrite and openFileReadFilteredGcode formatting a bit
Alltogether - code size 400B down
2021-01-28 09:37:58 +01:00
D.R.racer
d275fe0e83 Extract gcode filter from SdBaseFile into SdFile + optimization
- Start saving instructions as the whole PR was >1KB long.
- It turned out the compiler was unable to understand the core skipping
cycle and an ASM version had to be used.
- Add seekSet aware of the G-code filter
2021-01-27 09:33:28 +01:00
D.R.racer
c3758d350e Fast skipping of large comment blocks
This is an extension/optimization of PR #2956.
It uses the cached 512B block buffer to avoid heavy-weight read() in SdBaseFile.
Even though this principle allowed the AVR to skip ~600KB of data within ~5 seconds,
the impact on code base is huge, especially into well proven and long-term stable
parts like reading a file from the SD card.

The sole purpose of this PR is to show/verify the possibility of the AVR CPU
in relation to adding thumbnails into MK3 G-codes.
Moreover, this PR shall not be merged unless the missing/commented features
are restored - especially file seeking and M84 search.

PFW-1175
2021-01-27 07:03:51 +01:00
Voinea Dragos
ced3d9fa77 "M20 L" support. Print long filenames 2021-01-22 11:13:44 +02:00
Alex Voinea
4670c42aeb
Merge branch 'MK3' into MK3_NEW_SD_COMPILATION 2020-03-26 18:17:26 +02:00
DRracer
f234ef2104 Use combined creation/modification file time stamps for sorting 2020-02-14 09:09:15 +01:00
Alex Voinea
f0f7db57ea
Fist attempt at "saved position SD menu" 2019-12-17 00:45:25 +02:00
Yuri D'Elia
dbe2ed4150 Fix pause/resume when using M25/M601
Remove the conflicting and mostly useless card.paused flag (the printing
is either paused, or not) and switch to isPrintPaused only which
accounts for both cases (SD/USB) correctly.

Fix M27/getStatus to show the current real status of the SD print.

Synchronize the queue on M601, as required to precisely pause the print
at the correct instruction.

Alias M25 to M601, which when combined with PR #1899 fixes issue #1614.

Guard against incorrect usage in M601, M602 and M603.
2019-11-28 17:37:58 +01:00
Paul Bransford
720ea49fa3 Merge branch 'MK3' into MK3-fix-sdcard-sorting 2019-08-08 19:48:50 -04:00
MRprusa3d
a408f90659 recovery from "Stop()" 2019-05-18 21:28:59 +02:00
Paul Bransford
863c7158b2 use modification times for sdcard sort 2019-04-16 06:24:47 -04:00
Marek Bel
2e719c7885 Fix stack corruption for folder name longer than 12 characters. Save 260B of flash memory. Move duplicate code to separate method. Fix compiler warnings: sketch/cardreader.cpp:448:25: warning: ordered comparison of pointer with integer zero [-Wextra]
sketch/cardreader.cpp:453:22: warning: ordered comparison of pointer with integer zero [-Wextra]
2018-08-07 12:52:51 +02:00
Petr Ledvina
baddf38dbc Make card filename const
Fixes warning in filename_wldsd
2018-07-17 17:55:05 +02:00
3d-gussner
d8706be8de Fixed forgotten comment 2018-05-30 13:39:24 +02:00
Robert Pelnar
e2e48bfd71 SD speed test (DEBUG)
homeaxis - fix set_destination_to_current
2018-02-20 18:50:20 +01:00
Robert Pelnar
1a01282e33 cardreader - new member "paused"
tmc2130 - decreased crash sensitivity for Y
2018-01-31 15:20:27 +01:00
PavelSindler
1c61f2f29c First working version 2017-12-11 11:30:49 +01:00
PavelSindler
26135ea227 all sd sort files: initial version; sorting type switch not added to SD card menu itself 2017-12-10 11:08:50 +01:00
PavelSindler
44218a1b53 incomplete file check ported from MK2: initial version 2017-12-06 14:55:53 +01:00
PavelSindler
42b533b5d8 first working version 2017-11-27 06:20:51 +01:00
PavelSindler
17074e1d25 saving/restoring filename and current position in bytes to eeprom, UVLO changed 2017-07-02 21:01:23 +02:00
michalprusa
3faef75a0d 3.0.10 sync 2017-03-24 19:47:50 +01:00
michalprusa
307d17422d 3.0.6 sync 2016-08-11 10:42:53 +02:00
michalprusa
30f0528aba Initial commit 2016-07-22 15:28:01 +02:00