387 Commits (f3618c3337cf49c53c0d806d44ce43d5b72ef230)

Author SHA1 Message Date
Scott Lahteine 499f9e04e1 Marlin: Temperature soft-PWM cleanup 8 years ago
Scott Lahteine 043be2856b Use "& 0x3F" instead of "% 64" 8 years ago
Stefan Brüns 6a040a6967 SOFT_PWM: Do not switch off heaters twice on pwm_count wraparound
After wraparound, pwm_count <= pwm_mask holds, thus soft_pwm_X <= pwm_count
guarantees soft_pwm_X < pwm_mask is true, and the heater will be switched
off in the first branch.
Do not evaluate the pwm conditions a second time, this reduces the
instruction count (4 instructions per PWM) and text size (6 byte).

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years ago
Stefan Brüns 0a74774af1 soft_pwm: avoid useless refetches of pwm_count
The compiler is not able to reuse the value of pwm_count, but reloads it
on every evaluation, if is stored in a static variable, as it cannot prove
it will be unchanged. A variable with local scope may not be modified from
the outside, so its value can be reused.
Doing so reduces text size and instruction count.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years ago
Stefan Brüns 35a55d5757 SOFT_PWM: Implement dithering if SOFT_PWM_SCALE is 1 or more
If dithering is enabled, the remainder of the soft_pwm_X duty value at
turnoff time is added to the next cycle. If e.g. the duty is set to 9 and
SCALE is set to 2, the PWM will be active for 8 counts for 3 cycles and
12 counts on each fourth cycle, i.e. the average is 9 cycles.

This compensates the resolution loss at higher scales and allows running
fans with SOFT_PWM with significantly reduced noise.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years ago
Stefan Brüns 2aed66a955 temperature: Fix SOFT_PWM off by one
A 128 step PWM has 127 intervals (0/127 ... 127/127 duty). Currently, a
PWM setting of 1/127 is active for 2/128, i.e. double the expected time,
or, in general n+1/128 instead of n/127.
Fixes issue#6003.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
8 years ago
Scott Lahteine 6618346148 Patches to work around "register spill" compiler bug 8 years ago
Scott Lahteine 77491dd924 Remove extraneous whitespace 8 years ago
Scott Lahteine 2defb1d748 Use SET_INPUT_PULLUP where appropriate 8 years ago
Scott Lahteine fea0d3f20f Endstop and temp-isr general cleanup 8 years ago
Scott Lahteine aef08e8780 Compact some macro substitutions 8 years ago
Sebastianv650 271ced7341 Prevent re-entering of temperature ISR
If Marlin is inside the temperature ISR, the stepper ISR is enabled. If
a stepper event is now happening Marlin will proceed with the stepper
ISR. Now, at the end of the stepper ISR, the temperatre ISR gets enabled
again. While Marlin proceed the rest of the temperature ISR, it's now
vulnerable to a second ISR call.
8 years ago
Scott Lahteine 7176de8605 Merge pull request #5814 from thinkyhead/hotend_loop_always
Make HOTEND_LOOP more consistent, let compiler optimize it
8 years ago
Scott Lahteine e44294bb4d Make HOTEND_LOOP more consistent, let compiler optimize it 8 years ago
Bob-the-Kuhn 0369f97ec1 guaranteed BLTouch detection
To guarantee that the 5mS pulse from a BLTouch is recognized you need to
have the endstops.update() routine run twice in that 5mS period.

At 200 steps per mm, my system has problems  below a feedrate of 120 mm
per minute.

Two things were done to guarantee the two updates within 5mS:
1) In interrupt mode, a check was added to the temperature ISR.  If the
endstop interrupt flag/counter is active then it'll kick off the endstop
update routine every 1mS until the flag/counter is zero.  This
flag/counter is decremented by the temperature ISR AND by the stepper
ISR.

2) In poling mode, code was added to the stepper ISR that will make sure
the ISR runs about every 1.5mS.  The "extra" ISR runs only check the
endstops.  This was done by grabbing the intended ISR delay and, if it's
over 2.0mS, splitting the intended delay into multiple smaller delays.
The first delay can be up to 2.0mS, the next ones 1.5mS (as needed) and
the last no less than 0.5mS.

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

BLTouch error state recovery

If BLTouch already active when deploying the probe then try to reset it
& clear the probe.

If that doesn't fix it then declare an error.

Also added BLTouch init routine to startup section
8 years ago
esenapaj 069c6b38dd Remove unnecessary tabs and spaces 8 years ago
Sebastianv650 912704a0d8 Enable ISRs inside temperature ISR
to capture chars at UART at 250000 baud.
8 years ago
Scott Lahteine 00662b8635 Minor babystep cleanup patches 8 years ago
Scott Lahteine 24f6612551 Reduce and optimize endstop_monitor code 8 years ago
Bob-the-Kuhn c7f1f0dae6 Add endstop monitor & make pins report pretty 8 years ago
Scott Lahteine 9cbedab91b Use DPM where possible 8 years ago
Scott Lahteine b6aa894893 Rename auto fan pins and add auto fan flags 8 years ago
Benoit Miller 2aa12d78dc Only issue MAXTEMP when heating 8 years ago
esenapaj 70e287ca8c Extend measuring range of thermocouple for MAX31855 8 years ago
Scott Lahteine f888597197 Reduce, clean up code for mintemp/maxtemp tests 8 years ago
Scott Lahteine ad64723354 Move MAX_EXTRUDERS to pins.h 8 years ago
esenapaj 385bd8a4a3 Fix freezing and MINTEMP Error with MAX31855 thermocouple 8 years ago
Scott Lahteine d41f2bdbd8 Merge pull request #4991 from thinkyhead/rc_max31855_fix
Patches for Stepper DAC and MAX31855
8 years ago
Scott Lahteine 149b8d9e4b Handle MAX31855 error conditions 8 years ago
Scott Lahteine 1e551c0688 Revert "Squashed - Removal of PID functional range" 8 years ago
Scott Lahteine 3752d9aca8 Fix timer comments 8 years ago
Scott Lahteine 00261cbfcb Merge pull request #4933 from thinkyhead/rc_drop_pid_func_range
Squashed - Removal of PID functional range
8 years ago
Scott Lahteine c63cb45268 Fix thermal runaway timeout 8 years ago
Scott Lahteine d80a79eb77 Use right-shift instead of / 2, why not? 8 years ago
Rerouter 02fe9cf558 Removal of functional range constraint
Also lined up the >> 1 and / 2 mentioned earlier in the unconstrained I term issue,
8 years ago
Scott Lahteine 761593b74b Cleanup some vars, use of min/max 8 years ago
Rerouter 1a2f1d4974 Update temperature.cpp 8 years ago
Scott Lahteine 16461900c2 Fix for HEATERS_PARALLEL 8 years ago
Scott Lahteine 076f3a8284 unsigned char => uint8_t 8 years ago
Scott Lahteine 6ac9d895ca Tweak Filament Width variables 8 years ago
Scott Lahteine e9bfca5870 Additional comments for Temperature::isr 8 years ago
Scott Lahteine 37ac540a26 Fix unsigned/signed comparison in fanPin loop 8 years ago
Scott Lahteine 27b80b1dd1 Merge pull request #4667 from thinkyhead/rc_M211_sw_endstop_switch
M211: Enable/Disable Software Endstops
8 years ago
Scott Lahteine 2f223b8c79 Use ABC and XYZ for "3" 8 years ago
Scott Lahteine 01d4703429 PREVENT_DANGEROUS_EXTRUDE => PREVENT_COLD_EXTRUSION
Also improve the documentation of this and related options, and set
EXTRUDE_MINTEMP to 170 everywhere.
8 years ago
Scott Lahteine 3a0a94b21a Always init configured fan pins 8 years ago
Scott Lahteine c63003ed3e Use matching auto-fan flags 8 years ago
Scott Lahteine 3475fd7b0f Init PWM-able auto fan pins with `SET_OUTPUT` 8 years ago
Scott Lahteine abf9696db1 Loop fan-pins based on array size 8 years ago
Scott Lahteine e88575c8ec Init next_auto_fan_check_ms to zero 8 years ago