Commit Graph

4591 Commits

Author SHA1 Message Date
Yuri D'Elia
ec4c1be058 Silence bUpdateEEPROM unused warning in MK3 variant 2021-02-01 07:09:44 +01:00
Voinea Dragos
30131c9ab5 Patch broken string PROGMEM transition with setTargetedHotend() error 2021-02-01 06:12:37 +01:00
Voinea Dragos
ea44d78d68 Merge branch 'MK3' into PFW-1171-EEPROM_SN 2021-01-31 17:19:00 +02:00
Voinea Dragos
698499f00d split timer0 and timer2 initialization. Move timer2 init early 2021-01-31 17:18:32 +02:00
Voinea Dragos
6b6205d2f6 M27 refactoring and M27 L initial implementation 2021-01-31 15:06:20 +02:00
Yuri D'Elia
b8b75186fe Remove the extra copy of CRITICAL_SECTION from fastio 2021-01-29 18:30:16 +01:00
Yuri D'Elia
31b3ad0613 Merge remote-tracking branch 'upstream/MK3' into MK3_PAT9125_I2C 2021-01-29 18:28:55 +01:00
Yuri D'Elia
2d71a071f0 Switch twi.c to fastio 2021-01-29 17:51:38 +01:00
Yuri D'Elia
1fa7b8cd8d Move SDA/SCL pins into pins.h for fastio compatibility
fastio relies on macros for pin definitions, so we cannot use the const
declaration in Sd2PinMap or the arduino's definition.

Declare SDA/SCL_PIN into pins.h based on the current MCU, which is
identical in all our variants.

Remove the conflicting/unused declaration in Sd2PinMap.
2021-01-29 17:48:59 +01:00
Yuri D'Elia
30262b0a6e Remove redundant definitions of CRITICAL_SECTION_*
Move CRITICAL_SECTION_START/END into fastio.h, where it's needed.
2021-01-29 17:30:04 +01:00
3d-gussner
d75a0fdcbd Merge remote-tracking branch 'upstream/MK3' into MK3_translation_0121 2021-01-29 15:38:48 +01:00
DRracer
42311db5f1
Merge pull request #2789 from wavexx/MK3_TMC2130_DEDGE
Use/enable TMC2130 DEDGE support in MK3/MK3S
2021-01-29 11:13:09 +01:00
D.R.racer
caf58b16b6 Fix handling EOF
+ save ~160B by using local variables
+ rename some of the vars to more descriptive names
+ remove consecutiveEmptyLines handling from cmdqueue
2021-01-29 08:29:51 +01:00
Yuri D'Elia
e9d5c44732 Also toggle pins efficiently in sm4.c
Use the same technique used in fastio to toggle pins efficiently in sm4
when DEDGE is used.
2021-01-29 00:13:49 +01:00
3d-gussner
fba83bd309 Add new flags -c -p -n 2021-01-28 09:48:05 +01:00
D.R.racer
6c9c1423c6 Remove temporary changes from SdBaseFile.h 2021-01-28 09:42:50 +01:00
D.R.racer
71d825d0f2 Return SdBaseFile into previous state
no changes necessary afterall
2021-01-28 09:41:30 +01: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
c05b625b1c Fix occasionally skipped valid G-code lines
which also allowed for removal of the pre-increment -> post-increment
workaround
2021-01-28 08:13:16 +01:00
D.R.racer
d1fd5a555f Clean up gfReset() 2021-01-27 14:12:11 +01:00
D.R.racer
b2cf5b7b6c Fix seekSetFilteredGcode()
+some more debug code which will vanish after all is done and verified
2021-01-27 13:01:25 +01:00
D.R.racer
b6c59e08ac Workaround ++gfCacheP into postincrement ld r22, Z+
TODO: ideally improve the automaton to work with postincrement only, at
least in this case.
2021-01-27 09:52:20 +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
D.R.racer
dcc6605809 Workaround for skipping large comment blocks
If there are large blocks of comments in the G-code,
the printer may get shot down by its own watchdog.
Watchdog is generally set to 4s and updated only
in manage_heaters (and some other spots in some specific cases).

So far, the code reading the file and feeding it into Marlin
cycles indefinitely until it finds valid G-code lines and fills up the
command queue.

If the block is large enough, the printer cannot read it completely
within those 4s.

A simple workaround - bail out after some consecutive empty/comment
lines to enable other parts of code do their job (especially
manage_heaters).

Tested on MK404, previous FW fails with 600KB of comment lines at the
beginning, this patch survives. The printer even draws some update
on its status screen before starting a real print.
2021-01-27 07:03:51 +01:00
Yuri D'Elia
a9625747db Reinstate the nop instruction as delay in non-DEDGE
When TMC2130_MINIMUM_PULSE is 0 a minimum delay is implied.
In this case, use a single "nop" instruction.
2021-01-26 19:43:29 +01:00
Yuri D'Elia
d3734b02cc Also fix delay instances inside unused BACKLASH_[XY] 2021-01-26 16:18:23 +01:00
Yuri D'Elia
b17cdcd4d7 Ensure MINIMUM_PULSE is always 0 in DEDGE mode
This ensures delays are always properly elided without having to check
for DEDGE all over the place.
2021-01-26 16:12:59 +01:00
Yuri D'Elia
2a6989ecd5 Remove TMC2130 special-cases
With the new STEPPER_MINIMUM_DELAY being automatically removed for
TMC2130 we no longer need to add specialized #ifdefs for DEDGE in
babystep.
2021-01-26 16:09:23 +01:00
Yuri D'Elia
4fed728e08 Elide delayMicroseconds for TMC2130 in non-DEDGE mode
Introduce new macros TMC2130_MINIMUM_DELAY/STEPPER_MINIMUM_DELAY for
blocking pauses.

If MINIMUM_PULSE has defined to be zero, avoid the delay call entirely.
2021-01-26 16:02:53 +01:00
3d-gussner
f40c593d11 Fix few translations not being used due to spaces or upper case 2021-01-26 14:15:34 +01:00
D.R.racer
c28e5a9dbc Farmer's request 2
Farmers request having the Change filament menu item always visible in
the main menu and located after the Live Adjust Z (which disappears
after the first few printed layers).
2021-01-26 12:19:41 +01:00
DRracer
bfe93d3959
Merge pull request #2951 from DRracer/pvb-08
Add PVB preheat and 0.8mm nozzle presets
2021-01-26 12:09:41 +01:00
3d-gussner
ad5d068690 Update char lengths part 1
Fix some too long translations
2021-01-26 12:09:35 +01:00
DRracer
891f37a622
Merge pull request #2982 from DRracer/codesize
Reduce code size and RAM usage
2021-01-26 12:04:39 +01:00
3d-gussner
0aae433bda Update po files after all these changes 2021-01-26 11:08:57 +01:00
3d-gussner
c555907a12 Remove duplicate string G-code sliced for a different printer type. Please re-slice the model again. Print cancelled. using MSG_GCODE_DIFF_PRINTER_CANCELLED 2021-01-26 11:01:50 +01:00
3d-gussner
51d1e0bd8a Remove duplicate string G-code sliced for a different printer type. Continue? using MSG_GCODE_DIFF_PRINTER_CONTINUE 2021-01-26 10:42:56 +01:00
3d-gussner
7916f8b9e8 Merge branch 'codesize' of https://github.com/DRracer/Prusa-Firmware into DRracer_codesize 2021-01-26 10:13:11 +01:00
D.R.racer
0eb7261e29 Save ~100B on menu implementation 2021-01-26 09:29:17 +01:00
3d-gussner
ba8386573a Remove duplicate string Resume print using MSG_RESUME_PRINT 2021-01-26 09:23:55 +01:00
3d-gussner
c6a01b3806 Remove duplicate string Reset using MSG_RESET 2021-01-26 09:15:46 +01:00
3d-gussner
ab5aad636f Remove duplicate string Mesh Bed Leveling and Mesh bed leveling using MSG_MESH_BED_LEVELING
Fixed few too long translations
2021-01-26 09:05:38 +01:00
DRracer
f4cee7ce84
Merge pull request #2983 from leptun/MK3_fix_sm4.h_line_ending
Fix sm4.h line ending
2021-01-26 08:45:07 +01:00
DRracer
bce9f8c949
Merge pull request #2984 from leptun/MK3_Serial_LF_only
Do not send CR on the serial line
2021-01-26 08:42:47 +01:00
DRracer
c465417f50
Merge pull request #2987 from leptun/PFW-1144-LongPathName
"M20 L" support. Print long filenames
2021-01-26 08:40:26 +01:00
3d-gussner
84ed0725f2 Merge branch 'codesize' of https://github.com/DRracer/Prusa-Firmware into DRracer_codesize 2021-01-26 08:32:03 +01:00
3d-gussner
bce8501eea Remove duplicate string Extruder using MSG_Extruder 2021-01-26 08:31:21 +01:00
Voinea Dragos
c6588193ad Fix some more stuff in cardreader.cpp
Saved 4B of flash and 60B of RAM
2021-01-26 09:25:41 +02:00
3d-gussner
ab18a3ccc3 Merge branch 'codesize' of https://github.com/DRracer/Prusa-Firmware into DRracer_codesize 2021-01-26 08:24:11 +01:00