Replace 'const float &' with 'const_float_t' (#21505)
This commit is contained in:
@ -40,7 +40,7 @@ PrinterEventLEDs printerEventLEDs;
|
||||
|
||||
uint8_t PrinterEventLEDs::old_intensity = 0;
|
||||
|
||||
inline uint8_t pel_intensity(const float &start, const float ¤t, const float &target) {
|
||||
inline uint8_t pel_intensity(const_float_t start, const_float_t current, const_float_t target) {
|
||||
if (uint16_t(start) == uint16_t(target)) return 255;
|
||||
return (uint8_t)map(constrain(current, start, target), start, target, 0.f, 255.f);
|
||||
}
|
||||
@ -58,7 +58,7 @@ PrinterEventLEDs printerEventLEDs;
|
||||
|
||||
#if HAS_TEMP_HOTEND
|
||||
|
||||
void PrinterEventLEDs::onHotendHeating(const float &start, const float ¤t, const float &target) {
|
||||
void PrinterEventLEDs::onHotendHeating(const_float_t start, const_float_t current, const_float_t target) {
|
||||
const uint8_t blue = pel_intensity(start, current, target);
|
||||
if (blue != old_intensity) {
|
||||
old_intensity = blue;
|
||||
@ -70,7 +70,7 @@ PrinterEventLEDs printerEventLEDs;
|
||||
|
||||
#if HAS_HEATED_BED
|
||||
|
||||
void PrinterEventLEDs::onBedHeating(const float &start, const float ¤t, const float &target) {
|
||||
void PrinterEventLEDs::onBedHeating(const_float_t start, const_float_t current, const_float_t target) {
|
||||
const uint8_t red = pel_intensity(start, current, target);
|
||||
if (red != old_intensity) {
|
||||
old_intensity = red;
|
||||
@ -82,7 +82,7 @@ PrinterEventLEDs printerEventLEDs;
|
||||
|
||||
#if HAS_HEATED_CHAMBER
|
||||
|
||||
void PrinterEventLEDs::onChamberHeating(const float &start, const float ¤t, const float &target) {
|
||||
void PrinterEventLEDs::onChamberHeating(const_float_t start, const_float_t current, const_float_t target) {
|
||||
const uint8_t green = pel_intensity(start, current, target);
|
||||
if (green != old_intensity) {
|
||||
old_intensity = green;
|
||||
|
@ -47,17 +47,17 @@ private:
|
||||
public:
|
||||
#if HAS_TEMP_HOTEND
|
||||
static inline LEDColor onHotendHeatingStart() { old_intensity = 0; return leds.get_color(); }
|
||||
static void onHotendHeating(const float &start, const float ¤t, const float &target);
|
||||
static void onHotendHeating(const_float_t start, const_float_t current, const_float_t target);
|
||||
#endif
|
||||
|
||||
#if HAS_HEATED_BED
|
||||
static inline LEDColor onBedHeatingStart() { old_intensity = 127; return leds.get_color(); }
|
||||
static void onBedHeating(const float &start, const float ¤t, const float &target);
|
||||
static void onBedHeating(const_float_t start, const_float_t current, const_float_t target);
|
||||
#endif
|
||||
|
||||
#if HAS_HEATED_CHAMBER
|
||||
static inline LEDColor onChamberHeatingStart() { old_intensity = 127; return leds.get_color(); }
|
||||
static void onChamberHeating(const float &start, const float ¤t, const float &target);
|
||||
static void onChamberHeating(const_float_t start, const_float_t current, const_float_t target);
|
||||
#endif
|
||||
|
||||
#if HAS_TEMP_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER
|
||||
|
Reference in New Issue
Block a user