Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix 2.0.x - merge 06092019 #7

Merged
merged 29 commits into from
Sep 6, 2019
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
89a2161
MINIMUM_STEPPER_DIR_DELAY in LA (#15154)
AnHardt Sep 4, 2019
d577b3c
Fix MKS SGEN-L Pins (#15153)
thisiskeithb Sep 4, 2019
d9bbe0f
[cron] Bump distribution date
thinkyhead Sep 4, 2019
2563e32
Format FWRETRACT config comments
thinkyhead Sep 4, 2019
293b890
Apply soft limits to G2/G3 final target (#15156)
vector76 Sep 4, 2019
8e044ea
Fix up Fysetc configs, pins. Fix menu type `float5`. (#15157)
GerogeFu Sep 4, 2019
6b05d5d
Allow TOUCH_BUTTONS to be swapped (#15100)
robbycandra Sep 4, 2019
7ad5208
Fix up boot screen code
thinkyhead Sep 4, 2019
a07c4af
Tweak animated draw call
thinkyhead Sep 4, 2019
2d2d9da
Tweak u8g impl file includes
thinkyhead Sep 4, 2019
123ecfe
Allow MINIMUM_STEPPER_PULSE override with LV8729 (#15162)
ktand Sep 4, 2019
beffcd8
Update German language, (c) (#15164)
Ludy87 Sep 4, 2019
53af7ca
SAMD51 include u8g library (#15165)
GMagician Sep 4, 2019
cff502c
Tweak REPRAPWORLD_KEYPAD config comment
thinkyhead Sep 4, 2019
85f0556
Add XPT2046 calibration functions (#15140)
tpruvot Sep 4, 2019
6b1c4de
Touch Mi: Add magnet Y position (#15166)
kakou-fr Sep 4, 2019
060b360
Provide a good default contrast
thinkyhead Sep 4, 2019
7496e1c
whitespace
thinkyhead Sep 5, 2019
37d3c72
[cron] Bump distribution date
thinkyhead Sep 5, 2019
bf3cd8e
Tweak var names
thinkyhead Sep 5, 2019
18dd5cb
Config comment patch
thinkyhead Sep 5, 2019
50e1bf5
Fix RRD/CR10 LCD on STM32F1/F4 (#15172)
tpruvot Sep 5, 2019
01fd3f9
Drop extra include (#15171)
Ludy87 Sep 5, 2019
70b3f4d
Pins error message
thinkyhead Sep 5, 2019
8d036e9
Combine channel-based SPI headers
thinkyhead Sep 5, 2019
72876d9
Clean up u8g defines
thinkyhead Sep 5, 2019
4cdf7a1
Add ADC helpers to temp_info_t
thinkyhead Sep 6, 2019
91c3b8e
Reformat ADC cases
thinkyhead Sep 6, 2019
ca1a347
[cron] Bump distribution date
thinkyhead Sep 6, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add ADC helpers to temp_info_t
thinkyhead committed Sep 6, 2019

Verified

This commit was signed with the committer’s verified signature.
aakoshh Akosh Farkash
commit 4cdf7a1b933fff5f6bf7a86a9c6f53fc16782737
26 changes: 13 additions & 13 deletions Marlin/src/module/temperature.cpp
Original file line number Diff line number Diff line change
@@ -2164,35 +2164,35 @@ void Temperature::disable_all_heaters() {
void Temperature::set_current_temp_raw() {

#if HAS_TEMP_ADC_0 && DISABLED(HEATER_0_USES_MAX6675)
temp_hotend[0].raw = temp_hotend[0].acc;
temp_hotend[0].update();
#endif

#if HAS_TEMP_ADC_1
#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
redundant_temperature_raw = temp_hotend[1].acc;
#elif DISABLED(HEATER_1_USES_MAX6675)
temp_hotend[1].raw = temp_hotend[1].acc;
temp_hotend[1].update();
#endif
#if HAS_TEMP_ADC_2
temp_hotend[2].raw = temp_hotend[2].acc;
temp_hotend[2].update();
#if HAS_TEMP_ADC_3
temp_hotend[3].raw = temp_hotend[3].acc;
temp_hotend[3].update();
#if HAS_TEMP_ADC_4
temp_hotend[4].raw = temp_hotend[4].acc;
temp_hotend[4].update();
#if HAS_TEMP_ADC_5
temp_hotend[5].raw = temp_hotend[5].acc;
temp_hotend[5].update();
#endif // HAS_TEMP_ADC_5
#endif // HAS_TEMP_ADC_4
#endif // HAS_TEMP_ADC_3
#endif // HAS_TEMP_ADC_2
#endif // HAS_TEMP_ADC_1

#if HAS_HEATED_BED
temp_bed.raw = temp_bed.acc;
temp_bed.update();
#endif

#if HAS_TEMP_CHAMBER
temp_chamber.raw = temp_chamber.acc;
temp_chamber.update();
#endif

temp_meas_ready = true;
@@ -2212,17 +2212,17 @@ void Temperature::readings_ready() {
current_raw_filwidth = raw_filwidth_value >> 10; // Divide to get to 0-16384 range since we used 1/128 IIR filter approach
#endif

HOTEND_LOOP() temp_hotend[e].acc = 0;
HOTEND_LOOP() temp_hotend[e].reset();
#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
temp_hotend[1].acc = 0;
temp_hotend[1].reset();
#endif

#if HAS_HEATED_BED
temp_bed.acc = 0;
temp_bed.reset();
#endif

#if HAS_TEMP_CHAMBER
temp_chamber.acc = 0;
temp_chamber.reset();
#endif

static constexpr int8_t temp_dir[] = {
@@ -2638,7 +2638,7 @@ void Temperature::isr() {
*/
#define ACCUMULATE_ADC(obj) do{ \
if (!HAL_ADC_READY()) next_sensor_state = adc_sensor_state; \
else obj.acc += HAL_READ_ADC(); \
else obj.sample(HAL_READ_ADC()); \
}while(0)

ADCSensorState next_sensor_state = adc_sensor_state < SensorsReady ? (ADCSensorState)(int(adc_sensor_state) + 1) : StartSampling;
3 changes: 3 additions & 0 deletions Marlin/src/module/temperature.h
Original file line number Diff line number Diff line change
@@ -160,6 +160,9 @@ typedef struct TempInfo {
uint16_t acc;
int16_t raw;
float current;
inline void reset() { acc = 0; }
inline void sample(const uint16_t s) { acc += s; }
inline void update() { raw = acc; }
} temp_info_t;

// A PWM heater with temperature sensor