Преглед изворни кода

Use celsius_t for temperature accessors

Scott Lahteine пре 4 година
родитељ
комит
58cc4b7043
2 измењених фајлова са 6 додато и 6 уклоњено
  1. 2
    2
      Marlin/src/gcode/bedlevel/G26.cpp
  2. 4
    4
      Marlin/src/module/temperature.h

+ 2
- 2
Marlin/src/gcode/bedlevel/G26.cpp Прегледај датотеку

205
         layer_height          = MESH_TEST_LAYER_HEIGHT,
205
         layer_height          = MESH_TEST_LAYER_HEIGHT,
206
         prime_length          = PRIME_LENGTH;
206
         prime_length          = PRIME_LENGTH;
207
 
207
 
208
-  int16_t bed_temp            = MESH_TEST_BED_TEMP,
209
-          hotend_temp         = MESH_TEST_HOTEND_TEMP;
208
+  celsius_t bed_temp          = MESH_TEST_BED_TEMP,
209
+            hotend_temp       = MESH_TEST_HOTEND_TEMP;
210
 
210
 
211
   float nozzle                = MESH_TEST_NOZZLE_SIZE,
211
   float nozzle                = MESH_TEST_NOZZLE_SIZE,
212
         filament_diameter     = DEFAULT_NOMINAL_FILAMENT_DIA,
212
         filament_diameter     = DEFAULT_NOMINAL_FILAMENT_DIA,

+ 4
- 4
Marlin/src/module/temperature.h Прегледај датотеку

631
     //inline so that there is no performance decrease.
631
     //inline so that there is no performance decrease.
632
     //deg=degreeCelsius
632
     //deg=degreeCelsius
633
 
633
 
634
-    FORCE_INLINE static float degHotend(const uint8_t E_NAME) {
634
+    FORCE_INLINE static celsius_t degHotend(const uint8_t E_NAME) {
635
       return TERN0(HAS_HOTEND, temp_hotend[HOTEND_INDEX].celsius);
635
       return TERN0(HAS_HOTEND, temp_hotend[HOTEND_INDEX].celsius);
636
     }
636
     }
637
 
637
 
736
       #if ENABLED(SHOW_TEMP_ADC_VALUES)
736
       #if ENABLED(SHOW_TEMP_ADC_VALUES)
737
         FORCE_INLINE static int16_t rawProbeTemp()    { return temp_probe.raw; }
737
         FORCE_INLINE static int16_t rawProbeTemp()    { return temp_probe.raw; }
738
       #endif
738
       #endif
739
-      FORCE_INLINE static float degProbe()            { return temp_probe.celsius; }
739
+      FORCE_INLINE static celsius_t degProbe()        { return temp_probe.celsius; }
740
       FORCE_INLINE static bool isProbeBelowTemp(const_float_t target_temp) { return temp_probe.celsius < target_temp; }
740
       FORCE_INLINE static bool isProbeBelowTemp(const_float_t target_temp) { return temp_probe.celsius < target_temp; }
741
       FORCE_INLINE static bool isProbeAboveTemp(const_float_t target_temp) { return temp_probe.celsius > target_temp; }
741
       FORCE_INLINE static bool isProbeAboveTemp(const_float_t target_temp) { return temp_probe.celsius > target_temp; }
742
       static bool wait_for_probe(const_float_t target_temp, bool no_wait_for_cooling=true);
742
       static bool wait_for_probe(const_float_t target_temp, bool no_wait_for_cooling=true);
752
       #if ENABLED(SHOW_TEMP_ADC_VALUES)
752
       #if ENABLED(SHOW_TEMP_ADC_VALUES)
753
         FORCE_INLINE static int16_t rawChamberTemp()      { return temp_chamber.raw; }
753
         FORCE_INLINE static int16_t rawChamberTemp()      { return temp_chamber.raw; }
754
       #endif
754
       #endif
755
-      FORCE_INLINE static float degChamber()              { return temp_chamber.celsius; }
755
+      FORCE_INLINE static celsius_t degChamber()          { return temp_chamber.celsius; }
756
       #if HAS_HEATED_CHAMBER
756
       #if HAS_HEATED_CHAMBER
757
         FORCE_INLINE static celsius_t degTargetChamber()  { return temp_chamber.target; }
757
         FORCE_INLINE static celsius_t degTargetChamber()  { return temp_chamber.target; }
758
         FORCE_INLINE static bool isHeatingChamber()       { return temp_chamber.target > temp_chamber.celsius; }
758
         FORCE_INLINE static bool isHeatingChamber()       { return temp_chamber.target > temp_chamber.celsius; }
778
       #if ENABLED(SHOW_TEMP_ADC_VALUES)
778
       #if ENABLED(SHOW_TEMP_ADC_VALUES)
779
         FORCE_INLINE static int16_t rawCoolerTemp()     { return temp_cooler.raw; }
779
         FORCE_INLINE static int16_t rawCoolerTemp()     { return temp_cooler.raw; }
780
       #endif
780
       #endif
781
-      FORCE_INLINE static float degCooler()             { return temp_cooler.celsius; }
781
+      FORCE_INLINE static celsius_t degCooler()         { return temp_cooler.celsius; }
782
       #if HAS_COOLER
782
       #if HAS_COOLER
783
         FORCE_INLINE static celsius_t degTargetCooler() { return temp_cooler.target; }
783
         FORCE_INLINE static celsius_t degTargetCooler() { return temp_cooler.target; }
784
         FORCE_INLINE static bool isLaserHeating()       { return temp_cooler.target > temp_cooler.celsius; }
784
         FORCE_INLINE static bool isLaserHeating()       { return temp_cooler.target > temp_cooler.celsius; }

Loading…
Откажи
Сачувај