0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-02-27 19:36:58 +00:00

Apply lowercase to some common methods

This commit is contained in:
Scott Lahteine 2018-02-28 16:54:09 -06:00
parent 8fff2fad23
commit 1f3ddd2c33
5 changed files with 34 additions and 34 deletions

View file

@ -10073,7 +10073,7 @@ inline void gcode_M226() {
NOLESS(thermalManager.lpq_len, 0); NOLESS(thermalManager.lpq_len, 0);
#endif #endif
thermalManager.updatePID(); thermalManager.update_pid();
SERIAL_ECHO_START(); SERIAL_ECHO_START();
#if ENABLED(PID_PARAMS_PER_HOTEND) #if ENABLED(PID_PARAMS_PER_HOTEND)
SERIAL_ECHOPAIR(" e:", e); // specify extruder in serial output SERIAL_ECHOPAIR(" e:", e); // specify extruder in serial output
@ -10219,7 +10219,7 @@ inline void gcode_M303() {
KEEPALIVE_STATE(NOT_BUSY); KEEPALIVE_STATE(NOT_BUSY);
#endif #endif
thermalManager.PID_autotune(temp, e, c, u); thermalManager.pid_autotune(temp, e, c, u);
#if DISABLED(BUSY_WHILE_HEATING) #if DISABLED(BUSY_WHILE_HEATING)
KEEPALIVE_STATE(IN_HANDLER); KEEPALIVE_STATE(IN_HANDLER);

View file

@ -308,7 +308,7 @@ void MarlinSettings::postprocess() {
#endif #endif
#if ENABLED(PIDTEMP) #if ENABLED(PIDTEMP)
thermalManager.updatePID(); thermalManager.update_pid();
#endif #endif
#if DISABLED(NO_VOLUMETRICS) #if DISABLED(NO_VOLUMETRICS)

View file

@ -247,7 +247,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS];
* Alternately heat and cool the nozzle, observing its behavior to * Alternately heat and cool the nozzle, observing its behavior to
* determine the best PID values to achieve a stable temperature. * determine the best PID values to achieve a stable temperature.
*/ */
void Temperature::PID_autotune(const float &target, const int8_t hotend, const int8_t ncycles, const bool set_result/*=false*/) { void Temperature::pid_autotune(const float &target, const int8_t hotend, const int8_t ncycles, const bool set_result/*=false*/) {
float current = 0.0; float current = 0.0;
int cycles = 0; int cycles = 0;
bool heating = true; bool heating = true;
@ -327,7 +327,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS];
const millis_t ms = millis(); const millis_t ms = millis();
if (temp_meas_ready) { // temp sample ready if (temp_meas_ready) { // temp sample ready
updateTemperaturesFromRawValues(); calculate_celsius_temperatures();
// Get the current temperature and constrain it // Get the current temperature and constrain it
current = GHV(current_temperature_bed, current_temperature[hotend]); current = GHV(current_temperature_bed, current_temperature[hotend]);
@ -336,7 +336,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS];
#if HAS_AUTO_FAN #if HAS_AUTO_FAN
if (ELAPSED(ms, next_auto_fan_check_ms)) { if (ELAPSED(ms, next_auto_fan_check_ms)) {
checkExtruderAutoFans(); check_extruder_auto_fans();
next_auto_fan_check_ms = ms + 2500UL; next_auto_fan_check_ms = ms + 2500UL;
} }
#endif #endif
@ -483,7 +483,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS];
PID_PARAM(Kp, hotend) = workKp; \ PID_PARAM(Kp, hotend) = workKp; \
PID_PARAM(Ki, hotend) = scalePID_i(workKi); \ PID_PARAM(Ki, hotend) = scalePID_i(workKi); \
PID_PARAM(Kd, hotend) = scalePID_d(workKd); \ PID_PARAM(Kd, hotend) = scalePID_d(workKd); \
updatePID(); }while(0) update_pid(); }while(0)
// Use the result? (As with "M303 U1") // Use the result? (As with "M303 U1")
if (set_result) { if (set_result) {
@ -524,7 +524,7 @@ int Temperature::getHeaterPower(const int heater) {
#if HAS_AUTO_FAN #if HAS_AUTO_FAN
void Temperature::checkExtruderAutoFans() { void Temperature::check_extruder_auto_fans() {
static const pin_t fanPin[] PROGMEM = { E0_AUTO_FAN_PIN, E1_AUTO_FAN_PIN, E2_AUTO_FAN_PIN, E3_AUTO_FAN_PIN, E4_AUTO_FAN_PIN, CHAMBER_AUTO_FAN_PIN }; static const pin_t fanPin[] PROGMEM = { E0_AUTO_FAN_PIN, E1_AUTO_FAN_PIN, E2_AUTO_FAN_PIN, E3_AUTO_FAN_PIN, E4_AUTO_FAN_PIN, CHAMBER_AUTO_FAN_PIN };
static const uint8_t fanBit[] PROGMEM = { static const uint8_t fanBit[] PROGMEM = {
0, 0,
@ -764,7 +764,7 @@ void Temperature::manage_heater() {
if (!temp_meas_ready) return; if (!temp_meas_ready) return;
updateTemperaturesFromRawValues(); // also resets the watchdog calculate_celsius_temperatures(); // also resets the watchdog
#if ENABLED(HEATER_0_USES_MAX6675) #if ENABLED(HEATER_0_USES_MAX6675)
if (current_temperature[0] > MIN(HEATER_0_MAXTEMP, MAX6675_TMAX - 1.0)) max_temp_error(0); if (current_temperature[0] > MIN(HEATER_0_MAXTEMP, MAX6675_TMAX - 1.0)) max_temp_error(0);
@ -809,7 +809,7 @@ void Temperature::manage_heater() {
#if HAS_AUTO_FAN #if HAS_AUTO_FAN
if (ELAPSED(ms, next_auto_fan_check_ms)) { // only need to check fan state very infrequently if (ELAPSED(ms, next_auto_fan_check_ms)) { // only need to check fan state very infrequently
checkExtruderAutoFans(); check_extruder_auto_fans();
next_auto_fan_check_ms = ms + 2500UL; next_auto_fan_check_ms = ms + 2500UL;
} }
#endif #endif
@ -919,7 +919,7 @@ void Temperature::manage_heater() {
// Derived from RepRap FiveD extruder::getTemperature() // Derived from RepRap FiveD extruder::getTemperature()
// For hot end temperature measurement. // For hot end temperature measurement.
float Temperature::analog2temp(const int raw, const uint8_t e) { float Temperature::analog_to_celsius_hotend(const int raw, const uint8_t e) {
#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
if (e > HOTENDS) if (e > HOTENDS)
#else #else
@ -991,7 +991,7 @@ float Temperature::analog2temp(const int raw, const uint8_t e) {
#if HAS_HEATED_BED #if HAS_HEATED_BED
// Derived from RepRap FiveD extruder::getTemperature() // Derived from RepRap FiveD extruder::getTemperature()
// For bed temperature measurement. // For bed temperature measurement.
float Temperature::analog2tempBed(const int raw) { float Temperature::analog_to_celsius_bed(const int raw) {
#if ENABLED(HEATER_BED_USES_THERMISTOR) #if ENABLED(HEATER_BED_USES_THERMISTOR)
SCAN_THERMISTOR_TABLE(BEDTEMPTABLE, BEDTEMPTABLE_LEN); SCAN_THERMISTOR_TABLE(BEDTEMPTABLE, BEDTEMPTABLE_LEN);
#elif ENABLED(HEATER_BED_USES_AD595) #elif ENABLED(HEATER_BED_USES_AD595)
@ -1007,7 +1007,7 @@ float Temperature::analog2temp(const int raw, const uint8_t e) {
#if HAS_TEMP_CHAMBER #if HAS_TEMP_CHAMBER
// Derived from RepRap FiveD extruder::getTemperature() // Derived from RepRap FiveD extruder::getTemperature()
// For chamber temperature measurement. // For chamber temperature measurement.
float Temperature::analog2tempChamber(const int raw) { float Temperature::analog_to_celsius_chamber(const int raw) {
#if ENABLED(HEATER_CHAMBER_USES_THERMISTOR) #if ENABLED(HEATER_CHAMBER_USES_THERMISTOR)
SCAN_THERMISTOR_TABLE(CHAMBERTEMPTABLE, CHAMBERTEMPTABLE_LEN); SCAN_THERMISTOR_TABLE(CHAMBERTEMPTABLE, CHAMBERTEMPTABLE_LEN);
#elif ENABLED(HEATER_CHAMBER_USES_AD595) #elif ENABLED(HEATER_CHAMBER_USES_AD595)
@ -1026,22 +1026,22 @@ float Temperature::analog2temp(const int raw, const uint8_t e) {
* and this function is called from normal context * and this function is called from normal context
* as it would block the stepper routine. * as it would block the stepper routine.
*/ */
void Temperature::updateTemperaturesFromRawValues() { void Temperature::calculate_celsius_temperatures() {
#if ENABLED(HEATER_0_USES_MAX6675) #if ENABLED(HEATER_0_USES_MAX6675)
current_temperature_raw[0] = read_max6675(); current_temperature_raw[0] = read_max6675();
#endif #endif
HOTEND_LOOP() current_temperature[e] = Temperature::analog2temp(current_temperature_raw[e], e); HOTEND_LOOP() current_temperature[e] = analog_to_celsius_hotend(current_temperature_raw[e], e);
#if HAS_HEATED_BED #if HAS_HEATED_BED
current_temperature_bed = Temperature::analog2tempBed(current_temperature_bed_raw); current_temperature_bed = analog_to_celsius_bed(current_temperature_bed_raw);
#endif #endif
#if HAS_TEMP_CHAMBER #if HAS_TEMP_CHAMBER
current_temperature_chamber = Temperature::analog2tempChamber(current_temperature_chamber_raw); current_temperature_chamber = analog_to_celsius_chamber(current_temperature_chamber_raw);
#endif #endif
#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
redundant_temperature = Temperature::analog2temp(redundant_temperature_raw, 1); redundant_temperature = analog_to_celsius_hotend(redundant_temperature_raw, 1);
#endif #endif
#if ENABLED(FILAMENT_WIDTH_SENSOR) #if ENABLED(FILAMENT_WIDTH_SENSOR)
filament_width_meas = analog2widthFil(); filament_width_meas = analog_to_mm_fil_width();
#endif #endif
#if ENABLED(USE_WATCHDOG) #if ENABLED(USE_WATCHDOG)
@ -1056,7 +1056,7 @@ void Temperature::updateTemperaturesFromRawValues() {
#if ENABLED(FILAMENT_WIDTH_SENSOR) #if ENABLED(FILAMENT_WIDTH_SENSOR)
// Convert raw Filament Width to millimeters // Convert raw Filament Width to millimeters
float Temperature::analog2widthFil() { float Temperature::analog_to_mm_fil_width() {
return current_raw_filwidth * 5.0f * (1.0f / 16383.0); return current_raw_filwidth * 5.0f * (1.0f / 16383.0);
} }
@ -1256,7 +1256,7 @@ void Temperature::init() {
#define TEMP_MIN_ROUTINE(NR) \ #define TEMP_MIN_ROUTINE(NR) \
minttemp[NR] = HEATER_ ##NR## _MINTEMP; \ minttemp[NR] = HEATER_ ##NR## _MINTEMP; \
while (analog2temp(minttemp_raw[NR], NR) < HEATER_ ##NR## _MINTEMP) { \ while (analog_to_celsius_hotend(minttemp_raw[NR], NR) < HEATER_ ##NR## _MINTEMP) { \
if (HEATER_ ##NR## _RAW_LO_TEMP < HEATER_ ##NR## _RAW_HI_TEMP) \ if (HEATER_ ##NR## _RAW_LO_TEMP < HEATER_ ##NR## _RAW_HI_TEMP) \
minttemp_raw[NR] += OVERSAMPLENR; \ minttemp_raw[NR] += OVERSAMPLENR; \
else \ else \
@ -1264,7 +1264,7 @@ void Temperature::init() {
} }
#define TEMP_MAX_ROUTINE(NR) \ #define TEMP_MAX_ROUTINE(NR) \
maxttemp[NR] = HEATER_ ##NR## _MAXTEMP; \ maxttemp[NR] = HEATER_ ##NR## _MAXTEMP; \
while (analog2temp(maxttemp_raw[NR], NR) > HEATER_ ##NR## _MAXTEMP) { \ while (analog_to_celsius_hotend(maxttemp_raw[NR], NR) > HEATER_ ##NR## _MAXTEMP) { \
if (HEATER_ ##NR## _RAW_LO_TEMP < HEATER_ ##NR## _RAW_HI_TEMP) \ if (HEATER_ ##NR## _RAW_LO_TEMP < HEATER_ ##NR## _RAW_HI_TEMP) \
maxttemp_raw[NR] -= OVERSAMPLENR; \ maxttemp_raw[NR] -= OVERSAMPLENR; \
else \ else \
@ -1312,7 +1312,7 @@ void Temperature::init() {
#if HAS_HEATED_BED #if HAS_HEATED_BED
#ifdef BED_MINTEMP #ifdef BED_MINTEMP
while (analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { while (analog_to_celsius_bed(bed_minttemp_raw) < BED_MINTEMP) {
#if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP
bed_minttemp_raw += OVERSAMPLENR; bed_minttemp_raw += OVERSAMPLENR;
#else #else
@ -1321,7 +1321,7 @@ void Temperature::init() {
} }
#endif // BED_MINTEMP #endif // BED_MINTEMP
#ifdef BED_MAXTEMP #ifdef BED_MAXTEMP
while (analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) { while (analog_to_celsius_bed(bed_maxttemp_raw) > BED_MAXTEMP) {
#if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP
bed_maxttemp_raw -= OVERSAMPLENR; bed_maxttemp_raw -= OVERSAMPLENR;
#else #else

View file

@ -318,13 +318,13 @@ class Temperature {
/** /**
* Static (class) methods * Static (class) methods
*/ */
static float analog2temp(const int raw, const uint8_t e); static float analog_to_celsius_hotend(const int raw, const uint8_t e);
#if HAS_HEATED_BED #if HAS_HEATED_BED
static float analog2tempBed(const int raw); static float analog_to_celsius_bed(const int raw);
#endif #endif
#if HAS_TEMP_CHAMBER #if HAS_TEMP_CHAMBER
static float analog2tempChamber(const int raw); static float analog_to_celsius_chamber(const int raw);
#endif #endif
/** /**
@ -365,7 +365,7 @@ class Temperature {
#endif #endif
#if ENABLED(FILAMENT_WIDTH_SENSOR) #if ENABLED(FILAMENT_WIDTH_SENSOR)
static float analog2widthFil(); // Convert raw Filament Width to millimeters static float analog_to_mm_fil_width(); // Convert raw Filament Width to millimeters
static int8_t widthFil_to_size_ratio(); // Convert Filament Width (mm) to an extrusion ratio static int8_t widthFil_to_size_ratio(); // Convert Filament Width (mm) to an extrusion ratio
#endif #endif
@ -489,13 +489,13 @@ class Temperature {
* Perform auto-tuning for hotend or bed in response to M303 * Perform auto-tuning for hotend or bed in response to M303
*/ */
#if HAS_PID_HEATING #if HAS_PID_HEATING
static void PID_autotune(const float &target, const int8_t hotend, const int8_t ncycles, const bool set_result=false); static void pid_autotune(const float &target, const int8_t hotend, const int8_t ncycles, const bool set_result=false);
/** /**
* Update the temp manager when PID values change * Update the temp manager when PID values change
*/ */
#if ENABLED(PIDTEMP) #if ENABLED(PIDTEMP)
FORCE_INLINE static void updatePID() { FORCE_INLINE static void update_pid() {
#if ENABLED(PID_EXTRUSION_SCALING) #if ENABLED(PID_EXTRUSION_SCALING)
last_e_position = 0; last_e_position = 0;
#endif #endif
@ -612,13 +612,13 @@ class Temperature {
static void set_current_temp_raw(); static void set_current_temp_raw();
static void updateTemperaturesFromRawValues(); static void calculate_celsius_temperatures();
#if ENABLED(HEATER_0_USES_MAX6675) #if ENABLED(HEATER_0_USES_MAX6675)
static int read_max6675(); static int read_max6675();
#endif #endif
static void checkExtruderAutoFans(); static void check_extruder_auto_fans();
static float get_pid_output(const int8_t e); static float get_pid_output(const int8_t e);

View file

@ -3414,14 +3414,14 @@ void lcd_quick_feedback(const bool clear_buttons) {
UNUSED(e); UNUSED(e);
#endif #endif
PID_PARAM(Ki, e) = scalePID_i(raw_Ki); PID_PARAM(Ki, e) = scalePID_i(raw_Ki);
thermalManager.updatePID(); thermalManager.update_pid();
} }
void copy_and_scalePID_d(int16_t e) { void copy_and_scalePID_d(int16_t e) {
#if DISABLED(PID_PARAMS_PER_HOTEND) || HOTENDS == 1 #if DISABLED(PID_PARAMS_PER_HOTEND) || HOTENDS == 1
UNUSED(e); UNUSED(e);
#endif #endif
PID_PARAM(Kd, e) = scalePID_d(raw_Kd); PID_PARAM(Kd, e) = scalePID_d(raw_Kd);
thermalManager.updatePID(); thermalManager.update_pid();
} }
#define _DEFINE_PIDTEMP_BASE_FUNCS(N) \ #define _DEFINE_PIDTEMP_BASE_FUNCS(N) \
void copy_and_scalePID_i_E ## N() { copy_and_scalePID_i(N); } \ void copy_and_scalePID_i_E ## N() { copy_and_scalePID_i(N); } \