Commit graph

62 commits

Author SHA1 Message Date
Bob-the-Kuhn
76da81c1de minimize SD card reads when using SDCARD_SORT_ALPHA (Re-ARM board)
Because of the Re-ARM card's pinout there is only one SPI connected to
the RepRap Discount Full Graphic LCD display.  The LCD responds to ANY
SCK transitions no matter if it's enable is inactive.  The result is
garbage (usually bars) on the LCD display whenever there is SD card
activity.

This code minimizes this by only accessing the SD card when changing
directory levels if :
SDCARD_SORT_ALPHA is enabled
SDSORT_USES_RAM is true
SDSORT_CACHE_NAMES is true

The code changes result in file names being pulled from the ALPHA SORT
memory array rather than the SD card.

The code also gives the file count and file index functions their own
variables.  When they shared a common variable the index function
sometimes resulted in the file count being short by 1.

=======================================================================

cardreader.cpp & pins_RAMPS_RE_ARM.h changes

Added another condition to cardreader.cpp to enable getting file names
only from RAM.

pins_RAMPS_RE_ARM.h :
Added comments about the SD card accesses and the LCD display
Combined all versions into this one.
2017-08-31 18:23:44 -05:00
Thomas Moore
257b693ab0 Advanced pause fixes (#7518)
* Disallow filament change while paused

* Use kinematic movemements in pause_print and resume_print
2017-08-15 22:57:13 -05:00
Scott Lahteine
081bf1f879 Patch #else / #endif comments 2017-05-09 12:37:23 -05:00
Scott Lahteine
47f9883b0f Dynamic allocation for SDCARD_SORT_ALPHA 2017-02-14 21:37:25 -06:00
Scott Lahteine
a561bd5e3a New feature: SDCARD_SORT_ALPHA 2017-02-14 21:37:24 -06:00
Scott Lahteine
61932b859e Fix bug in CardReader::stopSDPrint
If the SD print is paused, it cannot be stopped
2016-08-12 03:21:10 -07:00
Scott Lahteine
b73203a0b7 Move some includes around to uncover missing deps 2016-08-02 19:37:46 -07:00
João Brázio
3ebad4e020 Moves all global enums to a central file 2016-07-19 14:31:09 +01:00
Scott Lahteine
bbf5b486c3 Add an SD Card stop function, use in ultralcd 2016-06-17 18:27:14 -07:00
Scott Lahteine
70d1d4de5f Small code spacing adjustments 2016-03-29 03:19:27 -07:00
Scott Lahteine
0385acea7a Fix workDirParents -> getAbsFilename relationship 2016-03-29 03:18:53 -07:00
Scott Lahteine
27d70599d4 Change openFile default to "not-push" instead of "do-replace" 2016-03-29 03:16:35 -07:00
Scott Lahteine
372f93cc7a Rename "filenames" to "proc_filenames" 2016-03-29 03:15:01 -07:00
Scott Lahteine
0da744b7b0 Further cleanup of comments, partial Doxygen-style
Following up on #3231
2016-03-25 00:45:56 -07:00
jbrazio
5e5d250832 Added gplv3 header to all Marlin files 2016-03-24 18:01:20 +00:00
Scott Lahteine
8fe7420310 Use a separate serial line buffer 2016-03-18 16:46:20 -07:00
Scott Lahteine
0c7f7ebcfb Styling adjustments (PR#2668 & PR#2670)
Keep "astyled" reformatting
2015-10-03 22:02:45 -05:00
Scott Lahteine
270c766de2 SDCARDDETECT -> SD_DETECT, added docs
- `SD_DETECT_PIN` replaces `SDCARDDETECT`
- `SD_DETECT_INVERTED` replaces `SDCARDDETECTINVERTED`
- Revise the description of `SD_DETECT_INVERTED`
- Add a note about the override of `SD_DETECT_INVERTED` in
`Conditionals.h`
2015-08-02 21:59:41 -05:00
Scott Lahteine
8d3b74cc6e Rename SDCARDDETECT to SDCARDDETECT_PIN
- Rename the pin so it can be tested with `PIN_EXISTS`
- Fix some incorrect tests for `SDCARDDETECT`
2015-08-02 21:34:13 -05:00
Scott Lahteine
58cfcd4239 Overridable Options - Part 5
Apply `ENABLED` / `DISABLED` macros to files needing only a small
number of changes.
2015-07-31 01:24:20 -05:00
Scott Lahteine
0f2c9bacfd M33 LONG_FILENAME_HOST_SUPPORT 2015-05-17 17:36:32 -07:00
Scott Lahteine
ccddc280be Apply three more commits 2015-04-12 22:47:44 -07:00
Scott Lahteine
f171656f8e Cleanup of cardreader.*
- Apply standards to cardreader.*
- Fix minor issues with cardreader.cpp
- Apply standards to some other stale regions
2015-03-02 07:06:01 -08:00
Scott Lahteine
03c9cb60e8 Rename lastnr to autostart_index and...
Replace instances of the number 13 with FILENAME_LENGTH where
appropriate.
2015-01-24 04:57:44 -08:00
daid
17de96ace7 Merge branch 'Marlin_v1' into revert-1154-sd_sorting
Conflicts:
	Marlin/cardreader.cpp
	Marlin/cardreader.h
2014-12-18 23:13:50 +01:00
Scott Lahteine
f21cce0b28 Rebase to Marlin_v1 2014-12-17 23:07:36 -08:00
alexborro
ab355a90d3 Revert "SD Sort and Buffer" 2014-12-17 14:50:59 -02:00
Scott Lahteine
6599adc184 Polish up a little... 2014-12-13 06:12:34 -08:00
Scott Lahteine
b6ffea612a Expand on More RAM concept, address minor bugs 2014-12-13 06:10:44 -08:00
Scott Lahteine
8196b36ad9 SD Card Alpha Sorting
First iteration of alphabetical sorting for SD cards, both
slow+efficient and fast+rammy. Option for folders to sort first, last,
or not at all.
2014-12-13 06:07:52 -08:00
Scott Lahteine
cf749dbeda Completed SORT_USES_MORE_RAM implementation
For the MORE_RAM option we need to buffer both the short and long
names, even though long names are sometimes redundant. Worst case, all
the names are max length. We can save some RAM by not storing these. We
could save more RAM by only storing the visible part of the long name.
2014-12-13 06:03:39 -08:00
Scott Lahteine
ae081d0fe0 Improvements, more SORT_USES_MORE_RAM
With this option, always keeps the dir in RAM, doubling as a cache for
getfilename. A board with only 8K of SRAM is cutting it very close.
2014-12-13 06:03:39 -08:00
Scott Lahteine
0cbbba08bd SD Card Alpha Sorting
First iteration of alphabetical sorting for SD cards, both
slow+efficient and fast+rammy. Option for folders to sort first, last,
or not at all.
2014-12-13 06:03:39 -08:00
bkubicek
39d88bcccb preparation for hibernation
If a print is stopped, it would be nice in the future to write a file with the printer state, the filename of the print, and the position within the print.
this file could be read, to continue a previously stopped print.
not finished yet.
2013-10-22 10:04:08 +02:00
bkubicek
ab965376ff Sub-file calls.
by overloading M32 it is now possible to execute gcode files from other gcode files, with a fixed recursion level.
This can be used e.g. for having a real start.g and end.g somewhere on the sd card, which are then called from the normal print file.
Another usecase would be to have macro-files for nozzle-change and layerchange.
I have not tested the speedwise performance. The testing was done with pronterface.

syntax:
normal call from sd card will open the new file and continue executing there.
M32 !/path/filename#
this however will call the new file and return to the caller file.
M32 P !/path/filename#
with the optional "S<position>" the  file starting position can be set.
this is for continuing prints from a previous location.
2013-10-22 10:02:18 +02:00
Scott Lahteine
a5cd582665 Support for 10 level deep SD folder hierarchy 2013-05-04 04:18:02 -07:00
Bart K
4fa2260a59 Fixed cardreader.h to resolve issue #440 (Pull Request #425 missing file) 2013-03-31 19:59:16 -04:00
daid303
1a8f54cea1 The big LCD code update. This splits the display and menu implementation. Paving the way for future different displays. It also makes it easier to modify the menu structures while keeping everything consistant. Note that this most likely breaks the translations, which need to be updated. 2012-12-12 11:47:03 +01:00
daid303
6a9bee27cc Changed the naming of some LCD functions, so the names match better what the function does. Also moved around some prototypes for general cleanup. 2012-12-03 12:52:00 +01:00
daid303
94ea26ff46 Some minor changes on code style. And a bugfix where the counters for positioning in the stepper where wrong depending on compiler settings. (Caused strange values to reported back with M114 and endstop triggers). Also fixed compiling with FWRETRACT enabled. 2012-12-03 12:13:20 +01:00
daid303
6c51fe5039 Fix the bug where the SD percentage calculation is wrong when the file is larger then 42MB 2012-12-03 11:35:36 +01:00
daid
b69e75c89a Added long filename support. 2012-08-22 14:49:57 +02:00
Bernhard
0c123950e9 __ header file replace 2012-06-02 20:44:17 +02:00
Bernhard
1532200435 found error in filenames.
One array was too short. This had nothing to do with long filenames, other than if they were 12 characters exactly, which could only happen if the extension and the text before were filled completely
2012-03-19 20:06:58 +01:00
Erik van der Zalm
632528aa95 merging with SCUBA82 2012-03-04 13:41:47 +01:00
Christian Thalhammer
fde51084f3 set SD file delete to M30; switch printime output to M31 2012-03-03 21:58:12 +01:00
Daid
3d83109028 Fixed general 16x2 LCD build without SD support. 2012-02-29 15:33:23 +01:00
Bernhard
729cde4475 fix autostart failure if in wrong directory 2011-12-26 09:20:53 +01:00
Bernhard
cc4a9cdb69 added autostart procedure trigger to the ultralcd menu 2011-12-09 12:33:00 +01:00
Bernhard
7714b98da7 solved some compiler warnings that are now visible in arduino 1.0.
Found a couple of unused variables, that I commented.
Tried to solve the program memory warning message, and failed.
2011-12-04 12:40:18 +01:00