From 6960cd8e28394a7b3f6b6c3256c43ff982267229 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 28 Feb 2018 16:54:09 -0600 Subject: [PATCH] Apply lowercase to some common methods --- Marlin/Marlin_main.cpp | 4 ++-- Marlin/configuration_store.cpp | 2 +- Marlin/temperature.cpp | 42 +++++++++++++++++----------------- Marlin/temperature.h | 16 ++++++------- Marlin/ultralcd.cpp | 4 ++-- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 67b6418d08..7100aed104 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -10073,7 +10073,7 @@ inline void gcode_M226() { NOLESS(thermalManager.lpq_len, 0); #endif - thermalManager.updatePID(); + thermalManager.update_pid(); SERIAL_ECHO_START(); #if ENABLED(PID_PARAMS_PER_HOTEND) SERIAL_ECHOPAIR(" e:", e); // specify extruder in serial output @@ -10219,7 +10219,7 @@ inline void gcode_M303() { KEEPALIVE_STATE(NOT_BUSY); #endif - thermalManager.PID_autotune(temp, e, c, u); + thermalManager.pid_autotune(temp, e, c, u); #if DISABLED(BUSY_WHILE_HEATING) KEEPALIVE_STATE(IN_HANDLER); diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 6ec8f53e43..bfaea61746 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -308,7 +308,7 @@ void MarlinSettings::postprocess() { #endif #if ENABLED(PIDTEMP) - thermalManager.updatePID(); + thermalManager.update_pid(); #endif #if DISABLED(NO_VOLUMETRICS) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 554ee00313..1a58a1048a 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -247,7 +247,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; * Alternately heat and cool the nozzle, observing its behavior to * 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; int cycles = 0; bool heating = true; @@ -327,7 +327,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; const millis_t ms = millis(); if (temp_meas_ready) { // temp sample ready - updateTemperaturesFromRawValues(); + calculate_celsius_temperatures(); // Get the current temperature and constrain it current = GHV(current_temperature_bed, current_temperature[hotend]); @@ -336,7 +336,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; #if HAS_AUTO_FAN if (ELAPSED(ms, next_auto_fan_check_ms)) { - checkExtruderAutoFans(); + check_extruder_auto_fans(); next_auto_fan_check_ms = ms + 2500UL; } #endif @@ -483,7 +483,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; PID_PARAM(Kp, hotend) = workKp; \ PID_PARAM(Ki, hotend) = scalePID_i(workKi); \ PID_PARAM(Kd, hotend) = scalePID_d(workKd); \ - updatePID(); }while(0) + update_pid(); }while(0) // Use the result? (As with "M303 U1") if (set_result) { @@ -524,7 +524,7 @@ int Temperature::getHeaterPower(const int heater) { #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 uint8_t fanBit[] PROGMEM = { 0, @@ -764,7 +764,7 @@ void Temperature::manage_heater() { if (!temp_meas_ready) return; - updateTemperaturesFromRawValues(); // also resets the watchdog + calculate_celsius_temperatures(); // also resets the watchdog #if ENABLED(HEATER_0_USES_MAX6675) 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 (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; } #endif @@ -919,7 +919,7 @@ void Temperature::manage_heater() { // Derived from RepRap FiveD extruder::getTemperature() // 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 (e > HOTENDS) #else @@ -991,7 +991,7 @@ float Temperature::analog2temp(const int raw, const uint8_t e) { #if HAS_HEATED_BED // Derived from RepRap FiveD extruder::getTemperature() // 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) SCAN_THERMISTOR_TABLE(BEDTEMPTABLE, BEDTEMPTABLE_LEN); #elif ENABLED(HEATER_BED_USES_AD595) @@ -1007,7 +1007,7 @@ float Temperature::analog2temp(const int raw, const uint8_t e) { #if HAS_TEMP_CHAMBER // Derived from RepRap FiveD extruder::getTemperature() // 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) SCAN_THERMISTOR_TABLE(CHAMBERTEMPTABLE, CHAMBERTEMPTABLE_LEN); #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 * as it would block the stepper routine. */ -void Temperature::updateTemperaturesFromRawValues() { +void Temperature::calculate_celsius_temperatures() { #if ENABLED(HEATER_0_USES_MAX6675) current_temperature_raw[0] = read_max6675(); #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 - current_temperature_bed = Temperature::analog2tempBed(current_temperature_bed_raw); + current_temperature_bed = analog_to_celsius_bed(current_temperature_bed_raw); #endif #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 #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 #if ENABLED(FILAMENT_WIDTH_SENSOR) - filament_width_meas = analog2widthFil(); + filament_width_meas = analog_to_mm_fil_width(); #endif #if ENABLED(USE_WATCHDOG) @@ -1056,7 +1056,7 @@ void Temperature::updateTemperaturesFromRawValues() { #if ENABLED(FILAMENT_WIDTH_SENSOR) // 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); } @@ -1256,7 +1256,7 @@ void Temperature::init() { #define TEMP_MIN_ROUTINE(NR) \ 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) \ minttemp_raw[NR] += OVERSAMPLENR; \ else \ @@ -1264,7 +1264,7 @@ void Temperature::init() { } #define TEMP_MAX_ROUTINE(NR) \ 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) \ maxttemp_raw[NR] -= OVERSAMPLENR; \ else \ @@ -1312,7 +1312,7 @@ void Temperature::init() { #if HAS_HEATED_BED #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 bed_minttemp_raw += OVERSAMPLENR; #else @@ -1321,7 +1321,7 @@ void Temperature::init() { } #endif // BED_MINTEMP #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 bed_maxttemp_raw -= OVERSAMPLENR; #else diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 7eba6e62a7..610da4b0f5 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -318,13 +318,13 @@ class Temperature { /** * 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 - static float analog2tempBed(const int raw); + static float analog_to_celsius_bed(const int raw); #endif #if HAS_TEMP_CHAMBER - static float analog2tempChamber(const int raw); + static float analog_to_celsius_chamber(const int raw); #endif /** @@ -365,7 +365,7 @@ class Temperature { #endif #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 #endif @@ -489,13 +489,13 @@ class Temperature { * Perform auto-tuning for hotend or bed in response to M303 */ #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 */ #if ENABLED(PIDTEMP) - FORCE_INLINE static void updatePID() { + FORCE_INLINE static void update_pid() { #if ENABLED(PID_EXTRUSION_SCALING) last_e_position = 0; #endif @@ -612,13 +612,13 @@ class Temperature { static void set_current_temp_raw(); - static void updateTemperaturesFromRawValues(); + static void calculate_celsius_temperatures(); #if ENABLED(HEATER_0_USES_MAX6675) static int read_max6675(); #endif - static void checkExtruderAutoFans(); + static void check_extruder_auto_fans(); static float get_pid_output(const int8_t e); diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index f67de54e3c..f605f8e3a3 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -3414,14 +3414,14 @@ void lcd_quick_feedback(const bool clear_buttons) { UNUSED(e); #endif PID_PARAM(Ki, e) = scalePID_i(raw_Ki); - thermalManager.updatePID(); + thermalManager.update_pid(); } void copy_and_scalePID_d(int16_t e) { #if DISABLED(PID_PARAMS_PER_HOTEND) || HOTENDS == 1 UNUSED(e); #endif PID_PARAM(Kd, e) = scalePID_d(raw_Kd); - thermalManager.updatePID(); + thermalManager.update_pid(); } #define _DEFINE_PIDTEMP_BASE_FUNCS(N) \ void copy_and_scalePID_i_E ## N() { copy_and_scalePID_i(N); } \