Browse Source

Fix TEMP_0_TR_ENABLE, rename temp conditions (#21016)

Scott Lahteine 3 years ago
parent
commit
b35bfeb1c3
No account linked to committer's email address

+ 7
- 1
Marlin/Configuration_adv.h View File

@@ -113,6 +113,12 @@
113 113
   #define CHAMBER_BETA                 3950    // Beta value
114 114
 #endif
115 115
 
116
+#if TEMP_SENSOR_PROBE == 1000
117
+  #define PROBE_PULLUP_RESISTOR_OHMS   4700    // Pullup resistor
118
+  #define PROBE_RESISTANCE_25C_OHMS    100000  // Resistance at 25C
119
+  #define PROBE_BETA                   3950    // Beta value
120
+#endif
121
+
116 122
 //
117 123
 // Hephestos 2 24V heated bed upgrade kit.
118 124
 // https://store.bq.com/en/heated-bed-kit-hephestos2
@@ -331,7 +337,7 @@
331 337
  * High Temperature Thermistor Support
332 338
  *
333 339
  * Thermistors able to support high temperature tend to have a hard time getting
334
- * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
340
+ * good readings at room and lower temperatures. This means TEMP_SENSOR_X_RAW_LO_TEMP
335 341
  * will probably be caught when the heating element first turns on during the
336 342
  * preheating process, which will trigger a min_temp_error as a safety measure
337 343
  * and force stop everything.

+ 2
- 2
Marlin/src/MarlinCore.cpp View File

@@ -938,10 +938,10 @@ void setup() {
938 938
   SETUP_RUN(HAL_init());
939 939
 
940 940
   // Init and disable SPI thermocouples
941
-  #if HEATER_0_USES_MAX6675
941
+  #if TEMP_SENSOR_0_IS_MAX6675
942 942
     OUT_WRITE(MAX6675_SS_PIN, HIGH);  // Disable
943 943
   #endif
944
-  #if HEATER_1_USES_MAX6675
944
+  #if TEMP_SENSOR_1_IS_MAX6675
945 945
     OUT_WRITE(MAX6675_SS2_PIN, HIGH); // Disable
946 946
   #endif
947 947
 

+ 98
- 82
Marlin/src/inc/Conditionals_post.h View File

@@ -404,30 +404,33 @@
404 404
 #endif
405 405
 
406 406
 #if TEMP_SENSOR_0 == -5 || TEMP_SENSOR_0 == -3 || TEMP_SENSOR_0 == -2
407
-  #define HEATER_0_USES_MAX6675 1
407
+  #define TEMP_SENSOR_0_IS_MAX_TC 1
408
+  #define HAS_MAX_TC 1
408 409
   #if TEMP_SENSOR_0 == -3
409
-    #define HEATER_0_MAX6675_TMIN -270
410
-    #define HEATER_0_MAX6675_TMAX 1800
410
+    #define TEMP_SENSOR_0_MAX_TC_TMIN -270
411
+    #define TEMP_SENSOR_0_MAX_TC_TMAX 1800
411 412
   #else
412
-    #define HEATER_0_MAX6675_TMIN    0
413
-    #define HEATER_0_MAX6675_TMAX 1024
413
+    #define TEMP_SENSOR_0_MAX_TC_TMIN    0
414
+    #define TEMP_SENSOR_0_MAX_TC_TMAX 1024
414 415
   #endif
415 416
   #if TEMP_SENSOR_0 == -5
416
-    #define MAX6675_0_IS_MAX31865 1
417
+    #define TEMP_SENSOR_0_IS_MAX31865 1
417 418
   #elif TEMP_SENSOR_0 == -3
418
-    #define MAX6675_0_IS_MAX31855 1
419
+    #define TEMP_SENSOR_0_IS_MAX31855 1
420
+  #elif TEMP_SENSOR_0 == -2
421
+    #define TEMP_SENSOR_0_IS_MAX6675 1
419 422
   #endif
420 423
 #elif TEMP_SENSOR_0 == -4
421
-  #define HEATER_0_USES_AD8495 1
424
+  #define TEMP_SENSOR_0_IS_AD8495 1
422 425
 #elif TEMP_SENSOR_0 == -1
423
-  #define HEATER_0_USES_AD595 1
426
+  #define TEMP_SENSOR_0_IS_AD595 1
424 427
 #elif TEMP_SENSOR_0 > 0
425
-  #define THERMISTOR_HEATER_0 TEMP_SENSOR_0
426
-  #define HEATER_0_USES_THERMISTOR 1
428
+  #define TEMP_SENSOR_0_THERMISTOR_ID TEMP_SENSOR_0
429
+  #define TEMP_SENSOR_0_IS_THERMISTOR 1
427 430
   #if TEMP_SENSOR_0 == 1000
428
-    #define HEATER_0_USER_THERMISTOR 1
431
+    #define TEMP_SENSOR_0_IS_CUSTOM 1
429 432
   #elif TEMP_SENSOR_0 == 998 || TEMP_SENSOR_0 == 999
430
-    #define HEATER_0_DUMMY_THERMISTOR 1
433
+    #define TEMP_SENSOR_0_IS_DUMMY 1
431 434
   #endif
432 435
 #else
433 436
   #undef HEATER_0_MINTEMP
@@ -435,18 +438,21 @@
435 438
 #endif
436 439
 
437 440
 #if TEMP_SENSOR_1 == -5 || TEMP_SENSOR_1 == -3 || TEMP_SENSOR_1 == -2
438
-  #define HEATER_1_USES_MAX6675 1
441
+  #define TEMP_SENSOR_1_IS_MAX_TC 1
442
+  #define HAS_MAX_TC 1
439 443
   #if TEMP_SENSOR_1 == -3
440
-    #define HEATER_1_MAX6675_TMIN -270
441
-    #define HEATER_1_MAX6675_TMAX 1800
444
+    #define TEMP_SENSOR_1_MAX_TC_TMIN -270
445
+    #define TEMP_SENSOR_1_MAX_TC_TMAX 1800
442 446
   #else
443
-    #define HEATER_1_MAX6675_TMIN    0
444
-    #define HEATER_1_MAX6675_TMAX 1024
447
+    #define TEMP_SENSOR_1_MAX_TC_TMIN    0
448
+    #define TEMP_SENSOR_1_MAX_TC_TMAX 1024
445 449
   #endif
446 450
   #if TEMP_SENSOR_1 == -5
447
-    #define MAX6675_1_IS_MAX31865 1
451
+    #define TEMP_SENSOR_1_IS_MAX31865 1
448 452
   #elif TEMP_SENSOR_1 == -3
449
-    #define MAX6675_1_IS_MAX31855 1
453
+    #define TEMP_SENSOR_1_IS_MAX31855 1
454
+  #elif TEMP_SENSOR_1 == -2
455
+    #define TEMP_SENSOR_1_IS_MAX6675 1
450 456
   #endif
451 457
   #if TEMP_SENSOR_1 != TEMP_SENSOR_0
452 458
     #if   TEMP_SENSOR_1 == -5
@@ -458,37 +464,47 @@
458 464
     #endif
459 465
   #endif
460 466
 #elif TEMP_SENSOR_1 == -4
461
-  #define HEATER_1_USES_AD8495 1
467
+  #define TEMP_SENSOR_1_IS_AD8495 1
462 468
 #elif TEMP_SENSOR_1 == -1
463
-  #define HEATER_1_USES_AD595 1
469
+  #define TEMP_SENSOR_1_IS_AD595 1
464 470
 #elif TEMP_SENSOR_1 > 0
465
-  #define THERMISTOR_HEATER_1 TEMP_SENSOR_1
466
-  #define HEATER_1_USES_THERMISTOR 1
471
+  #define TEMP_SENSOR_1_THERMISTOR_ID TEMP_SENSOR_1
472
+  #define TEMP_SENSOR_1_IS_THERMISTOR 1
467 473
   #if TEMP_SENSOR_1 == 1000
468
-    #define HEATER_1_USER_THERMISTOR 1
474
+    #define TEMP_SENSOR_1_IS_CUSTOM 1
469 475
   #elif TEMP_SENSOR_1 == 998 || TEMP_SENSOR_1 == 999
470
-    #define HEATER_1_DUMMY_THERMISTOR 1
476
+    #define TEMP_SENSOR_1_IS_DUMMY 1
471 477
   #endif
472 478
 #else
473 479
   #undef HEATER_1_MINTEMP
474 480
   #undef HEATER_1_MAXTEMP
475 481
 #endif
476 482
 
483
+#if TEMP_SENSOR_0_IS_MAX31855 || TEMP_SENSOR_1_IS_MAX31855
484
+  #define HAS_MAX31855 1
485
+#endif
486
+#if TEMP_SENSOR_0_IS_MAX31865 || TEMP_SENSOR_1_IS_MAX31865
487
+  #define HAS_MAX31865 1
488
+#endif
489
+#if TEMP_SENSOR_0_IS_MAX6675 || TEMP_SENSOR_1_IS_MAX6675
490
+  #define HAS_MAX6675 1
491
+#endif
492
+
477 493
 #if TEMP_SENSOR_2 == -4
478
-  #define HEATER_2_USES_AD8495 1
494
+  #define TEMP_SENSOR_2_IS_AD8495 1
479 495
 #elif TEMP_SENSOR_2 == -3
480 496
   #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_2."
481 497
 #elif TEMP_SENSOR_2 == -2
482 498
   #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_2."
483 499
 #elif TEMP_SENSOR_2 == -1
484
-  #define HEATER_2_USES_AD595 1
500
+  #define TEMP_SENSOR_2_IS_AD595 1
485 501
 #elif TEMP_SENSOR_2 > 0
486
-  #define THERMISTOR_HEATER_2 TEMP_SENSOR_2
487
-  #define HEATER_2_USES_THERMISTOR 1
502
+  #define TEMP_SENSOR_2_THERMISTOR_ID TEMP_SENSOR_2
503
+  #define TEMP_SENSOR_2_IS_THERMISTOR 1
488 504
   #if TEMP_SENSOR_2 == 1000
489
-    #define HEATER_2_USER_THERMISTOR 1
505
+    #define TEMP_SENSOR_2_IS_CUSTOM 1
490 506
   #elif TEMP_SENSOR_2 == 998 || TEMP_SENSOR_2 == 999
491
-    #define HEATER_2_DUMMY_THERMISTOR 1
507
+    #define TEMP_SENSOR_2_IS_DUMMY 1
492 508
   #endif
493 509
 #else
494 510
   #undef HEATER_2_MINTEMP
@@ -496,20 +512,20 @@
496 512
 #endif
497 513
 
498 514
 #if TEMP_SENSOR_3 == -4
499
-  #define HEATER_3_USES_AD8495 1
515
+  #define TEMP_SENSOR_3_IS_AD8495 1
500 516
 #elif TEMP_SENSOR_3 == -3
501 517
   #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_3."
502 518
 #elif TEMP_SENSOR_3 == -2
503 519
   #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_3."
504 520
 #elif TEMP_SENSOR_3 == -1
505
-  #define HEATER_3_USES_AD595 1
521
+  #define TEMP_SENSOR_3_IS_AD595 1
506 522
 #elif TEMP_SENSOR_3 > 0
507
-  #define THERMISTOR_HEATER_3 TEMP_SENSOR_3
508
-  #define HEATER_3_USES_THERMISTOR 1
523
+  #define TEMP_SENSOR_3_THERMISTOR_ID TEMP_SENSOR_3
524
+  #define TEMP_SENSOR_3_IS_THERMISTOR 1
509 525
   #if TEMP_SENSOR_3 == 1000
510
-    #define HEATER_3_USER_THERMISTOR 1
526
+    #define TEMP_SENSOR_3_IS_CUSTOM 1
511 527
   #elif TEMP_SENSOR_3 == 998 || TEMP_SENSOR_3 == 999
512
-    #define HEATER_3_DUMMY_THERMISTOR 1
528
+    #define TEMP_SENSOR_3_IS_DUMMY 1
513 529
   #endif
514 530
 #else
515 531
   #undef HEATER_3_MINTEMP
@@ -517,20 +533,20 @@
517 533
 #endif
518 534
 
519 535
 #if TEMP_SENSOR_4 == -4
520
-  #define HEATER_4_USES_AD8495 1
536
+  #define TEMP_SENSOR_4_IS_AD8495 1
521 537
 #elif TEMP_SENSOR_4 == -3
522 538
   #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_4."
523 539
 #elif TEMP_SENSOR_4 == -2
524 540
   #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_4."
525 541
 #elif TEMP_SENSOR_4 == -1
526
-  #define HEATER_4_USES_AD595 1
542
+  #define TEMP_SENSOR_4_IS_AD595 1
527 543
 #elif TEMP_SENSOR_4 > 0
528
-  #define THERMISTOR_HEATER_4 TEMP_SENSOR_4
529
-  #define HEATER_4_USES_THERMISTOR 1
544
+  #define TEMP_SENSOR_4_THERMISTOR_ID TEMP_SENSOR_4
545
+  #define TEMP_SENSOR_4_IS_THERMISTOR 1
530 546
   #if TEMP_SENSOR_4 == 1000
531
-    #define HEATER_4_USER_THERMISTOR 1
547
+    #define TEMP_SENSOR_4_IS_CUSTOM 1
532 548
   #elif TEMP_SENSOR_4 == 998 || TEMP_SENSOR_4 == 999
533
-    #define HEATER_4_DUMMY_THERMISTOR 1
549
+    #define TEMP_SENSOR_4_IS_DUMMY 1
534 550
   #endif
535 551
 #else
536 552
   #undef HEATER_4_MINTEMP
@@ -538,20 +554,20 @@
538 554
 #endif
539 555
 
540 556
 #if TEMP_SENSOR_5 == -4
541
-  #define HEATER_5_USES_AD8495 1
557
+  #define TEMP_SENSOR_5_IS_AD8495 1
542 558
 #elif TEMP_SENSOR_5 == -3
543 559
   #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_5."
544 560
 #elif TEMP_SENSOR_5 == -2
545 561
   #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_5."
546 562
 #elif TEMP_SENSOR_5 == -1
547
-  #define HEATER_5_USES_AD595 1
563
+  #define TEMP_SENSOR_5_IS_AD595 1
548 564
 #elif TEMP_SENSOR_5 > 0
549
-  #define THERMISTOR_HEATER_5 TEMP_SENSOR_5
550
-  #define HEATER_5_USES_THERMISTOR 1
565
+  #define TEMP_SENSOR_5_THERMISTOR_ID TEMP_SENSOR_5
566
+  #define TEMP_SENSOR_5_IS_THERMISTOR 1
551 567
   #if TEMP_SENSOR_5 == 1000
552
-    #define HEATER_5_USER_THERMISTOR 1
568
+    #define TEMP_SENSOR_5_IS_CUSTOM 1
553 569
   #elif TEMP_SENSOR_5 == 998 || TEMP_SENSOR_5 == 999
554
-    #define HEATER_5_DUMMY_THERMISTOR 1
570
+    #define TEMP_SENSOR_5_IS_DUMMY 1
555 571
   #endif
556 572
 #else
557 573
   #undef HEATER_5_MINTEMP
@@ -559,20 +575,20 @@
559 575
 #endif
560 576
 
561 577
 #if TEMP_SENSOR_6 == -4
562
-  #define HEATER_6_USES_AD8495 1
578
+  #define TEMP_SENSOR_6_IS_AD8495 1
563 579
 #elif TEMP_SENSOR_6 == -3
564 580
   #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_6."
565 581
 #elif TEMP_SENSOR_6 == -2
566 582
   #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_6."
567 583
 #elif TEMP_SENSOR_6 == -1
568
-  #define HEATER_6_USES_AD595 1
584
+  #define TEMP_SENSOR_6_IS_AD595 1
569 585
 #elif TEMP_SENSOR_6 > 0
570
-  #define THERMISTOR_HEATER_6 TEMP_SENSOR_6
571
-  #define HEATER_6_USES_THERMISTOR 1
586
+  #define TEMP_SENSOR_6_THERMISTOR_ID TEMP_SENSOR_6
587
+  #define TEMP_SENSOR_6_IS_THERMISTOR 1
572 588
   #if TEMP_SENSOR_6 == 1000
573
-    #define HEATER_6_USER_THERMISTOR 1
589
+    #define TEMP_SENSOR_6_IS_CUSTOM 1
574 590
   #elif TEMP_SENSOR_6 == 998 || TEMP_SENSOR_6 == 999
575
-    #define HEATER_6_DUMMY_THERMISTOR 1
591
+    #define TEMP_SENSOR_6_IS_DUMMY 1
576 592
   #endif
577 593
 #else
578 594
   #undef HEATER_6_MINTEMP
@@ -580,20 +596,20 @@
580 596
 #endif
581 597
 
582 598
 #if TEMP_SENSOR_7 == -4
583
-  #define HEATER_7_USES_AD8495 1
599
+  #define TEMP_SENSOR_7_IS_AD8495 1
584 600
 #elif TEMP_SENSOR_7 == -3
585 601
   #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_7."
586 602
 #elif TEMP_SENSOR_7 == -2
587 603
   #error "MAX7775 Thermocouples (-2) not supported for TEMP_SENSOR_7."
588 604
 #elif TEMP_SENSOR_7 == -1
589
-  #define HEATER_7_USES_AD595 1
605
+  #define TEMP_SENSOR_7_IS_AD595 1
590 606
 #elif TEMP_SENSOR_7 > 0
591
-  #define THERMISTOR_HEATER_7 TEMP_SENSOR_7
592
-  #define HEATER_7_USES_THERMISTOR 1
607
+  #define TEMP_SENSOR_7_THERMISTOR_ID TEMP_SENSOR_7
608
+  #define TEMP_SENSOR_7_IS_THERMISTOR 1
593 609
   #if TEMP_SENSOR_7 == 1000
594
-    #define HEATER_7_USER_THERMISTOR 1
610
+    #define TEMP_SENSOR_7_IS_CUSTOM 1
595 611
   #elif TEMP_SENSOR_7 == 998 || TEMP_SENSOR_7 == 999
596
-    #define HEATER_7_DUMMY_THERMISTOR 1
612
+    #define TEMP_SENSOR_7_IS_DUMMY 1
597 613
   #endif
598 614
 #else
599 615
   #undef HEATER_7_MINTEMP
@@ -601,20 +617,20 @@
601 617
 #endif
602 618
 
603 619
 #if TEMP_SENSOR_BED == -4
604
-  #define HEATER_BED_USES_AD8495 1
620
+  #define TEMP_SENSOR_BED_IS_AD8495 1
605 621
 #elif TEMP_SENSOR_BED == -3
606 622
   #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_BED."
607 623
 #elif TEMP_SENSOR_BED == -2
608 624
   #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_BED."
609 625
 #elif TEMP_SENSOR_BED == -1
610
-  #define HEATER_BED_USES_AD595 1
626
+  #define TEMP_SENSOR_BED_IS_AD595 1
611 627
 #elif TEMP_SENSOR_BED > 0
612
-  #define THERMISTORBED TEMP_SENSOR_BED
613
-  #define HEATER_BED_USES_THERMISTOR 1
628
+  #define TEMP_SENSOR_BED_THERMISTOR_ID TEMP_SENSOR_BED
629
+  #define TEMP_SENSOR_BED_IS_THERMISTOR 1
614 630
   #if TEMP_SENSOR_BED == 1000
615
-    #define HEATER_BED_USER_THERMISTOR 1
631
+    #define TEMP_SENSOR_BED_IS_CUSTOM 1
616 632
   #elif TEMP_SENSOR_BED == 998 || TEMP_SENSOR_BED == 999
617
-    #define HEATER_BED_DUMMY_THERMISTOR 1
633
+    #define TEMP_SENSOR_BED_IS_DUMMY 1
618 634
   #endif
619 635
 #else
620 636
   #undef BED_MINTEMP
@@ -622,20 +638,20 @@
622 638
 #endif
623 639
 
624 640
 #if TEMP_SENSOR_CHAMBER == -4
625
-  #define HEATER_CHAMBER_USES_AD8495 1
641
+  #define TEMP_SENSOR_CHAMBER_IS_AD8495 1
626 642
 #elif TEMP_SENSOR_CHAMBER == -3
627 643
   #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_CHAMBER."
628 644
 #elif TEMP_SENSOR_CHAMBER == -2
629 645
   #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_CHAMBER."
630 646
 #elif TEMP_SENSOR_CHAMBER == -1
631
-  #define HEATER_CHAMBER_USES_AD595 1
647
+  #define TEMP_SENSOR_CHAMBER_IS_AD595 1
632 648
 #elif TEMP_SENSOR_CHAMBER > 0
633
-  #define THERMISTORCHAMBER TEMP_SENSOR_CHAMBER
634
-  #define HEATER_CHAMBER_USES_THERMISTOR 1
649
+  #define TEMP_SENSOR_CHAMBER_THERMISTOR_ID TEMP_SENSOR_CHAMBER
650
+  #define TEMP_SENSOR_CHAMBER_IS_THERMISTOR 1
635 651
   #if TEMP_SENSOR_CHAMBER == 1000
636
-    #define HEATER_CHAMBER_USER_THERMISTOR 1
652
+    #define TEMP_SENSOR_CHAMBER_IS_CUSTOM 1
637 653
   #elif TEMP_SENSOR_CHAMBER == 998 || TEMP_SENSOR_CHAMBER == 999
638
-    #define HEATER_CHAMBER_DUMMY_THERMISTOR 1
654
+    #define TEMP_SENSOR_CHAMBER_IS_DUMMY 1
639 655
   #endif
640 656
 #else
641 657
   #undef CHAMBER_MINTEMP
@@ -643,20 +659,20 @@
643 659
 #endif
644 660
 
645 661
 #if TEMP_SENSOR_PROBE == -4
646
-  #define HEATER_PROBE_USES_AD8495 1
662
+  #define TEMP_SENSOR_PROBE_IS_AD8495 1
647 663
 #elif TEMP_SENSOR_PROBE == -3
648 664
   #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_PROBE."
649 665
 #elif TEMP_SENSOR_PROBE == -2
650 666
   #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_PROBE."
651 667
 #elif TEMP_SENSOR_PROBE == -1
652
-  #define HEATER_PROBE_USES_AD595 1
668
+  #define TEMP_SENSOR_PROBE_IS_AD595 1
653 669
 #elif TEMP_SENSOR_PROBE > 0
654
-  #define THERMISTORPROBE TEMP_SENSOR_PROBE
655
-  #define HEATER_PROBE_USES_THERMISTOR 1
670
+  #define TEMP_SENSOR_PROBE_THERMISTOR_ID TEMP_SENSOR_PROBE
671
+  #define TEMP_SENSOR_PROBE_IS_THERMISTOR 1
656 672
   #if TEMP_SENSOR_PROBE == 1000
657
-    #define HEATER_PROBE_USER_THERMISTOR 1
673
+    #define TEMP_SENSOR_PROBE_IS_CUSTOM 1
658 674
   #elif TEMP_SENSOR_PROBE == 998 || TEMP_SENSOR_PROBE == 999
659
-    #define HEATER_PROBE_DUMMY_THERMISTOR 1
675
+    #define TEMP_SENSOR_PROBE_IS_DUMMY 1
660 676
   #endif
661 677
 #endif
662 678
 
@@ -1792,7 +1808,7 @@
1792 1808
 //
1793 1809
 // ADC Temp Sensors (Thermistor or Thermocouple with amplifier ADC interface)
1794 1810
 //
1795
-#define HAS_ADC_TEST(P) (PIN_EXISTS(TEMP_##P) && TEMP_SENSOR_##P != 0 && NONE(HEATER_##P##_USES_MAX6675, HEATER_##P##_DUMMY_THERMISTOR))
1811
+#define HAS_ADC_TEST(P) (PIN_EXISTS(TEMP_##P) && TEMP_SENSOR_##P != 0 && NONE(TEMP_SENSOR_##P##_IS_MAX_TC, TEMP_SENSOR_##P##_IS_DUMMY))
1796 1812
 #if HAS_ADC_TEST(0)
1797 1813
   #define HAS_TEMP_ADC_0 1
1798 1814
 #endif
@@ -1827,7 +1843,7 @@
1827 1843
   #define HAS_TEMP_ADC_CHAMBER 1
1828 1844
 #endif
1829 1845
 
1830
-#define HAS_TEMP(N) ANY(HAS_TEMP_ADC_##N, HEATER_##N##_USES_MAX6675, HEATER_##N##_DUMMY_THERMISTOR)
1846
+#define HAS_TEMP(N) ANY(HAS_TEMP_ADC_##N, TEMP_SENSOR_##N##_IS_MAX_TC, TEMP_SENSOR_##N##_IS_DUMMY)
1831 1847
 #if HAS_HOTEND && HAS_TEMP(0)
1832 1848
   #define HAS_TEMP_HOTEND 1
1833 1849
 #endif

+ 27
- 25
Marlin/src/inc/SanityCheck.h View File

@@ -1698,46 +1698,48 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
1698 1698
 /**
1699 1699
  * Required custom thermistor settings
1700 1700
  */
1701
-#if   HEATER_0_USER_THERMISTOR && !(defined(HOTEND0_PULLUP_RESISTOR_OHMS) && defined(HOTEND0_RESISTANCE_25C_OHMS) && defined(HOTEND0_BETA))
1701
+#if   TEMP_SENSOR_0_IS_CUSTOM && !(defined(HOTEND0_PULLUP_RESISTOR_OHMS) && defined(HOTEND0_RESISTANCE_25C_OHMS) && defined(HOTEND0_BETA))
1702 1702
   #error "TEMP_SENSOR_0 1000 requires HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS and HOTEND0_BETA in Configuration_adv.h."
1703
-#elif HEATER_1_USER_THERMISTOR && !(defined(HOTEND1_PULLUP_RESISTOR_OHMS) && defined(HOTEND1_RESISTANCE_25C_OHMS) && defined(HOTEND1_BETA))
1703
+#elif TEMP_SENSOR_1_IS_CUSTOM && !(defined(HOTEND1_PULLUP_RESISTOR_OHMS) && defined(HOTEND1_RESISTANCE_25C_OHMS) && defined(HOTEND1_BETA))
1704 1704
   #error "TEMP_SENSOR_1 1000 requires HOTEND1_PULLUP_RESISTOR_OHMS, HOTEND1_RESISTANCE_25C_OHMS and HOTEND1_BETA in Configuration_adv.h."
1705
-#elif HEATER_2_USER_THERMISTOR && !(defined(HOTEND2_PULLUP_RESISTOR_OHMS) && defined(HOTEND2_RESISTANCE_25C_OHMS) && defined(HOTEND2_BETA))
1705
+#elif TEMP_SENSOR_2_IS_CUSTOM && !(defined(HOTEND2_PULLUP_RESISTOR_OHMS) && defined(HOTEND2_RESISTANCE_25C_OHMS) && defined(HOTEND2_BETA))
1706 1706
   #error "TEMP_SENSOR_2 1000 requires HOTEND2_PULLUP_RESISTOR_OHMS, HOTEND2_RESISTANCE_25C_OHMS and HOTEND2_BETA in Configuration_adv.h."
1707
-#elif HEATER_3_USER_THERMISTOR && !(defined(HOTEND3_PULLUP_RESISTOR_OHMS) && defined(HOTEND3_RESISTANCE_25C_OHMS) && defined(HOTEND3_BETA))
1707
+#elif TEMP_SENSOR_3_IS_CUSTOM && !(defined(HOTEND3_PULLUP_RESISTOR_OHMS) && defined(HOTEND3_RESISTANCE_25C_OHMS) && defined(HOTEND3_BETA))
1708 1708
   #error "TEMP_SENSOR_3 1000 requires HOTEND3_PULLUP_RESISTOR_OHMS, HOTEND3_RESISTANCE_25C_OHMS and HOTEND3_BETA in Configuration_adv.h."
1709
-#elif HEATER_4_USER_THERMISTOR && !(defined(HOTEND4_PULLUP_RESISTOR_OHMS) && defined(HOTEND4_RESISTANCE_25C_OHMS) && defined(HOTEND4_BETA))
1709
+#elif TEMP_SENSOR_4_IS_CUSTOM && !(defined(HOTEND4_PULLUP_RESISTOR_OHMS) && defined(HOTEND4_RESISTANCE_25C_OHMS) && defined(HOTEND4_BETA))
1710 1710
   #error "TEMP_SENSOR_4 1000 requires HOTEND4_PULLUP_RESISTOR_OHMS, HOTEND4_RESISTANCE_25C_OHMS and HOTEND4_BETA in Configuration_adv.h."
1711
-#elif HEATER_5_USER_THERMISTOR && !(defined(HOTEND5_PULLUP_RESISTOR_OHMS) && defined(HOTEND5_RESISTANCE_25C_OHMS) && defined(HOTEND5_BETA))
1711
+#elif TEMP_SENSOR_5_IS_CUSTOM && !(defined(HOTEND5_PULLUP_RESISTOR_OHMS) && defined(HOTEND5_RESISTANCE_25C_OHMS) && defined(HOTEND5_BETA))
1712 1712
   #error "TEMP_SENSOR_5 1000 requires HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS and HOTEND5_BETA in Configuration_adv.h."
1713
-#elif HEATER_6_USER_THERMISTOR && !(defined(HOTEND6_PULLUP_RESISTOR_OHMS) && defined(HOTEND6_RESISTANCE_25C_OHMS) && defined(HOTEND6_BETA))
1713
+#elif TEMP_SENSOR_6_IS_CUSTOM && !(defined(HOTEND6_PULLUP_RESISTOR_OHMS) && defined(HOTEND6_RESISTANCE_25C_OHMS) && defined(HOTEND6_BETA))
1714 1714
   #error "TEMP_SENSOR_6 1000 requires HOTEND6_PULLUP_RESISTOR_OHMS, HOTEND6_RESISTANCE_25C_OHMS and HOTEND6_BETA in Configuration_adv.h."
1715
-#elif HEATER_7_USER_THERMISTOR && !(defined(HOTEND7_PULLUP_RESISTOR_OHMS) && defined(HOTEND7_RESISTANCE_25C_OHMS) && defined(HOTEND7_BETA))
1715
+#elif TEMP_SENSOR_7_IS_CUSTOM && !(defined(HOTEND7_PULLUP_RESISTOR_OHMS) && defined(HOTEND7_RESISTANCE_25C_OHMS) && defined(HOTEND7_BETA))
1716 1716
   #error "TEMP_SENSOR_7 1000 requires HOTEND7_PULLUP_RESISTOR_OHMS, HOTEND7_RESISTANCE_25C_OHMS and HOTEND7_BETA in Configuration_adv.h."
1717
-#elif HEATER_BED_USER_THERMISTOR && !(defined(BED_PULLUP_RESISTOR_OHMS) && defined(BED_RESISTANCE_25C_OHMS) && defined(BED_BETA))
1717
+#elif TEMP_SENSOR_BED_IS_CUSTOM && !(defined(BED_PULLUP_RESISTOR_OHMS) && defined(BED_RESISTANCE_25C_OHMS) && defined(BED_BETA))
1718 1718
   #error "TEMP_SENSOR_BED 1000 requires BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS and BED_BETA in Configuration_adv.h."
1719
-#elif HEATER_CHAMBER_USER_THERMISTOR && !(defined(CHAMBER_PULLUP_RESISTOR_OHMS) && defined(CHAMBER_RESISTANCE_25C_OHMS) && defined(CHAMBER_BETA))
1719
+#elif TEMP_SENSOR_CHAMBER_IS_CUSTOM && !(defined(CHAMBER_PULLUP_RESISTOR_OHMS) && defined(CHAMBER_RESISTANCE_25C_OHMS) && defined(CHAMBER_BETA))
1720 1720
   #error "TEMP_SENSOR_CHAMBER 1000 requires CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS and CHAMBER_BETA in Configuration_adv.h."
1721
+#elif TEMP_SENSOR_PROBE_IS_CUSTOM && !(defined(PROBE_PULLUP_RESISTOR_OHMS) && defined(PROBE_RESISTANCE_25C_OHMS) && defined(PROBE_BETA))
1722
+  #error "TEMP_SENSOR_PROBE 1000 requires PROBE_PULLUP_RESISTOR_OHMS, PROBE_RESISTANCE_25C_OHMS and PROBE_BETA in Configuration_adv.h."
1721 1723
 #endif
1722 1724
 
1723 1725
 /**
1724 1726
  * Pins and Sensor IDs must be set for each heater
1725 1727
  */
1726
-#if HEATER_0_USES_MAX6675 && !PIN_EXISTS(MAX6675_SS)
1727
-  #error "MAX6675_SS_PIN (required for TEMP_SENSOR_0) not defined for this board."
1728
-#elif HAS_HOTEND && !HAS_TEMP_HOTEND && !HEATER_0_DUMMY_THERMISTOR
1728
+#if TEMP_SENSOR_0_IS_MAX6675 && !ANY_PIN(MAX6675_SS, MAX31855_CS, MAX31865_CS, MAX6675_CS)
1729
+  #error "TEMP_SENSOR_0 requires a MAX6675_SS_PIN, MAX6675_CS_PIN, MAX31855_CS_PIN, or MAX31865_CS_PIN."
1730
+#elif HAS_HOTEND && !HAS_TEMP_HOTEND && !TEMP_SENSOR_0_IS_DUMMY
1729 1731
   #error "TEMP_0_PIN (required for TEMP_SENSOR_0) not defined for this board."
1730 1732
 #elif EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL) && !HAS_HEATER_1
1731 1733
   #error "HEATER_1_PIN is not defined. TEMP_SENSOR_1 might not be set, or the board (not EEB / EEF?) doesn't define a pin."
1732 1734
 #endif
1733 1735
 
1734 1736
 #if HAS_MULTI_HOTEND
1735
-  #if HEATER_1_USES_MAX6675 && !PIN_EXISTS(MAX6675_SS2)
1736
-    #error "MAX6675_SS2_PIN (required for TEMP_SENSOR_1) not defined for this board."
1737
+  #if TEMP_SENSOR_1_IS_MAX6675 && !ANY_PIN(MAX6675_SS2, MAX31855_CS2, MAX31865_CS2, MAX6675_CS2)
1738
+    #error "TEMP_SENSOR_1 requires a MAX6675_SS2_PIN, MAX6675_CS2_PIN, MAX31855_CS2_PIN, or MAX31865_CS2_PIN."
1737 1739
   #elif TEMP_SENSOR_1 == 0
1738 1740
     #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
1739
-  #elif !ANY_PIN(TEMP_1, MAX6675_SS2) && !HEATER_1_DUMMY_THERMISTOR
1740
-    #error "TEMP_1_PIN not defined for this board."
1741
+  #elif !ANY_PIN(TEMP_1, MAX6675_SS2) && !TEMP_SENSOR_1_IS_DUMMY
1742
+    #error "TEMP_1_PIN or MAX6675_SS2_PIN not defined for this board."
1741 1743
   #elif ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
1742 1744
     #error "HOTENDS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT."
1743 1745
   #endif
@@ -1746,7 +1748,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
1746 1748
       #error "TEMP_SENSOR_2 is required with 3 or more HOTENDS."
1747 1749
     #elif !HAS_HEATER_2
1748 1750
       #error "HEATER_2_PIN not defined for this board."
1749
-    #elif !PIN_EXISTS(TEMP_2) && !HEATER_2_DUMMY_THERMISTOR
1751
+    #elif !PIN_EXISTS(TEMP_2) && !TEMP_SENSOR_2_IS_DUMMY
1750 1752
       #error "TEMP_2_PIN not defined for this board."
1751 1753
     #endif
1752 1754
     #if HOTENDS > 3
@@ -1754,7 +1756,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
1754 1756
         #error "TEMP_SENSOR_3 is required with 4 or more HOTENDS."
1755 1757
       #elif !HAS_HEATER_3
1756 1758
         #error "HEATER_3_PIN not defined for this board."
1757
-      #elif !PIN_EXISTS(TEMP_3) && !HEATER_3_DUMMY_THERMISTOR
1759
+      #elif !PIN_EXISTS(TEMP_3) && !TEMP_SENSOR_3_IS_DUMMY
1758 1760
         #error "TEMP_3_PIN not defined for this board."
1759 1761
       #endif
1760 1762
       #if HOTENDS > 4
@@ -1762,7 +1764,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
1762 1764
           #error "TEMP_SENSOR_4 is required with 5 or more HOTENDS."
1763 1765
         #elif !HAS_HEATER_4
1764 1766
           #error "HEATER_4_PIN not defined for this board."
1765
-        #elif !PIN_EXISTS(TEMP_4) && !HEATER_4_DUMMY_THERMISTOR
1767
+        #elif !PIN_EXISTS(TEMP_4) && !TEMP_SENSOR_4_IS_DUMMY
1766 1768
           #error "TEMP_4_PIN not defined for this board."
1767 1769
         #endif
1768 1770
         #if HOTENDS > 5
@@ -1770,7 +1772,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
1770 1772
             #error "TEMP_SENSOR_5 is required with 6 HOTENDS."
1771 1773
           #elif !HAS_HEATER_5
1772 1774
             #error "HEATER_5_PIN not defined for this board."
1773
-          #elif !PIN_EXISTS(TEMP_5) && !HEATER_5_DUMMY_THERMISTOR
1775
+          #elif !PIN_EXISTS(TEMP_5) && !TEMP_SENSOR_5_IS_DUMMY
1774 1776
             #error "TEMP_5_PIN not defined for this board."
1775 1777
           #endif
1776 1778
           #if HOTENDS > 6
@@ -1778,7 +1780,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
1778 1780
               #error "TEMP_SENSOR_6 is required with 6 HOTENDS."
1779 1781
             #elif !HAS_HEATER_6
1780 1782
               #error "HEATER_6_PIN not defined for this board."
1781
-            #elif !PIN_EXISTS(TEMP_6) && !HEATER_6_DUMMY_THERMISTOR
1783
+            #elif !PIN_EXISTS(TEMP_6) && !TEMP_SENSOR_6_IS_DUMMY
1782 1784
               #error "TEMP_6_PIN not defined for this board."
1783 1785
             #endif
1784 1786
             #if HOTENDS > 7
@@ -1786,7 +1788,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
1786 1788
                 #error "TEMP_SENSOR_7 is required with 7 HOTENDS."
1787 1789
               #elif !HAS_HEATER_7
1788 1790
                 #error "HEATER_7_PIN not defined for this board."
1789
-              #elif !PIN_EXISTS(TEMP_7) && !HEATER_7_DUMMY_THERMISTOR
1791
+              #elif !PIN_EXISTS(TEMP_7) && !TEMP_SENSOR_7_IS_DUMMY
1790 1792
                 #error "TEMP_7_PIN not defined for this board."
1791 1793
               #endif
1792 1794
             #elif TEMP_SENSOR_7 != 0
@@ -1895,9 +1897,9 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
1895 1897
   #error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT."
1896 1898
 #endif
1897 1899
 
1898
-#if MAX6675_0_IS_MAX31865 && !(defined(MAX31865_SENSOR_OHMS_0) && defined(MAX31865_CALIBRATION_OHMS_0))
1900
+#if TEMP_SENSOR_0_IS_MAX31865 && !(defined(MAX31865_SENSOR_OHMS_0) && defined(MAX31865_CALIBRATION_OHMS_0))
1899 1901
   #error "MAX31865_SENSOR_OHMS_0 and MAX31865_CALIBRATION_OHMS_0 must be set if TEMP_SENSOR_0 is MAX31865."
1900
-#elif MAX6675_1_IS_MAX31865 && !(defined(MAX31865_SENSOR_OHMS_1) && defined(MAX31865_CALIBRATION_OHMS_1))
1902
+#elif TEMP_SENSOR_1_IS_MAX31865 && !(defined(MAX31865_SENSOR_OHMS_1) && defined(MAX31865_CALIBRATION_OHMS_1))
1901 1903
   #error "MAX31865_SENSOR_OHMS_1 and MAX31865_CALIBRATION_OHMS_1 must be set if TEMP_SENSOR_1 is MAX31865."
1902 1904
 #endif
1903 1905
 

+ 183
- 178
Marlin/src/module/temperature.cpp View File

@@ -47,12 +47,12 @@
47 47
   #include "../lcd/extui/ui_api.h"
48 48
 #endif
49 49
 
50
-#if MAX6675_0_IS_MAX31865 || MAX6675_1_IS_MAX31865
50
+#if HAS_MAX31865
51 51
   #include <Adafruit_MAX31865.h>
52
-  #if MAX6675_0_IS_MAX31865 && !defined(MAX31865_CS_PIN) && PIN_EXISTS(MAX6675_SS)
52
+  #if TEMP_SENSOR_0_IS_MAX31865 && !defined(MAX31865_CS_PIN) && PIN_EXISTS(MAX6675_SS)
53 53
     #define MAX31865_CS_PIN   MAX6675_SS_PIN
54 54
   #endif
55
-  #if MAX6675_1_IS_MAX31865 && !defined(MAX31865_CS2_PIN) && PIN_EXISTS(MAX6675_SS2)
55
+  #if TEMP_SENSOR_1_IS_MAX31865 && !defined(MAX31865_CS2_PIN) && PIN_EXISTS(MAX6675_SS2)
56 56
     #define MAX31865_CS2_PIN  MAX6675_SS2_PIN
57 57
   #endif
58 58
   #ifndef MAX31865_MOSI_PIN
@@ -64,16 +64,16 @@
64 64
   #ifndef MAX31865_SCK_PIN
65 65
     #define MAX31865_SCK_PIN  MAX6675_SCK_PIN
66 66
   #endif
67
-  #if MAX6675_0_IS_MAX31865 && PIN_EXISTS(MAX31865_CS)
68
-    #define HAS_MAX31865 1
67
+  #if TEMP_SENSOR_0_IS_MAX31865 && PIN_EXISTS(MAX31865_CS)
68
+    #define HAS_MAX31865_TEMP 1
69 69
     Adafruit_MAX31865 max31865_0 = Adafruit_MAX31865(MAX31865_CS_PIN
70 70
       #if MAX31865_CS_PIN != MAX6675_SS_PIN
71 71
         , MAX31865_MOSI_PIN, MAX31865_MISO_PIN, MAX31865_SCK_PIN // For software SPI also set MOSI/MISO/SCK
72 72
       #endif
73 73
     );
74 74
   #endif
75
-  #if MAX6675_1_IS_MAX31865 && PIN_EXISTS(MAX31865_CS2)
76
-    #define HAS_MAX31865 1
75
+  #if TEMP_SENSOR_1_IS_MAX31865 && PIN_EXISTS(MAX31865_CS2)
76
+    #define HAS_MAX31865_TEMP 1
77 77
     Adafruit_MAX31865 max31865_1 = Adafruit_MAX31865(MAX31865_CS2_PIN
78 78
       #if MAX31865_CS2_PIN != MAX6675_SS2_PIN
79 79
         , MAX31865_MOSI_PIN, MAX31865_MISO_PIN, MAX31865_SCK_PIN // For software SPI also set MOSI/MISO/SCK
@@ -82,11 +82,11 @@
82 82
   #endif
83 83
 #endif
84 84
 
85
-#if EITHER(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675) && PINS_EXIST(MAX6675_SCK, MAX6675_DO)
86
-  #define MAX6675_SEPARATE_SPI 1
85
+#if (TEMP_SENSOR_0_IS_MAX_TC || TEMP_SENSOR_1_IS_MAX_TC) && PINS_EXIST(MAX6675_SCK, MAX6675_DO) && NO_THERMO_TEMPS
86
+  #define THERMO_SEPARATE_SPI 1
87 87
 #endif
88 88
 
89
-#if MAX6675_SEPARATE_SPI
89
+#if THERMO_SEPARATE_SPI
90 90
   #include "../libs/private_spi.h"
91 91
 #endif
92 92
 
@@ -132,20 +132,20 @@
132 132
   #include "./servo.h"
133 133
 #endif
134 134
 
135
-#if ANY(HEATER_0_USES_THERMISTOR, HEATER_1_USES_THERMISTOR, HEATER_2_USES_THERMISTOR, HEATER_3_USES_THERMISTOR, \
136
-        HEATER_4_USES_THERMISTOR, HEATER_5_USES_THERMISTOR, HEATER_6_USES_THERMISTOR, HEATER_7_USES_THERMISTOR )
135
+#if ANY(TEMP_SENSOR_0_IS_THERMISTOR, TEMP_SENSOR_1_IS_THERMISTOR, TEMP_SENSOR_2_IS_THERMISTOR, TEMP_SENSOR_3_IS_THERMISTOR, \
136
+        TEMP_SENSOR_4_IS_THERMISTOR, TEMP_SENSOR_5_IS_THERMISTOR, TEMP_SENSOR_6_IS_THERMISTOR, TEMP_SENSOR_7_IS_THERMISTOR )
137 137
   #define HAS_HOTEND_THERMISTOR 1
138 138
 #endif
139 139
 
140 140
 #if HAS_HOTEND_THERMISTOR
141 141
   #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
142
-    static const temp_entry_t* heater_ttbl_map[2] = { HEATER_0_TEMPTABLE, HEATER_1_TEMPTABLE };
143
-    static constexpr uint8_t heater_ttbllen_map[2] = { HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN };
142
+    static const temp_entry_t* heater_ttbl_map[2] = { TEMPTABLE_0, TEMPTABLE_1 };
143
+    static constexpr uint8_t heater_ttbllen_map[2] = { TEMPTABLE_0_LEN, TEMPTABLE_1_LEN };
144 144
   #else
145
-    #define NEXT_TEMPTABLE(N) ,HEATER_##N##_TEMPTABLE
146
-    #define NEXT_TEMPTABLE_LEN(N) ,HEATER_##N##_TEMPTABLE_LEN
147
-    static const temp_entry_t* heater_ttbl_map[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_TEMPTABLE REPEAT_S(1, HOTENDS, NEXT_TEMPTABLE));
148
-    static constexpr uint8_t heater_ttbllen_map[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_TEMPTABLE_LEN REPEAT_S(1, HOTENDS, NEXT_TEMPTABLE_LEN));
145
+    #define NEXT_TEMPTABLE(N) ,TEMPTABLE_##N
146
+    #define NEXT_TEMPTABLE_LEN(N) ,TEMPTABLE_##N##_LEN
147
+    static const temp_entry_t* heater_ttbl_map[HOTENDS] = ARRAY_BY_HOTENDS(TEMPTABLE_0 REPEAT_S(1, HOTENDS, NEXT_TEMPTABLE));
148
+    static constexpr uint8_t heater_ttbllen_map[HOTENDS] = ARRAY_BY_HOTENDS(TEMPTABLE_0_LEN REPEAT_S(1, HOTENDS, NEXT_TEMPTABLE_LEN));
149 149
   #endif
150 150
 #endif
151 151
 
@@ -285,10 +285,10 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY,
285 285
   bed_info_t Temperature::temp_bed; // = { 0 }
286 286
   // Init min and max temp with extreme values to prevent false errors during startup
287 287
   #ifdef BED_MINTEMP
288
-    int16_t Temperature::mintemp_raw_BED = HEATER_BED_RAW_LO_TEMP;
288
+    int16_t Temperature::mintemp_raw_BED = TEMP_SENSOR_BED_RAW_LO_TEMP;
289 289
   #endif
290 290
   #ifdef BED_MAXTEMP
291
-    int16_t Temperature::maxtemp_raw_BED = HEATER_BED_RAW_HI_TEMP;
291
+    int16_t Temperature::maxtemp_raw_BED = TEMP_SENSOR_BED_RAW_HI_TEMP;
292 292
   #endif
293 293
   TERN_(WATCH_BED, bed_watch_t Temperature::watch_bed); // = { 0 }
294 294
   IF_DISABLED(PIDTEMPBED, millis_t Temperature::next_bed_check_ms);
@@ -303,10 +303,10 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY,
303 303
     millis_t next_cool_check_ms_2 = 0;
304 304
     float old_temp = 9999;
305 305
     #ifdef CHAMBER_MINTEMP
306
-      int16_t Temperature::mintemp_raw_CHAMBER = HEATER_CHAMBER_RAW_LO_TEMP;
306
+      int16_t Temperature::mintemp_raw_CHAMBER = TEMP_SENSOR_CHAMBER_RAW_LO_TEMP;
307 307
     #endif
308 308
     #ifdef CHAMBER_MAXTEMP
309
-      int16_t Temperature::maxtemp_raw_CHAMBER = HEATER_CHAMBER_RAW_HI_TEMP;
309
+      int16_t Temperature::maxtemp_raw_CHAMBER = TEMP_SENSOR_CHAMBER_RAW_HI_TEMP;
310 310
     #endif
311 311
     #if WATCH_CHAMBER
312 312
       chamber_watch_t Temperature::watch_chamber{0};
@@ -347,18 +347,18 @@ volatile bool Temperature::raw_temps_ready = false;
347 347
   lpq_ptr_t Temperature::lpq_ptr = 0;
348 348
 #endif
349 349
 
350
-#define TEMPDIR(N) ((HEATER_##N##_RAW_LO_TEMP) < (HEATER_##N##_RAW_HI_TEMP) ? 1 : -1)
350
+#define TEMPDIR(N) ((TEMP_SENSOR_##N##_RAW_LO_TEMP) < (TEMP_SENSOR_##N##_RAW_HI_TEMP) ? 1 : -1)
351 351
 
352 352
 #if HAS_HOTEND
353 353
   // Init mintemp and maxtemp with extreme values to prevent false errors during startup
354
-  constexpr temp_range_t sensor_heater_0 { HEATER_0_RAW_LO_TEMP, HEATER_0_RAW_HI_TEMP, 0, 16383 },
355
-                         sensor_heater_1 { HEATER_1_RAW_LO_TEMP, HEATER_1_RAW_HI_TEMP, 0, 16383 },
356
-                         sensor_heater_2 { HEATER_2_RAW_LO_TEMP, HEATER_2_RAW_HI_TEMP, 0, 16383 },
357
-                         sensor_heater_3 { HEATER_3_RAW_LO_TEMP, HEATER_3_RAW_HI_TEMP, 0, 16383 },
358
-                         sensor_heater_4 { HEATER_4_RAW_LO_TEMP, HEATER_4_RAW_HI_TEMP, 0, 16383 },
359
-                         sensor_heater_5 { HEATER_5_RAW_LO_TEMP, HEATER_5_RAW_HI_TEMP, 0, 16383 },
360
-                         sensor_heater_6 { HEATER_6_RAW_LO_TEMP, HEATER_6_RAW_HI_TEMP, 0, 16383 },
361
-                         sensor_heater_7 { HEATER_7_RAW_LO_TEMP, HEATER_7_RAW_HI_TEMP, 0, 16383 };
354
+  constexpr temp_range_t sensor_heater_0 { TEMP_SENSOR_0_RAW_LO_TEMP, TEMP_SENSOR_0_RAW_HI_TEMP, 0, 16383 },
355
+                         sensor_heater_1 { TEMP_SENSOR_1_RAW_LO_TEMP, TEMP_SENSOR_1_RAW_HI_TEMP, 0, 16383 },
356
+                         sensor_heater_2 { TEMP_SENSOR_2_RAW_LO_TEMP, TEMP_SENSOR_2_RAW_HI_TEMP, 0, 16383 },
357
+                         sensor_heater_3 { TEMP_SENSOR_3_RAW_LO_TEMP, TEMP_SENSOR_3_RAW_HI_TEMP, 0, 16383 },
358
+                         sensor_heater_4 { TEMP_SENSOR_4_RAW_LO_TEMP, TEMP_SENSOR_4_RAW_HI_TEMP, 0, 16383 },
359
+                         sensor_heater_5 { TEMP_SENSOR_5_RAW_LO_TEMP, TEMP_SENSOR_5_RAW_HI_TEMP, 0, 16383 },
360
+                         sensor_heater_6 { TEMP_SENSOR_6_RAW_LO_TEMP, TEMP_SENSOR_6_RAW_HI_TEMP, 0, 16383 },
361
+                         sensor_heater_7 { TEMP_SENSOR_7_RAW_LO_TEMP, TEMP_SENSOR_7_RAW_HI_TEMP, 0, 16383 };
362 362
 
363 363
   temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0, sensor_heater_1, sensor_heater_2, sensor_heater_3, sensor_heater_4, sensor_heater_5, sensor_heater_6, sensor_heater_7);
364 364
 #endif
@@ -1083,13 +1083,13 @@ void Temperature::manage_heater() {
1083 1083
   updateTemperaturesFromRawValues(); // also resets the watchdog
1084 1084
 
1085 1085
   #if DISABLED(IGNORE_THERMOCOUPLE_ERRORS)
1086
-    #if HEATER_0_USES_MAX6675
1087
-      if (temp_hotend[0].celsius > _MIN(HEATER_0_MAXTEMP, HEATER_0_MAX6675_TMAX - 1.0)) max_temp_error(H_E0);
1088
-      if (temp_hotend[0].celsius < _MAX(HEATER_0_MINTEMP, HEATER_0_MAX6675_TMIN + .01)) min_temp_error(H_E0);
1086
+    #if TEMP_SENSOR_0_IS_MAX_TC
1087
+      if (temp_hotend[0].celsius > _MIN(HEATER_0_MAXTEMP, TEMP_SENSOR_0_MAX_TC_TMAX - 1.0)) max_temp_error(H_E0);
1088
+      if (temp_hotend[0].celsius < _MAX(HEATER_0_MINTEMP, TEMP_SENSOR_0_MAX_TC_TMIN + .01)) min_temp_error(H_E0);
1089 1089
     #endif
1090
-    #if HEATER_1_USES_MAX6675
1091
-      if (temp_hotend[1].celsius > _MIN(HEATER_1_MAXTEMP, HEATER_1_MAX6675_TMAX - 1.0)) max_temp_error(H_E1);
1092
-      if (temp_hotend[1].celsius < _MAX(HEATER_1_MINTEMP, HEATER_1_MAX6675_TMIN + .01)) min_temp_error(H_E1);
1090
+    #if TEMP_SENSOR_1_IS_MAX_TC
1091
+      if (temp_hotend[1].celsius > _MIN(HEATER_1_MAXTEMP, TEMP_SENSOR_1_MAX_TC_TMAX - 1.0)) max_temp_error(H_E1);
1092
+      if (temp_hotend[1].celsius < _MAX(HEATER_1_MINTEMP, TEMP_SENSOR_1_MAX_TC_TMIN + .01)) min_temp_error(H_E1);
1093 1093
     #endif
1094 1094
   #endif
1095 1095
 
@@ -1373,36 +1373,39 @@ void Temperature::manage_heater() {
1373 1373
 
1374 1374
   void Temperature::reset_user_thermistors() {
1375 1375
     user_thermistor_t default_user_thermistor[USER_THERMISTORS] = {
1376
-      #if HEATER_0_USER_THERMISTOR
1376
+      #if TEMP_SENSOR_0_IS_CUSTOM
1377 1377
         { true, 0, 0, HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS, 0, 0, HOTEND0_BETA, 0 },
1378 1378
       #endif
1379
-      #if HEATER_1_USER_THERMISTOR
1379
+      #if TEMP_SENSOR_1_IS_CUSTOM
1380 1380
         { true, 0, 0, HOTEND1_PULLUP_RESISTOR_OHMS, HOTEND1_RESISTANCE_25C_OHMS, 0, 0, HOTEND1_BETA, 0 },
1381 1381
       #endif
1382
-      #if HEATER_2_USER_THERMISTOR
1382
+      #if TEMP_SENSOR_2_IS_CUSTOM
1383 1383
         { true, 0, 0, HOTEND2_PULLUP_RESISTOR_OHMS, HOTEND2_RESISTANCE_25C_OHMS, 0, 0, HOTEND2_BETA, 0 },
1384 1384
       #endif
1385
-      #if HEATER_3_USER_THERMISTOR
1385
+      #if TEMP_SENSOR_3_IS_CUSTOM
1386 1386
         { true, 0, 0, HOTEND3_PULLUP_RESISTOR_OHMS, HOTEND3_RESISTANCE_25C_OHMS, 0, 0, HOTEND3_BETA, 0 },
1387 1387
       #endif
1388
-      #if HEATER_4_USER_THERMISTOR
1388
+      #if TEMP_SENSOR_4_IS_CUSTOM
1389 1389
         { true, 0, 0, HOTEND4_PULLUP_RESISTOR_OHMS, HOTEND4_RESISTANCE_25C_OHMS, 0, 0, HOTEND4_BETA, 0 },
1390 1390
       #endif
1391
-      #if HEATER_5_USER_THERMISTOR
1391
+      #if TEMP_SENSOR_5_IS_CUSTOM
1392 1392
         { true, 0, 0, HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS, 0, 0, HOTEND5_BETA, 0 },
1393 1393
       #endif
1394
-      #if HEATER_6_USER_THERMISTOR
1394
+      #if TEMP_SENSOR_6_IS_CUSTOM
1395 1395
         { true, 0, 0, HOTEND6_PULLUP_RESISTOR_OHMS, HOTEND6_RESISTANCE_25C_OHMS, 0, 0, HOTEND6_BETA, 0 },
1396 1396
       #endif
1397
-      #if HEATER_7_USER_THERMISTOR
1397
+      #if TEMP_SENSOR_7_IS_CUSTOM
1398 1398
         { true, 0, 0, HOTEND7_PULLUP_RESISTOR_OHMS, HOTEND7_RESISTANCE_25C_OHMS, 0, 0, HOTEND7_BETA, 0 },
1399 1399
       #endif
1400
-      #if HEATER_BED_USER_THERMISTOR
1400
+      #if TEMP_SENSOR_BED_IS_CUSTOM
1401 1401
         { true, 0, 0, BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS, 0, 0, BED_BETA, 0 },
1402 1402
       #endif
1403
-      #if HEATER_CHAMBER_USER_THERMISTOR
1403
+      #if TEMP_SENSOR_CHAMBER_IS_CUSTOM
1404 1404
         { true, 0, 0, CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS, 0, 0, CHAMBER_BETA, 0 }
1405 1405
       #endif
1406
+      #if TEMP_SENSOR_PROBE_IS_CUSTOM
1407
+        { true, 0, 0, PROBE_PULLUP_RESISTOR_OHMS, PROBE_RESISTANCE_25C_OHMS, 0, 0, PROBE_BETA, 0 }
1408
+      #endif
1406 1409
     };
1407 1410
     COPY(user_thermistor, default_user_thermistor);
1408 1411
   }
@@ -1423,16 +1426,17 @@ void Temperature::manage_heater() {
1423 1426
     SERIAL_ECHOPAIR_F_P(SP_C_STR, t.sh_c_coeff, 9);
1424 1427
     SERIAL_ECHOPGM(" ; ");
1425 1428
     serialprintPGM(
1426
-      TERN_(HEATER_0_USER_THERMISTOR, t_index == CTI_HOTEND_0 ? PSTR("HOTEND 0") :)
1427
-      TERN_(HEATER_1_USER_THERMISTOR, t_index == CTI_HOTEND_1 ? PSTR("HOTEND 1") :)
1428
-      TERN_(HEATER_2_USER_THERMISTOR, t_index == CTI_HOTEND_2 ? PSTR("HOTEND 2") :)
1429
-      TERN_(HEATER_3_USER_THERMISTOR, t_index == CTI_HOTEND_3 ? PSTR("HOTEND 3") :)
1430
-      TERN_(HEATER_4_USER_THERMISTOR, t_index == CTI_HOTEND_4 ? PSTR("HOTEND 4") :)
1431
-      TERN_(HEATER_5_USER_THERMISTOR, t_index == CTI_HOTEND_5 ? PSTR("HOTEND 5") :)
1432
-      TERN_(HEATER_6_USER_THERMISTOR, t_index == CTI_HOTEND_6 ? PSTR("HOTEND 6") :)
1433
-      TERN_(HEATER_7_USER_THERMISTOR, t_index == CTI_HOTEND_7 ? PSTR("HOTEND 7") :)
1434
-      TERN_(HEATER_BED_USER_THERMISTOR, t_index == CTI_BED ? PSTR("BED") :)
1435
-      TERN_(HEATER_CHAMBER_USER_THERMISTOR, t_index == CTI_CHAMBER ? PSTR("CHAMBER") :)
1429
+      TERN_(TEMP_SENSOR_0_IS_CUSTOM, t_index == CTI_HOTEND_0 ? PSTR("HOTEND 0") :)
1430
+      TERN_(TEMP_SENSOR_1_IS_CUSTOM, t_index == CTI_HOTEND_1 ? PSTR("HOTEND 1") :)
1431
+      TERN_(TEMP_SENSOR_2_IS_CUSTOM, t_index == CTI_HOTEND_2 ? PSTR("HOTEND 2") :)
1432
+      TERN_(TEMP_SENSOR_3_IS_CUSTOM, t_index == CTI_HOTEND_3 ? PSTR("HOTEND 3") :)
1433
+      TERN_(TEMP_SENSOR_4_IS_CUSTOM, t_index == CTI_HOTEND_4 ? PSTR("HOTEND 4") :)
1434
+      TERN_(TEMP_SENSOR_5_IS_CUSTOM, t_index == CTI_HOTEND_5 ? PSTR("HOTEND 5") :)
1435
+      TERN_(TEMP_SENSOR_6_IS_CUSTOM, t_index == CTI_HOTEND_6 ? PSTR("HOTEND 6") :)
1436
+      TERN_(TEMP_SENSOR_7_IS_CUSTOM, t_index == CTI_HOTEND_7 ? PSTR("HOTEND 7") :)
1437
+      TERN_(TEMP_SENSOR_BED_IS_CUSTOM, t_index == CTI_BED ? PSTR("BED") :)
1438
+      TERN_(TEMP_SENSOR_CHAMBER_IS_CUSTOM, t_index == CTI_CHAMBER ? PSTR("CHAMBER") :)
1439
+      TERN_(TEMP_SENSOR_PROBE_IS_CUSTOM, t_index == CTI_PROBE ? PSTR("PROBE") :)
1436 1440
       nullptr
1437 1441
     );
1438 1442
     SERIAL_EOL();
@@ -1498,85 +1502,85 @@ void Temperature::manage_heater() {
1498 1502
 
1499 1503
     switch (e) {
1500 1504
       case 0:
1501
-        #if HEATER_0_USER_THERMISTOR
1505
+        #if TEMP_SENSOR_0_IS_CUSTOM
1502 1506
           return user_thermistor_to_deg_c(CTI_HOTEND_0, raw);
1503
-        #elif HEATER_0_USES_MAX6675
1504
-          return TERN(MAX6675_0_IS_MAX31865, max31865_0.temperature(MAX31865_SENSOR_OHMS_0, MAX31865_CALIBRATION_OHMS_0), raw * 0.25);
1505
-        #elif HEATER_0_USES_AD595
1507
+        #elif TEMP_SENSOR_0_IS_MAX_TC
1508
+          return TERN(TEMP_SENSOR_0_IS_MAX31865, max31865_0.temperature(MAX31865_SENSOR_OHMS_0, MAX31865_CALIBRATION_OHMS_0), raw * 0.25);
1509
+        #elif TEMP_SENSOR_0_IS_AD595
1506 1510
           return TEMP_AD595(raw);
1507
-        #elif HEATER_0_USES_AD8495
1511
+        #elif TEMP_SENSOR_0_IS_AD8495
1508 1512
           return TEMP_AD8495(raw);
1509 1513
         #else
1510 1514
           break;
1511 1515
         #endif
1512 1516
       case 1:
1513
-        #if HEATER_1_USER_THERMISTOR
1517
+        #if TEMP_SENSOR_1_IS_CUSTOM
1514 1518
           return user_thermistor_to_deg_c(CTI_HOTEND_1, raw);
1515
-        #elif HEATER_1_USES_MAX6675
1516
-          return TERN(MAX6675_1_IS_MAX31865, max31865_1.temperature(MAX31865_SENSOR_OHMS_1, MAX31865_CALIBRATION_OHMS_1), raw * 0.25);
1517
-        #elif HEATER_1_USES_AD595
1519
+        #elif TEMP_SENSOR_1_IS_MAX_TC
1520
+          return TERN(TEMP_SENSOR_1_IS_MAX31865, max31865_1.temperature(MAX31865_SENSOR_OHMS_1, MAX31865_CALIBRATION_OHMS_1), raw * 0.25);
1521
+        #elif TEMP_SENSOR_1_IS_AD595
1518 1522
           return TEMP_AD595(raw);
1519
-        #elif HEATER_1_USES_AD8495
1523
+        #elif TEMP_SENSOR_1_IS_AD8495
1520 1524
           return TEMP_AD8495(raw);
1521 1525
         #else
1522 1526
           break;
1523 1527
         #endif
1524 1528
       case 2:
1525
-        #if HEATER_2_USER_THERMISTOR
1529
+        #if TEMP_SENSOR_2_IS_CUSTOM
1526 1530
           return user_thermistor_to_deg_c(CTI_HOTEND_2, raw);
1527
-        #elif HEATER_2_USES_AD595
1531
+        #elif TEMP_SENSOR_2_IS_AD595
1528 1532
           return TEMP_AD595(raw);
1529
-        #elif HEATER_2_USES_AD8495
1533
+        #elif TEMP_SENSOR_2_IS_AD8495
1530 1534
           return TEMP_AD8495(raw);
1531 1535
         #else
1532 1536
           break;
1533 1537
         #endif
1534 1538
       case 3:
1535
-        #if HEATER_3_USER_THERMISTOR
1539
+        #if TEMP_SENSOR_3_IS_CUSTOM
1536 1540
           return user_thermistor_to_deg_c(CTI_HOTEND_3, raw);
1537
-        #elif HEATER_3_USES_AD595
1541
+        #elif TEMP_SENSOR_3_IS_AD595
1538 1542
           return TEMP_AD595(raw);
1539
-        #elif HEATER_3_USES_AD8495
1543
+        #elif TEMP_SENSOR_3_IS_AD8495
1540 1544
           return TEMP_AD8495(raw);
1541 1545
         #else
1542 1546
           break;
1543 1547
         #endif
1544 1548
       case 4:
1545
-        #if HEATER_4_USER_THERMISTOR
1549
+        #if TEMP_SENSOR_4_IS_CUSTOM
1546 1550
           return user_thermistor_to_deg_c(CTI_HOTEND_4, raw);
1547
-        #elif HEATER_4_USES_AD595
1551
+        #elif TEMP_SENSOR_4_IS_AD595
1548 1552
           return TEMP_AD595(raw);
1549
-        #elif HEATER_4_USES_AD8495
1553
+        #elif TEMP_SENSOR_4_IS_AD8495
1550 1554
           return TEMP_AD8495(raw);
1551 1555
         #else
1552 1556
           break;
1553 1557
         #endif
1554 1558
       case 5:
1555
-        #if HEATER_5_USER_THERMISTOR
1559
+        #if TEMP_SENSOR_5_IS_CUSTOM
1556 1560
           return user_thermistor_to_deg_c(CTI_HOTEND_5, raw);
1557
-        #elif HEATER_5_USES_AD595
1561
+        #elif TEMP_SENSOR_5_IS_AD595
1558 1562
           return TEMP_AD595(raw);
1559
-        #elif HEATER_5_USES_AD8495
1563
+        #elif TEMP_SENSOR_5_IS_AD8495
1560 1564
           return TEMP_AD8495(raw);
1561 1565
         #else
1562 1566
           break;
1563 1567
         #endif
1564 1568
       case 6:
1565
-        #if HEATER_6_USER_THERMISTOR
1569
+        #if TEMP_SENSOR_6_IS_CUSTOM
1566 1570
           return user_thermistor_to_deg_c(CTI_HOTEND_6, raw);
1567
-        #elif HEATER_6_USES_AD595
1571
+        #elif TEMP_SENSOR_6_IS_AD595
1568 1572
           return TEMP_AD595(raw);
1569
-        #elif HEATER_6_USES_AD8495
1573
+        #elif TEMP_SENSOR_6_IS_AD8495
1570 1574
           return TEMP_AD8495(raw);
1571 1575
         #else
1572 1576
           break;
1573 1577
         #endif
1574 1578
       case 7:
1575
-        #if HEATER_7_USER_THERMISTOR
1579
+        #if TEMP_SENSOR_7_IS_CUSTOM
1576 1580
           return user_thermistor_to_deg_c(CTI_HOTEND_7, raw);
1577
-        #elif HEATER_7_USES_AD595
1581
+        #elif TEMP_SENSOR_7_IS_AD595
1578 1582
           return TEMP_AD595(raw);
1579
-        #elif HEATER_7_USES_AD8495
1583
+        #elif TEMP_SENSOR_7_IS_AD8495
1580 1584
           return TEMP_AD8495(raw);
1581 1585
         #else
1582 1586
           break;
@@ -1598,13 +1602,13 @@ void Temperature::manage_heater() {
1598 1602
   // Derived from RepRap FiveD extruder::getTemperature()
1599 1603
   // For bed temperature measurement.
1600 1604
   float Temperature::analog_to_celsius_bed(const int raw) {
1601
-    #if HEATER_BED_USER_THERMISTOR
1605
+    #if TEMP_SENSOR_BED_IS_CUSTOM
1602 1606
       return user_thermistor_to_deg_c(CTI_BED, raw);
1603
-    #elif HEATER_BED_USES_THERMISTOR
1604
-      SCAN_THERMISTOR_TABLE(BED_TEMPTABLE, BED_TEMPTABLE_LEN);
1605
-    #elif HEATER_BED_USES_AD595
1607
+    #elif TEMP_SENSOR_BED_IS_THERMISTOR
1608
+      SCAN_THERMISTOR_TABLE(TEMPTABLE_BED, TEMPTABLE_BED_LEN);
1609
+    #elif TEMP_SENSOR_BED_IS_AD595
1606 1610
       return TEMP_AD595(raw);
1607
-    #elif HEATER_BED_USES_AD8495
1611
+    #elif TEMP_SENSOR_BED_IS_AD8495
1608 1612
       return TEMP_AD8495(raw);
1609 1613
     #else
1610 1614
       UNUSED(raw);
@@ -1617,13 +1621,13 @@ void Temperature::manage_heater() {
1617 1621
   // Derived from RepRap FiveD extruder::getTemperature()
1618 1622
   // For chamber temperature measurement.
1619 1623
   float Temperature::analog_to_celsius_chamber(const int raw) {
1620
-    #if HEATER_CHAMBER_USER_THERMISTOR
1624
+    #if TEMP_SENSOR_CHAMBER_IS_CUSTOM
1621 1625
       return user_thermistor_to_deg_c(CTI_CHAMBER, raw);
1622
-    #elif HEATER_CHAMBER_USES_THERMISTOR
1623
-      SCAN_THERMISTOR_TABLE(CHAMBER_TEMPTABLE, CHAMBER_TEMPTABLE_LEN);
1624
-    #elif HEATER_CHAMBER_USES_AD595
1626
+    #elif TEMP_SENSOR_CHAMBER_IS_THERMISTOR
1627
+      SCAN_THERMISTOR_TABLE(TEMPTABLE_CHAMBER, TEMPTABLE_CHAMBER_LEN);
1628
+    #elif TEMP_SENSOR_CHAMBER_IS_AD595
1625 1629
       return TEMP_AD595(raw);
1626
-    #elif HEATER_CHAMBER_USES_AD8495
1630
+    #elif TEMP_SENSOR_CHAMBER_IS_AD8495
1627 1631
       return TEMP_AD8495(raw);
1628 1632
     #else
1629 1633
       UNUSED(raw);
@@ -1636,13 +1640,13 @@ void Temperature::manage_heater() {
1636 1640
   // Derived from RepRap FiveD extruder::getTemperature()
1637 1641
   // For probe temperature measurement.
1638 1642
   float Temperature::analog_to_celsius_probe(const int raw) {
1639
-    #if HEATER_PROBE_USER_THERMISTOR
1643
+    #if TEMP_SENSOR_PROBE_IS_CUSTOM
1640 1644
       return user_thermistor_to_deg_c(CTI_PROBE, raw);
1641
-    #elif HEATER_PROBE_USES_THERMISTOR
1642
-      SCAN_THERMISTOR_TABLE(PROBE_TEMPTABLE, PROBE_TEMPTABLE_LEN);
1643
-    #elif HEATER_PROBE_USES_AD595
1645
+    #elif TEMP_SENSOR_PROBE_IS_THERMISTOR
1646
+      SCAN_THERMISTOR_TABLE(TEMPTABLE_PROBE, TEMPTABLE_PROBE_LEN);
1647
+    #elif TEMP_SENSOR_PROBE_IS_AD595
1644 1648
       return TEMP_AD595(raw);
1645
-    #elif HEATER_PROBE_USES_AD8495
1649
+    #elif TEMP_SENSOR_PROBE_IS_AD8495
1646 1650
       return TEMP_AD8495(raw);
1647 1651
     #else
1648 1652
       UNUSED(raw);
@@ -1658,8 +1662,8 @@ void Temperature::manage_heater() {
1658 1662
  * as it would block the stepper routine.
1659 1663
  */
1660 1664
 void Temperature::updateTemperaturesFromRawValues() {
1661
-  TERN_(HEATER_0_USES_MAX6675, temp_hotend[0].raw = READ_MAX6675(0));
1662
-  TERN_(HEATER_1_USES_MAX6675, temp_hotend[1].raw = READ_MAX6675(1));
1665
+  TERN_(TEMP_SENSOR_0_IS_MAX_TC, temp_hotend[0].raw = READ_MAX_TC(0));
1666
+  TERN_(TEMP_SENSOR_1_IS_MAX_TC, temp_hotend[1].raw = READ_MAX_TC(1));
1663 1667
   #if HAS_HOTEND
1664 1668
     HOTEND_LOOP() temp_hotend[e].celsius = analog_to_celsius_hotend(temp_hotend[e].raw, e);
1665 1669
   #endif
@@ -1676,9 +1680,9 @@ void Temperature::updateTemperaturesFromRawValues() {
1676 1680
   raw_temps_ready = false;
1677 1681
 }
1678 1682
 
1679
-#if MAX6675_SEPARATE_SPI
1683
+#if THERMO_SEPARATE_SPI
1680 1684
   template<uint8_t MisoPin, uint8_t MosiPin, uint8_t SckPin> SoftSPI<MisoPin, MosiPin, SckPin> SPIclass<MisoPin, MosiPin, SckPin>::softSPI;
1681
-  SPIclass<MAX6675_DO_PIN, SD_MOSI_PIN, MAX6675_SCK_PIN> max6675_spi;
1685
+  SPIclass<MAX6675_DO_PIN, SD_MOSI_PIN, MAX6675_SCK_PIN> max_tc_spi;
1682 1686
 #endif
1683 1687
 
1684 1688
 // Init fans according to whether they're native PWM or Software PWM
@@ -1715,8 +1719,8 @@ void Temperature::updateTemperaturesFromRawValues() {
1715 1719
  */
1716 1720
 void Temperature::init() {
1717 1721
 
1718
-  TERN_(MAX6675_0_IS_MAX31865, max31865_0.begin(MAX31865_2WIRE)); // MAX31865_2WIRE, MAX31865_3WIRE, MAX31865_4WIRE
1719
-  TERN_(MAX6675_1_IS_MAX31865, max31865_1.begin(MAX31865_2WIRE));
1722
+  TERN_(TEMP_SENSOR_0_IS_MAX31865, max31865_0.begin(MAX31865_2WIRE)); // MAX31865_2WIRE, MAX31865_3WIRE, MAX31865_4WIRE
1723
+  TERN_(TEMP_SENSOR_1_IS_MAX31865, max31865_1.begin(MAX31865_2WIRE));
1720 1724
 
1721 1725
   #if EARLY_WATCHDOG
1722 1726
     // Flag that the thermalManager should be running
@@ -1726,7 +1730,7 @@ void Temperature::init() {
1726 1730
 
1727 1731
   #if MB(RUMBA)
1728 1732
     // Disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector
1729
-    #define _AD(N) (HEATER_##N##_USES_AD595 || HEATER_##N##_USES_AD8495)
1733
+    #define _AD(N) (TEMP_SENSOR_##N##_IS_AD595 || TEMP_SENSOR_##N##_IS_AD8495)
1730 1734
     #if _AD(0) || _AD(1) || _AD(2) || _AD(BED) || _AD(CHAMBER)
1731 1735
       MCUCR = _BV(JTD);
1732 1736
       MCUCR = _BV(JTD);
@@ -1734,11 +1738,11 @@ void Temperature::init() {
1734 1738
   #endif
1735 1739
 
1736 1740
   // Thermistor activation by MCU pin
1737
-  #if PIN_EXISTS(TEMP_0_TR_ENABLE_PIN)
1738
-    OUT_WRITE(TEMP_0_TR_ENABLE_PIN, ENABLED(HEATER_0_USES_MAX6675));
1741
+  #if PIN_EXISTS(TEMP_0_TR_ENABLE)
1742
+    OUT_WRITE(TEMP_0_TR_ENABLE_PIN, ENABLED(TEMP_SENSOR_0_IS_MAX_TC));
1739 1743
   #endif
1740
-  #if PIN_EXISTS(TEMP_1_TR_ENABLE_PIN)
1741
-    OUT_WRITE(TEMP_1_TR_ENABLE_PIN, ENABLED(HEATER_1_USES_MAX6675));
1744
+  #if PIN_EXISTS(TEMP_1_TR_ENABLE)
1745
+    OUT_WRITE(TEMP_1_TR_ENABLE_PIN, ENABLED(TEMP_SENSOR_1_IS_MAX_TC));
1742 1746
   #endif
1743 1747
 
1744 1748
   #if BOTH(PIDTEMP, PID_EXTRUSION_SCALING)
@@ -1815,7 +1819,7 @@ void Temperature::init() {
1815 1819
     INIT_FAN_PIN(CONTROLLER_FAN_PIN);
1816 1820
   #endif
1817 1821
 
1818
-  TERN_(MAX6675_SEPARATE_SPI, max6675_spi.init());
1822
+  TERN_(THERMO_SEPARATE_SPI, max_tc_spi.init());
1819 1823
 
1820 1824
   HAL_adc_init();
1821 1825
 
@@ -1914,19 +1918,19 @@ void Temperature::init() {
1914 1918
   #if HAS_HOTEND
1915 1919
 
1916 1920
     #define _TEMP_MIN_E(NR) do{ \
1917
-      const int16_t tmin = _MAX(HEATER_ ##NR## _MINTEMP, TERN(HEATER_##NR##_USER_THERMISTOR, 0, (int16_t)pgm_read_word(&HEATER_ ##NR## _TEMPTABLE[HEATER_ ##NR## _SENSOR_MINTEMP_IND].celsius))); \
1921
+      const int16_t tmin = _MAX(HEATER_##NR##_MINTEMP, TERN(TEMP_SENSOR_##NR##_IS_CUSTOM, 0, (int16_t)pgm_read_word(&TEMPTABLE_##NR [TEMP_SENSOR_##NR##_MINTEMP_IND].celsius))); \
1918 1922
       temp_range[NR].mintemp = tmin; \
1919 1923
       while (analog_to_celsius_hotend(temp_range[NR].raw_min, NR) < tmin) \
1920 1924
         temp_range[NR].raw_min += TEMPDIR(NR) * (OVERSAMPLENR); \
1921 1925
     }while(0)
1922 1926
     #define _TEMP_MAX_E(NR) do{ \
1923
-      const int16_t tmax = _MIN(HEATER_ ##NR## _MAXTEMP, TERN(HEATER_##NR##_USER_THERMISTOR, 2000, (int16_t)pgm_read_word(&HEATER_ ##NR## _TEMPTABLE[HEATER_ ##NR## _SENSOR_MAXTEMP_IND].celsius) - 1)); \
1927
+      const int16_t tmax = _MIN(HEATER_##NR##_MAXTEMP, TERN(TEMP_SENSOR_##NR##_IS_CUSTOM, 2000, (int16_t)pgm_read_word(&TEMPTABLE_##NR [TEMP_SENSOR_##NR##_MAXTEMP_IND].celsius) - 1)); \
1924 1928
       temp_range[NR].maxtemp = tmax; \
1925 1929
       while (analog_to_celsius_hotend(temp_range[NR].raw_max, NR) > tmax) \
1926 1930
         temp_range[NR].raw_max -= TEMPDIR(NR) * (OVERSAMPLENR); \
1927 1931
     }while(0)
1928 1932
 
1929
-    #define _MINMAX_TEST(N,M) (HOTENDS > N && THERMISTOR_HEATER_##N && THERMISTOR_HEATER_##N != 998 && THERMISTOR_HEATER_##N != 999 && defined(HEATER_##N##_##M##TEMP))
1933
+    #define _MINMAX_TEST(N,M) (HOTENDS > N && TEMP_SENSOR_ ##N## THERMISTOR_ID && TEMP_SENSOR_ ##N## THERMISTOR_ID != 998 && TEMP_SENSOR_ ##N## THERMISTOR_ID != 999 && defined(HEATER_##N##_##M##TEMP))
1930 1934
 
1931 1935
     #if _MINMAX_TEST(0, MIN)
1932 1936
       _TEMP_MIN_E(0);
@@ -2221,105 +2225,106 @@ void Temperature::disable_all_heaters() {
2221 2225
 
2222 2226
 #endif
2223 2227
 
2224
-#if HAS_MAX6675
2228
+#if HAS_MAX_TC
2225 2229
 
2226 2230
   #ifndef THERMOCOUPLE_MAX_ERRORS
2227 2231
     #define THERMOCOUPLE_MAX_ERRORS 15
2228 2232
   #endif
2229 2233
 
2230
-  int Temperature::read_max6675(TERN_(HAS_MULTI_6675, const uint8_t hindex/*=0*/)) {
2234
+  int Temperature::read_max_tc(TERN_(HAS_MULTI_MAX_TC, const uint8_t hindex/*=0*/)) {
2231 2235
     #define MAX6675_HEAT_INTERVAL 250UL
2232 2236
 
2233
-    #if MAX6675_0_IS_MAX31855 || MAX6675_1_IS_MAX31855
2234
-      static uint32_t max6675_temp = 2000;
2235
-      #define MAX6675_ERROR_MASK    7
2236
-      #define MAX6675_DISCARD_BITS 18
2237
-      #define MAX6675_SPEED_BITS    3       // (_BV(SPR1)) // clock ÷ 64
2238
-    #elif HAS_MAX31865
2239
-      static uint16_t max6675_temp = 2000;  // From datasheet 16 bits D15-D0
2240
-      #define MAX6675_ERROR_MASK    1       // D0 Bit not used
2241
-      #define MAX6675_DISCARD_BITS  1       // Data is in D15-D1
2242
-      #define MAX6675_SPEED_BITS    3       //  (_BV(SPR1)) // clock ÷ 64
2237
+    #if HAS_MAX31855
2238
+      static uint32_t max_tc_temp = 2000;
2239
+      #define MAX_TC_ERROR_MASK    7
2240
+      #define MAX_TC_DISCARD_BITS 18
2241
+      #define MAX_TC_SPEED_BITS    3        // (_BV(SPR1)) // clock ÷ 64
2242
+    #elif HAS_MAX31865_TEMP
2243
+      static uint16_t max_tc_temp = 2000;   // From datasheet 16 bits D15-D0
2244
+      #define MAX_TC_ERROR_MASK    1        // D0 Bit not used
2245
+      #define MAX_TC_DISCARD_BITS  1        // Data is in D15-D1
2246
+      #define MAX_TC_SPEED_BITS    3        //  (_BV(SPR1)) // clock ÷ 64
2243 2247
     #else
2244
-      static uint16_t max6675_temp = 2000;
2245
-      #define MAX6675_ERROR_MASK    4
2246
-      #define MAX6675_DISCARD_BITS  3
2247
-      #define MAX6675_SPEED_BITS    2       // (_BV(SPR0)) // clock ÷ 16
2248
+      static uint16_t max_tc_temp = 2000;
2249
+      #define MAX_TC_ERROR_MASK    4
2250
+      #define MAX_TC_DISCARD_BITS  3
2251
+      #define MAX_TC_SPEED_BITS    2        // (_BV(SPR0)) // clock ÷ 16
2248 2252
     #endif
2249 2253
 
2250
-    #if HAS_MULTI_6675
2254
+    #if HAS_MULTI_MAX_TC
2251 2255
       // Needed to return the correct temp when this is called between readings
2252
-      static uint16_t max6675_temp_previous[COUNT_6675] = { 0 };
2253
-      #define MAX6675_TEMP(I) max6675_temp_previous[I]
2254
-      #define MAX6675_SEL(A,B) (hindex ? (B) : (A))
2256
+      static uint16_t max_tc_temp_previous[MAX_TC_COUNT] = { 0 };
2257
+      #define THERMO_TEMP(I) max_tc_temp_previous[I]
2258
+      #define THERMO_SEL(A,B) (hindex ? (B) : (A))
2255 2259
       #define MAX6675_WRITE(V)     do{ switch (hindex) { case 1:      WRITE(MAX6675_SS2_PIN, V); break; default:      WRITE(MAX6675_SS_PIN, V); } }while(0)
2256 2260
       #define MAX6675_SET_OUTPUT() do{ switch (hindex) { case 1: SET_OUTPUT(MAX6675_SS2_PIN);    break; default: SET_OUTPUT(MAX6675_SS_PIN);    } }while(0)
2257 2261
     #else
2258 2262
       constexpr uint8_t hindex = 0;
2259
-      #define MAX6675_TEMP(I) max6675_temp
2260
-      #if MAX6675_1_IS_MAX31865
2261
-        #define MAX6675_SEL(A,B) B
2263
+      #define THERMO_TEMP(I) max_tc_temp
2264
+      #if TEMP_SENSOR_1_IS_MAX31865
2265
+        #define THERMO_SEL(A,B) B
2262 2266
       #else
2263
-        #define MAX6675_SEL(A,B) A
2267
+        #define THERMO_SEL(A,B) A
2264 2268
       #endif
2265
-      #if HEATER_0_USES_MAX6675
2269
+      #if TEMP_SENSOR_0_IS_MAX6675
2266 2270
         #define MAX6675_WRITE(V)          WRITE(MAX6675_SS_PIN, V)
2267 2271
         #define MAX6675_SET_OUTPUT() SET_OUTPUT(MAX6675_SS_PIN)
2268 2272
       #else
2269 2273
         #define MAX6675_WRITE(V)          WRITE(MAX6675_SS2_PIN, V)
2270 2274
         #define MAX6675_SET_OUTPUT() SET_OUTPUT(MAX6675_SS2_PIN)
2271 2275
       #endif
2276
+
2272 2277
     #endif
2273 2278
 
2274
-    static uint8_t max6675_errors[COUNT_6675] = { 0 };
2279
+    static uint8_t max_tc_errors[MAX_TC_COUNT] = { 0 };
2275 2280
 
2276 2281
     // Return last-read value between readings
2277
-    static millis_t next_max6675_ms[COUNT_6675] = { 0 };
2282
+    static millis_t next_max_tc_ms[MAX_TC_COUNT] = { 0 };
2278 2283
     millis_t ms = millis();
2279
-    if (PENDING(ms, next_max6675_ms[hindex])) return int(MAX6675_TEMP(hindex));
2280
-    next_max6675_ms[hindex] = ms + MAX6675_HEAT_INTERVAL;
2284
+    if (PENDING(ms, next_max_tc_ms[hindex])) return int(THERMO_TEMP(hindex));
2285
+    next_max_tc_ms[hindex] = ms + MAX6675_HEAT_INTERVAL;
2281 2286
 
2282
-    #if HAS_MAX31865
2283
-      Adafruit_MAX31865 &maxref = MAX6675_SEL(max31865_0, max31865_1);
2284
-      const uint16_t max31865_ohms = (uint32_t(maxref.readRTD()) * MAX6675_SEL(MAX31865_CALIBRATION_OHMS_0, MAX31865_CALIBRATION_OHMS_1)) >> 16;
2287
+    #if HAS_MAX31865_TEMP
2288
+      Adafruit_MAX31865 &maxref = THERMO_SEL(max31865_0, max31865_1);
2289
+      const uint16_t max31865_ohms = (uint32_t(maxref.readRTD()) * THERMO_SEL(MAX31865_CALIBRATION_OHMS_0, MAX31865_CALIBRATION_OHMS_1)) >> 16;
2285 2290
     #endif
2286 2291
 
2287 2292
     //
2288 2293
     // TODO: spiBegin, spiRec and spiInit doesn't work when soft spi is used.
2289 2294
     //
2290
-    #if !MAX6675_SEPARATE_SPI
2295
+    #if !THERMO_SEPARATE_SPI
2291 2296
       spiBegin();
2292
-      spiInit(MAX6675_SPEED_BITS);
2297
+      spiInit(MAX_TC_SPEED_BITS);
2293 2298
     #endif
2294 2299
 
2295
-    MAX6675_WRITE(LOW);  // enable TT_MAX6675
2296
-    DELAY_NS(100);       // Ensure 100ns delay
2300
+    MAX6675_WRITE(LOW); // enable TT_MAX6675
2301
+    DELAY_NS(100);      // Ensure 100ns delay
2297 2302
 
2298 2303
     // Read a big-endian temperature value
2299
-    max6675_temp = 0;
2300
-    for (uint8_t i = sizeof(max6675_temp); i--;) {
2301
-      max6675_temp |= TERN(MAX6675_SEPARATE_SPI, max6675_spi.receive(), spiRec());
2302
-      if (i > 0) max6675_temp <<= 8; // shift left if not the last byte
2304
+    max_tc_temp = 0;
2305
+    for (uint8_t i = sizeof(max_tc_temp); i--;) {
2306
+      max_tc_temp |= TERN(THERMO_SEPARATE_SPI, max_tc_spi.receive(), spiRec());
2307
+      if (i > 0) max_tc_temp <<= 8; // shift left if not the last byte
2303 2308
     }
2304 2309
 
2305 2310
     MAX6675_WRITE(HIGH); // disable TT_MAX6675
2306 2311
 
2307
-    const uint8_t fault_31865 = TERN1(HAS_MAX31865, maxref.readFault());
2312
+    const uint8_t fault_31865 = TERN1(HAS_MAX31865_TEMP, maxref.readFault());
2308 2313
 
2309
-    if (DISABLED(IGNORE_THERMOCOUPLE_ERRORS) && (max6675_temp & MAX6675_ERROR_MASK) && fault_31865) {
2310
-      max6675_errors[hindex]++;
2311
-      if (max6675_errors[hindex] > THERMOCOUPLE_MAX_ERRORS) {
2314
+    if (DISABLED(IGNORE_THERMOCOUPLE_ERRORS) && (max_tc_temp & MAX_TC_ERROR_MASK) && fault_31865) {
2315
+      max_tc_errors[hindex]++;
2316
+      if (max_tc_errors[hindex] > THERMOCOUPLE_MAX_ERRORS) {
2312 2317
         SERIAL_ERROR_START();
2313 2318
         SERIAL_ECHOPGM("Temp measurement error! ");
2314
-        #if MAX6675_ERROR_MASK == 7
2319
+        #if MAX_TC_ERROR_MASK == 7
2315 2320
           SERIAL_ECHOPGM("MAX31855 ");
2316
-          if (max6675_temp & 1)
2321
+          if (max_tc_temp & 1)
2317 2322
             SERIAL_ECHOLNPGM("Open Circuit");
2318
-          else if (max6675_temp & 2)
2323
+          else if (max_tc_temp & 2)
2319 2324
             SERIAL_ECHOLNPGM("Short to GND");
2320
-          else if (max6675_temp & 4)
2325
+          else if (max_tc_temp & 4)
2321 2326
             SERIAL_ECHOLNPGM("Short to VCC");
2322
-        #elif HAS_MAX31865
2327
+        #elif HAS_MAX31865_TEMP
2323 2328
           if (fault_31865) {
2324 2329
             maxref.clearFault();
2325 2330
             SERIAL_ECHOPAIR("MAX31865 Fault :(", fault_31865, ")  >>");
@@ -2341,43 +2346,43 @@ void Temperature::disable_all_heaters() {
2341 2346
         #endif
2342 2347
 
2343 2348
         // Thermocouple open
2344
-        max6675_temp = 4 * MAX6675_SEL(HEATER_0_MAX6675_TMAX, HEATER_1_MAX6675_TMAX);
2349
+        max_tc_temp = 4 * THERMO_SEL(TEMP_SENSOR_0_MAX_TC_TMAX, TEMP_SENSOR_1_MAX_TC_TMAX);
2345 2350
       }
2346 2351
       else
2347
-        max6675_temp >>= MAX6675_DISCARD_BITS;
2352
+        max_tc_temp >>= MAX_TC_DISCARD_BITS;
2348 2353
     }
2349 2354
     else {
2350
-      max6675_temp >>= MAX6675_DISCARD_BITS;
2351
-      max6675_errors[hindex] = 0;
2355
+      max_tc_temp >>= MAX_TC_DISCARD_BITS;
2356
+      max_tc_errors[hindex] = 0;
2352 2357
     }
2353 2358
 
2354
-    #if MAX6675_0_IS_MAX31855 || MAX6675_1_IS_MAX31855
2355
-      if (max6675_temp & 0x00002000) max6675_temp |= 0xFFFFC000; // Support negative temperature
2359
+    #if HAS_MAX31855
2360
+      if (max_tc_temp & 0x00002000) max_tc_temp |= 0xFFFFC000; // Support negative temperature
2356 2361
     #endif
2357 2362
 
2358 2363
     // Return the RTD resistance for MAX31865 for display in SHOW_TEMP_ADC_VALUES
2359
-    TERN_(HAS_MAX31865, max6675_temp = max31865_ohms);
2364
+    TERN_(HAS_MAX31865_TEMP, max_tc_temp = max31865_ohms);
2360 2365
 
2361
-    MAX6675_TEMP(hindex) = max6675_temp;
2366
+    THERMO_TEMP(hindex) = max_tc_temp;
2362 2367
 
2363
-    return int(max6675_temp);
2368
+    return int(max_tc_temp);
2364 2369
   }
2365 2370
 
2366
-#endif // HAS_MAX6675
2371
+#endif // HAS_MAX_TC
2367 2372
 
2368 2373
 /**
2369 2374
  * Update raw temperatures
2370 2375
  */
2371 2376
 void Temperature::update_raw_temperatures() {
2372 2377
 
2373
-  #if HAS_TEMP_ADC_0 && !HEATER_0_USES_MAX6675
2378
+  #if HAS_TEMP_ADC_0 && !TEMP_SENSOR_0_IS_MAX_TC
2374 2379
     temp_hotend[0].update();
2375 2380
   #endif
2376 2381
 
2377 2382
   #if HAS_TEMP_ADC_1
2378 2383
     #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
2379 2384
       redundant_temperature_raw = temp_hotend[1].acc;
2380
-    #elif !HEATER_1_USES_MAX6675
2385
+    #elif !TEMP_SENSOR_1_IS_MAX_TC
2381 2386
       temp_hotend[1].update();
2382 2387
     #endif
2383 2388
   #endif
@@ -2423,9 +2428,9 @@ void Temperature::readings_ready() {
2423 2428
   #if HAS_HOTEND
2424 2429
 
2425 2430
     static constexpr int8_t temp_dir[] = {
2426
-      TERN(HEATER_0_USES_MAX6675, 0, TEMPDIR(0))
2431
+      TERN(TEMP_SENSOR_0_IS_MAX_TC, 0, TEMPDIR(0))
2427 2432
       #if HAS_MULTI_HOTEND
2428
-        , TERN(HEATER_1_USES_MAX6675, 0, TEMPDIR(1))
2433
+        , TERN(TEMP_SENSOR_1_IS_MAX_TC, 0, TEMPDIR(1))
2429 2434
         #if HOTENDS > 2
2430 2435
           #define _TEMPDIR(N) , TEMPDIR(N)
2431 2436
           REPEAT_S(2, HOTENDS, _TEMPDIR)

+ 16
- 17
Marlin/src/module/temperature.h View File

@@ -257,31 +257,31 @@ typedef struct { int16_t raw_min, raw_max, mintemp, maxtemp; } temp_range_t;
257 257
 #if HAS_USER_THERMISTORS
258 258
 
259 259
   enum CustomThermistorIndex : uint8_t {
260
-    #if HEATER_0_USER_THERMISTOR
260
+    #if TEMP_SENSOR_0_IS_CUSTOM
261 261
       CTI_HOTEND_0,
262 262
     #endif
263
-    #if HEATER_1_USER_THERMISTOR
263
+    #if TEMP_SENSOR_1_IS_CUSTOM
264 264
       CTI_HOTEND_1,
265 265
     #endif
266
-    #if HEATER_2_USER_THERMISTOR
266
+    #if TEMP_SENSOR_2_IS_CUSTOM
267 267
       CTI_HOTEND_2,
268 268
     #endif
269
-    #if HEATER_3_USER_THERMISTOR
269
+    #if TEMP_SENSOR_3_IS_CUSTOM
270 270
       CTI_HOTEND_3,
271 271
     #endif
272
-    #if HEATER_4_USER_THERMISTOR
272
+    #if TEMP_SENSOR_4_IS_CUSTOM
273 273
       CTI_HOTEND_4,
274 274
     #endif
275
-    #if HEATER_5_USER_THERMISTOR
275
+    #if TEMP_SENSOR_5_IS_CUSTOM
276 276
       CTI_HOTEND_5,
277 277
     #endif
278
-    #if HEATER_BED_USER_THERMISTOR
278
+    #if TEMP_SENSOR_BED_IS_CUSTOM
279 279
       CTI_BED,
280 280
     #endif
281
-    #if HEATER_PROBE_USER_THERMISTOR
281
+    #if TEMP_SENSOR_PROBE_IS_CUSTOM
282 282
       CTI_PROBE,
283 283
     #endif
284
-    #if HEATER_CHAMBER_USER_THERMISTOR
284
+    #if TEMP_SENSOR_CHAMBER_IS_CUSTOM
285 285
       CTI_CHAMBER,
286 286
     #endif
287 287
     USER_THERMISTORS
@@ -813,16 +813,15 @@ class Temperature {
813 813
     static void update_raw_temperatures();
814 814
     static void updateTemperaturesFromRawValues();
815 815
 
816
-    #define HAS_MAX6675 EITHER(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675)
817
-    #if HAS_MAX6675
818
-      #define COUNT_6675 1 + BOTH(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675)
819
-      #if COUNT_6675 > 1
820
-        #define HAS_MULTI_6675 1
821
-        #define READ_MAX6675(N) read_max6675(N)
816
+    #if HAS_MAX_TC
817
+      #define MAX_TC_COUNT 1 + BOTH(TEMP_SENSOR_0_IS_MAX_TC, TEMP_SENSOR_1_IS_MAX_TC)
818
+      #if MAX_TC_COUNT > 1
819
+        #define HAS_MULTI_MAX_TC 1
820
+        #define READ_MAX_TC(N) read_max_tc(N)
822 821
       #else
823
-        #define READ_MAX6675(N) read_max6675()
822
+        #define READ_MAX_TC(N) read_max_tc()
824 823
       #endif
825
-      static int read_max6675(TERN_(HAS_MULTI_6675, const uint8_t hindex=0));
824
+      static int read_max_tc(TERN_(HAS_MULTI_MAX_TC, const uint8_t hindex=0));
826 825
     #endif
827 826
 
828 827
     static void checkExtruderAutoFans();

+ 190
- 186
Marlin/src/module/thermistor/thermistors.h View File

@@ -42,7 +42,7 @@
42 42
 #define OV_SCALE(N) (N)
43 43
 #define OV(N) int16_t(OV_SCALE(N) * (OVERSAMPLENR) * (THERMISTOR_TABLE_SCALE))
44 44
 
45
-#define ANY_THERMISTOR_IS(n) (THERMISTOR_HEATER_0 == n || THERMISTOR_HEATER_1 == n || THERMISTOR_HEATER_2 == n || THERMISTOR_HEATER_3 == n || THERMISTOR_HEATER_4 == n || THERMISTOR_HEATER_5 == n || THERMISTOR_HEATER_6 == n || THERMISTOR_HEATER_7 == n || THERMISTORBED == n || THERMISTORCHAMBER == n || THERMISTORPROBE == n)
45
+#define ANY_THERMISTOR_IS(n) (TEMP_SENSOR_0_THERMISTOR_ID == n || TEMP_SENSOR_1_THERMISTOR_ID == n || TEMP_SENSOR_2_THERMISTOR_ID == n || TEMP_SENSOR_3_THERMISTOR_ID == n || TEMP_SENSOR_4_THERMISTOR_ID == n || TEMP_SENSOR_5_THERMISTOR_ID == n || TEMP_SENSOR_6_THERMISTOR_ID == n || TEMP_SENSOR_7_THERMISTOR_ID == n || TEMP_SENSOR_BED_THERMISTOR_ID == n || TEMP_SENSOR_CHAMBER_THERMISTOR_ID == n || TEMP_SENSOR_PROBE_THERMISTOR_ID == n)
46 46
 
47 47
 typedef struct { int16_t value, celsius; } temp_entry_t;
48 48
 
@@ -205,121 +205,121 @@ typedef struct { int16_t value, celsius; } temp_entry_t;
205 205
 #define TT_NAME(_N) _TT_NAME(_N)
206 206
 
207 207
 
208
-#if THERMISTOR_HEATER_0
209
-  #define HEATER_0_TEMPTABLE TT_NAME(THERMISTOR_HEATER_0)
210
-  #define HEATER_0_TEMPTABLE_LEN COUNT(HEATER_0_TEMPTABLE)
211
-#elif HEATER_0_USES_THERMISTOR
208
+#if TEMP_SENSOR_0_THERMISTOR_ID
209
+  #define TEMPTABLE_0 TT_NAME(TEMP_SENSOR_0_THERMISTOR_ID)
210
+  #define TEMPTABLE_0_LEN COUNT(TEMPTABLE_0)
211
+#elif TEMP_SENSOR_0_IS_THERMISTOR
212 212
   #error "No heater 0 thermistor table specified"
213 213
 #else
214
-  #define HEATER_0_TEMPTABLE nullptr
215
-  #define HEATER_0_TEMPTABLE_LEN 0
214
+  #define TEMPTABLE_0 nullptr
215
+  #define TEMPTABLE_0_LEN 0
216 216
 #endif
217 217
 
218
-#if THERMISTOR_HEATER_1
219
-  #define HEATER_1_TEMPTABLE TT_NAME(THERMISTOR_HEATER_1)
220
-  #define HEATER_1_TEMPTABLE_LEN COUNT(HEATER_1_TEMPTABLE)
221
-#elif HEATER_1_USES_THERMISTOR
218
+#if TEMP_SENSOR_1_THERMISTOR_ID
219
+  #define TEMPTABLE_1 TT_NAME(TEMP_SENSOR_1_THERMISTOR_ID)
220
+  #define TEMPTABLE_1_LEN COUNT(TEMPTABLE_1)
221
+#elif TEMP_SENSOR_1_IS_THERMISTOR
222 222
   #error "No heater 1 thermistor table specified"
223 223
 #else
224
-  #define HEATER_1_TEMPTABLE nullptr
225
-  #define HEATER_1_TEMPTABLE_LEN 0
224
+  #define TEMPTABLE_1 nullptr
225
+  #define TEMPTABLE_1_LEN 0
226 226
 #endif
227 227
 
228
-#if THERMISTOR_HEATER_2
229
-  #define HEATER_2_TEMPTABLE TT_NAME(THERMISTOR_HEATER_2)
230
-  #define HEATER_2_TEMPTABLE_LEN COUNT(HEATER_2_TEMPTABLE)
231
-#elif HEATER_2_USES_THERMISTOR
228
+#if TEMP_SENSOR_2_THERMISTOR_ID
229
+  #define TEMPTABLE_2 TT_NAME(TEMP_SENSOR_2_THERMISTOR_ID)
230
+  #define TEMPTABLE_2_LEN COUNT(TEMPTABLE_2)
231
+#elif TEMP_SENSOR_2_IS_THERMISTOR
232 232
   #error "No heater 2 thermistor table specified"
233 233
 #else
234
-  #define HEATER_2_TEMPTABLE nullptr
235
-  #define HEATER_2_TEMPTABLE_LEN 0
234
+  #define TEMPTABLE_2 nullptr
235
+  #define TEMPTABLE_2_LEN 0
236 236
 #endif
237 237
 
238
-#if THERMISTOR_HEATER_3
239
-  #define HEATER_3_TEMPTABLE TT_NAME(THERMISTOR_HEATER_3)
240
-  #define HEATER_3_TEMPTABLE_LEN COUNT(HEATER_3_TEMPTABLE)
241
-#elif HEATER_3_USES_THERMISTOR
238
+#if TEMP_SENSOR_3_THERMISTOR_ID
239
+  #define TEMPTABLE_3 TT_NAME(TEMP_SENSOR_3_THERMISTOR_ID)
240
+  #define TEMPTABLE_3_LEN COUNT(TEMPTABLE_3)
241
+#elif TEMP_SENSOR_3_IS_THERMISTOR
242 242
   #error "No heater 3 thermistor table specified"
243 243
 #else
244
-  #define HEATER_3_TEMPTABLE nullptr
245
-  #define HEATER_3_TEMPTABLE_LEN 0
244
+  #define TEMPTABLE_3 nullptr
245
+  #define TEMPTABLE_3_LEN 0
246 246
 #endif
247 247
 
248
-#if THERMISTOR_HEATER_4
249
-  #define HEATER_4_TEMPTABLE TT_NAME(THERMISTOR_HEATER_4)
250
-  #define HEATER_4_TEMPTABLE_LEN COUNT(HEATER_4_TEMPTABLE)
251
-#elif HEATER_4_USES_THERMISTOR
248
+#if TEMP_SENSOR_4_THERMISTOR_ID
249
+  #define TEMPTABLE_4 TT_NAME(TEMP_SENSOR_4_THERMISTOR_ID)
250
+  #define TEMPTABLE_4_LEN COUNT(TEMPTABLE_4)
251
+#elif TEMP_SENSOR_4_IS_THERMISTOR
252 252
   #error "No heater 4 thermistor table specified"
253 253
 #else
254
-  #define HEATER_4_TEMPTABLE nullptr
255
-  #define HEATER_4_TEMPTABLE_LEN 0
254
+  #define TEMPTABLE_4 nullptr
255
+  #define TEMPTABLE_4_LEN 0
256 256
 #endif
257 257
 
258
-#if THERMISTOR_HEATER_5
259
-  #define HEATER_5_TEMPTABLE TT_NAME(THERMISTOR_HEATER_5)
260
-  #define HEATER_5_TEMPTABLE_LEN COUNT(HEATER_5_TEMPTABLE)
261
-#elif HEATER_5_USES_THERMISTOR
258
+#if TEMP_SENSOR_5_THERMISTOR_ID
259
+  #define TEMPTABLE_5 TT_NAME(TEMP_SENSOR_5_THERMISTOR_ID)
260
+  #define TEMPTABLE_5_LEN COUNT(TEMPTABLE_5)
261
+#elif TEMP_SENSOR_5_IS_THERMISTOR
262 262
   #error "No heater 5 thermistor table specified"
263 263
 #else
264
-  #define HEATER_5_TEMPTABLE nullptr
265
-  #define HEATER_5_TEMPTABLE_LEN 0
264
+  #define TEMPTABLE_5 nullptr
265
+  #define TEMPTABLE_5_LEN 0
266 266
 #endif
267 267
 
268
-#if THERMISTOR_HEATER_6
269
-  #define HEATER_6_TEMPTABLE TT_NAME(THERMISTOR_HEATER_6)
270
-  #define HEATER_6_TEMPTABLE_LEN COUNT(HEATER_6_TEMPTABLE)
271
-#elif HEATER_6_USES_THERMISTOR
268
+#if TEMP_SENSOR_6_THERMISTOR_ID
269
+  #define TEMPTABLE_6 TT_NAME(TEMP_SENSOR_6_THERMISTOR_ID)
270
+  #define TEMPTABLE_6_LEN COUNT(TEMPTABLE_6)
271
+#elif TEMP_SENSOR_6_IS_THERMISTOR
272 272
   #error "No heater 6 thermistor table specified"
273 273
 #else
274
-  #define HEATER_6_TEMPTABLE nullptr
275
-  #define HEATER_6_TEMPTABLE_LEN 0
274
+  #define TEMPTABLE_6 nullptr
275
+  #define TEMPTABLE_6_LEN 0
276 276
 #endif
277 277
 
278
-#if THERMISTOR_HEATER_7
279
-  #define HEATER_7_TEMPTABLE TT_NAME(THERMISTOR_HEATER_7)
280
-  #define HEATER_7_TEMPTABLE_LEN COUNT(HEATER_7_TEMPTABLE)
281
-#elif HEATER_7_USES_THERMISTOR
278
+#if TEMP_SENSOR_7_THERMISTOR_ID
279
+  #define TEMPTABLE_7 TT_NAME(TEMP_SENSOR_7_THERMISTOR_ID)
280
+  #define TEMPTABLE_7_LEN COUNT(TEMPTABLE_7)
281
+#elif TEMP_SENSOR_7_IS_THERMISTOR
282 282
   #error "No heater 7 thermistor table specified"
283 283
 #else
284
-  #define HEATER_7_TEMPTABLE nullptr
285
-  #define HEATER_7_TEMPTABLE_LEN 0
284
+  #define TEMPTABLE_7 nullptr
285
+  #define TEMPTABLE_7_LEN 0
286 286
 #endif
287 287
 
288
-#ifdef THERMISTORBED
289
-  #define BED_TEMPTABLE TT_NAME(THERMISTORBED)
290
-  #define BED_TEMPTABLE_LEN COUNT(BED_TEMPTABLE)
291
-#elif HEATER_BED_USES_THERMISTOR
288
+#ifdef TEMP_SENSOR_BED_THERMISTOR_ID
289
+  #define TEMPTABLE_BED TT_NAME(TEMP_SENSOR_BED_THERMISTOR_ID)
290
+  #define TEMPTABLE_BED_LEN COUNT(TEMPTABLE_BED)
291
+#elif TEMP_SENSOR_BED_IS_THERMISTOR
292 292
   #error "No bed thermistor table specified"
293 293
 #else
294
-  #define BED_TEMPTABLE_LEN 0
294
+  #define TEMPTABLE_BED_LEN 0
295 295
 #endif
296 296
 
297
-#ifdef THERMISTORCHAMBER
298
-  #define CHAMBER_TEMPTABLE TT_NAME(THERMISTORCHAMBER)
299
-  #define CHAMBER_TEMPTABLE_LEN COUNT(CHAMBER_TEMPTABLE)
300
-#elif HEATER_CHAMBER_USES_THERMISTOR
297
+#ifdef TEMP_SENSOR_CHAMBER_THERMISTOR_ID
298
+  #define TEMPTABLE_CHAMBER TT_NAME(TEMP_SENSOR_CHAMBER_THERMISTOR_ID)
299
+  #define TEMPTABLE_CHAMBER_LEN COUNT(TEMPTABLE_CHAMBER)
300
+#elif TEMP_SENSOR_CHAMBER_IS_THERMISTOR
301 301
   #error "No chamber thermistor table specified"
302 302
 #else
303
-  #define CHAMBER_TEMPTABLE_LEN 0
303
+  #define TEMPTABLE_CHAMBER_LEN 0
304 304
 #endif
305 305
 
306
-#ifdef THERMISTORPROBE
307
-  #define PROBE_TEMPTABLE TT_NAME(THERMISTORPROBE)
308
-  #define PROBE_TEMPTABLE_LEN COUNT(PROBE_TEMPTABLE)
309
-#elif HEATER_PROBE_USES_THERMISTOR
306
+#ifdef TEMP_SENSOR_PROBE_THERMISTOR_ID
307
+  #define TEMPTABLE_PROBE TT_NAME(TEMP_SENSOR_PROBE_THERMISTOR_ID)
308
+  #define TEMPTABLE_PROBE_LEN COUNT(TEMPTABLE_PROBE)
309
+#elif TEMP_SENSOR_PROBE_IS_THERMISTOR
310 310
   #error "No probe thermistor table specified"
311 311
 #else
312
-  #define PROBE_TEMPTABLE_LEN 0
312
+  #define TEMPTABLE_PROBE_LEN 0
313 313
 #endif
314 314
 
315 315
 // The SCAN_THERMISTOR_TABLE macro needs alteration?
316 316
 static_assert(
317
-     HEATER_0_TEMPTABLE_LEN < 256 && HEATER_1_TEMPTABLE_LEN < 256
318
-  && HEATER_2_TEMPTABLE_LEN < 256 && HEATER_3_TEMPTABLE_LEN < 256
319
-  && HEATER_4_TEMPTABLE_LEN < 256 && HEATER_5_TEMPTABLE_LEN < 256
320
-  && HEATER_6_TEMPTABLE_LEN < 256 && HEATER_7_TEMPTABLE_LEN < 256
321
-  &&      BED_TEMPTABLE_LEN < 256 &&  CHAMBER_TEMPTABLE_LEN < 256
322
-  &&    PROBE_TEMPTABLE_LEN < 256,
317
+     TEMPTABLE_0_LEN < 256 && TEMPTABLE_1_LEN < 256
318
+  && TEMPTABLE_2_LEN < 256 && TEMPTABLE_3_LEN < 256
319
+  && TEMPTABLE_4_LEN < 256 && TEMPTABLE_5_LEN < 256
320
+  && TEMPTABLE_6_LEN < 256 && TEMPTABLE_7_LEN < 256
321
+  && TEMPTABLE_BED_LEN < 256 && TEMPTABLE_CHAMBER_LEN < 256
322
+  && TEMPTABLE_PROBE_LEN < 256,
323 323
   "Temperature conversion tables over 255 entries need special consideration."
324 324
 );
325 325
 
@@ -327,181 +327,185 @@ static_assert(
327 327
 // For thermistors the highest temperature results in the lowest ADC value
328 328
 // For thermocouples the highest temperature results in the highest ADC value
329 329
 
330
-#define _TT_REV(N) REVERSE_TEMP_SENSOR_RANGE_##N
331
-#define TT_REV(N) _TT_REV(N)
330
+#define _TT_REV(N)    REVERSE_TEMP_SENSOR_RANGE_##N
331
+#define TT_REV(N)     _TT_REV(TEMP_SENSOR_##N##_THERMISTOR_ID)
332
+#define _TT_REVRAW(N) !TEMP_SENSOR_##N##_IS_THERMISTOR
333
+#define TT_REVRAW(N)  (TT_REV(N) || _TT_REVRAW(N))
332 334
 
333
-#ifdef HEATER_0_TEMPTABLE
334
-  #if TT_REV(THERMISTOR_HEATER_0)
335
-    #define HEATER_0_SENSOR_MINTEMP_IND 0
336
-    #define HEATER_0_SENSOR_MAXTEMP_IND HEATER_0_TEMPTABLE_LEN - 1
335
+#ifdef TEMPTABLE_0
336
+  #if TT_REV(0)
337
+    #define TEMP_SENSOR_0_MINTEMP_IND 0
338
+    #define TEMPTABLE_0_MAXTEMP_IND HEATER_0_LEN - 1
337 339
   #else
338
-    #define HEATER_0_SENSOR_MINTEMP_IND HEATER_0_TEMPTABLE_LEN - 1
339
-    #define HEATER_0_SENSOR_MAXTEMP_IND 0
340
+    #define TEMPTABLE_0_MINTEMP_IND HEATER_0_LEN - 1
341
+    #define TEMP_SENSOR_0_MAXTEMP_IND 0
340 342
   #endif
341 343
 #endif
342
-#ifdef HEATER_1_TEMPTABLE
343
-  #if TT_REV(THERMISTOR_HEATER_1)
344
-    #define HEATER_1_SENSOR_MINTEMP_IND 0
345
-    #define HEATER_1_SENSOR_MAXTEMP_IND HEATER_1_TEMPTABLE_LEN - 1
344
+#ifdef TEMPTABLE_1
345
+  #if TT_REV(1)
346
+    #define TEMP_SENSOR_1_MINTEMP_IND 0
347
+    #define TEMPTABLE_1_MAXTEMP_IND HEATER_1_LEN - 1
346 348
   #else
347
-    #define HEATER_1_SENSOR_MINTEMP_IND HEATER_1_TEMPTABLE_LEN - 1
348
-    #define HEATER_1_SENSOR_MAXTEMP_IND 0
349
+    #define TEMPTABLE_1_MINTEMP_IND HEATER_1_LEN - 1
350
+    #define TEMP_SENSOR_1_MAXTEMP_IND 0
349 351
   #endif
350 352
 #endif
351
-#ifdef HEATER_2_TEMPTABLE
352
-  #if TT_REV(THERMISTOR_HEATER_2)
353
-    #define HEATER_2_SENSOR_MINTEMP_IND 0
354
-    #define HEATER_2_SENSOR_MAXTEMP_IND HEATER_2_TEMPTABLE_LEN - 1
353
+#ifdef TEMPTABLE_2
354
+  #if TT_REV(2)
355
+    #define TEMP_SENSOR_2_MINTEMP_IND 0
356
+    #define TEMPTABLE_2_MAXTEMP_IND HEATER_2_LEN - 1
355 357
   #else
356
-    #define HEATER_2_SENSOR_MINTEMP_IND HEATER_2_TEMPTABLE_LEN - 1
357
-    #define HEATER_2_SENSOR_MAXTEMP_IND 0
358
+    #define TEMPTABLE_2_MINTEMP_IND HEATER_2_LEN - 1
359
+    #define TEMP_SENSOR_2_MAXTEMP_IND 0
358 360
   #endif
359 361
 #endif
360
-#ifdef HEATER_3_TEMPTABLE
361
-  #if TT_REV(THERMISTOR_HEATER_3)
362
-    #define HEATER_3_SENSOR_MINTEMP_IND 0
363
-    #define HEATER_3_SENSOR_MAXTEMP_IND HEATER_3_TEMPTABLE_LEN - 1
362
+#ifdef TEMPTABLE_3
363
+  #if TT_REV(3)
364
+    #define TEMP_SENSOR_3_MINTEMP_IND 0
365
+    #define TEMPTABLE_3_MAXTEMP_IND HEATER_3_LEN - 1
364 366
   #else
365
-    #define HEATER_3_SENSOR_MINTEMP_IND HEATER_3_TEMPTABLE_LEN - 1
366
-    #define HEATER_3_SENSOR_MAXTEMP_IND 0
367
+    #define TEMPTABLE_3_MINTEMP_IND HEATER_3_LEN - 1
368
+    #define TEMP_SENSOR_3_MAXTEMP_IND 0
367 369
   #endif
368 370
 #endif
369
-#ifdef HEATER_4_TEMPTABLE
370
-  #if TT_REV(THERMISTOR_HEATER_4)
371
-    #define HEATER_4_SENSOR_MINTEMP_IND 0
372
-    #define HEATER_4_SENSOR_MAXTEMP_IND HEATER_4_TEMPTABLE_LEN - 1
371
+#ifdef TEMPTABLE_4
372
+  #if TT_REV(4)
373
+    #define TEMP_SENSOR_4_MINTEMP_IND 0
374
+    #define TEMPTABLE_4_MAXTEMP_IND HEATER_4_LEN - 1
373 375
   #else
374
-    #define HEATER_4_SENSOR_MINTEMP_IND HEATER_4_TEMPTABLE_LEN - 1
375
-    #define HEATER_4_SENSOR_MAXTEMP_IND 0
376
+    #define TEMPTABLE_4_MINTEMP_IND HEATER_4_LEN - 1
377
+    #define TEMP_SENSOR_4_MAXTEMP_IND 0
376 378
   #endif
377 379
 #endif
378
-#ifdef HEATER_5_TEMPTABLE
379
-  #if TT_REV(THERMISTOR_HEATER_5)
380
-    #define HEATER_5_SENSOR_MINTEMP_IND 0
381
-    #define HEATER_5_SENSOR_MAXTEMP_IND HEATER_5_TEMPTABLE_LEN - 1
380
+#ifdef TEMPTABLE_5
381
+  #if TT_REV(5)
382
+    #define TEMP_SENSOR_5_MINTEMP_IND 0
383
+    #define TEMPTABLE_5_MAXTEMP_IND HEATER_5_LEN - 1
382 384
   #else
383
-    #define HEATER_5_SENSOR_MINTEMP_IND HEATER_5_TEMPTABLE_LEN - 1
384
-    #define HEATER_5_SENSOR_MAXTEMP_IND 0
385
+    #define TEMPTABLE_5_MINTEMP_IND HEATER_5_LEN - 1
386
+    #define TEMP_SENSOR_5_MAXTEMP_IND 0
385 387
   #endif
386 388
 #endif
387
-#ifdef HEATER_6_TEMPTABLE
388
-  #if TT_REV(THERMISTOR_HEATER_6)
389
-    #define HEATER_6_SENSOR_MINTEMP_IND 0
390
-    #define HEATER_6_SENSOR_MAXTEMP_IND HEATER_6_TEMPTABLE_LEN - 1
389
+#ifdef TEMPTABLE_6
390
+  #if TT_REV(6)
391
+    #define TEMP_SENSOR_6_MINTEMP_IND 0
392
+    #define TEMPTABLE_6_MAXTEMP_IND HEATER_6_LEN - 1
391 393
   #else
392
-    #define HEATER_6_SENSOR_MINTEMP_IND HEATER_6_TEMPTABLE_LEN - 1
393
-    #define HEATER_6_SENSOR_MAXTEMP_IND 0
394
+    #define TEMPTABLE_6_MINTEMP_IND HEATER_6_LEN - 1
395
+    #define TEMP_SENSOR_6_MAXTEMP_IND 0
394 396
   #endif
395 397
 #endif
396
-#ifdef HEATER_7_TEMPTABLE
397
-  #if TT_REV(THERMISTOR_HEATER_7)
398
-    #define HEATER_7_SENSOR_MINTEMP_IND 0
399
-    #define HEATER_7_SENSOR_MAXTEMP_IND HEATER_7_TEMPTABLE_LEN - 1
398
+#ifdef TEMPTABLE_7
399
+  #if TT_REV(7)
400
+    #define TEMP_SENSOR_7_MINTEMP_IND 0
401
+    #define TEMPTABLE_7_MAXTEMP_IND HEATER_7_LEN - 1
400 402
   #else
401
-    #define HEATER_7_SENSOR_MINTEMP_IND HEATER_7_TEMPTABLE_LEN - 1
402
-    #define HEATER_7_SENSOR_MAXTEMP_IND 0
403
+    #define TEMPTABLE_7_MINTEMP_IND HEATER_7_LEN - 1
404
+    #define TEMP_SENSOR_7_MAXTEMP_IND 0
403 405
   #endif
404 406
 #endif
405 407
 
406
-#ifndef HEATER_0_RAW_HI_TEMP
407
-  #if TT_REV(THERMISTOR_HEATER_0) || !HEATER_0_USES_THERMISTOR
408
-    #define HEATER_0_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
409
-    #define HEATER_0_RAW_LO_TEMP 0
408
+#ifndef TEMP_SENSOR_0_RAW_HI_TEMP
409
+  #if TT_REVRAW(0)
410
+    #define TEMP_SENSOR_0_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
411
+    #define TEMP_SENSOR_0_RAW_LO_TEMP 0
410 412
   #else
411
-    #define HEATER_0_RAW_HI_TEMP 0
412
-    #define HEATER_0_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
413
+    #define TEMP_SENSOR_0_RAW_HI_TEMP 0
414
+    #define TEMP_SENSOR_0_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
413 415
   #endif
414 416
 #endif
415
-#ifndef HEATER_1_RAW_HI_TEMP
416
-  #if TT_REV(THERMISTOR_HEATER_1) || !HEATER_1_USES_THERMISTOR
417
-    #define HEATER_1_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
418
-    #define HEATER_1_RAW_LO_TEMP 0
417
+#ifndef TEMP_SENSOR_1_RAW_HI_TEMP
418
+  #if TT_REVRAW(1)
419
+    #define TEMP_SENSOR_1_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
420
+    #define TEMP_SENSOR_1_RAW_LO_TEMP 0
419 421
   #else
420
-    #define HEATER_1_RAW_HI_TEMP 0
421
-    #define HEATER_1_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
422
+    #define TEMP_SENSOR_1_RAW_HI_TEMP 0
423
+    #define TEMP_SENSOR_1_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
422 424
   #endif
423 425
 #endif
424
-#ifndef HEATER_2_RAW_HI_TEMP
425
-  #if TT_REV(THERMISTOR_HEATER_2) || !HEATER_2_USES_THERMISTOR
426
-    #define HEATER_2_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
427
-    #define HEATER_2_RAW_LO_TEMP 0
426
+#ifndef TEMP_SENSOR_2_RAW_HI_TEMP
427
+  #if TT_REVRAW(2)
428
+    #define TEMP_SENSOR_2_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
429
+    #define TEMP_SENSOR_2_RAW_LO_TEMP 0
428 430
   #else
429
-    #define HEATER_2_RAW_HI_TEMP 0
430
-    #define HEATER_2_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
431
+    #define TEMP_SENSOR_2_RAW_HI_TEMP 0
432
+    #define TEMP_SENSOR_2_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
431 433
   #endif
432 434
 #endif
433
-#ifndef HEATER_3_RAW_HI_TEMP
434
-  #if TT_REV(THERMISTOR_HEATER_3) || !HEATER_3_USES_THERMISTOR
435
-    #define HEATER_3_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
436
-    #define HEATER_3_RAW_LO_TEMP 0
435
+#ifndef TEMP_SENSOR_3_RAW_HI_TEMP
436
+  #if TT_REVRAW(3)
437
+    #define TEMP_SENSOR_3_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
438
+    #define TEMP_SENSOR_3_RAW_LO_TEMP 0
437 439
   #else
438
-    #define HEATER_3_RAW_HI_TEMP 0
439
-    #define HEATER_3_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
440
+    #define TEMP_SENSOR_3_RAW_HI_TEMP 0
441
+    #define TEMP_SENSOR_3_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
440 442
   #endif
441 443
 #endif
442
-#ifndef HEATER_4_RAW_HI_TEMP
443
-  #if TT_REV(THERMISTOR_HEATER_4) || !HEATER_4_USES_THERMISTOR
444
-    #define HEATER_4_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
445
-    #define HEATER_4_RAW_LO_TEMP 0
444
+#ifndef TEMP_SENSOR_4_RAW_HI_TEMP
445
+  #if TT_REVRAW(4)
446
+    #define TEMP_SENSOR_4_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
447
+    #define TEMP_SENSOR_4_RAW_LO_TEMP 0
446 448
   #else
447
-    #define HEATER_4_RAW_HI_TEMP 0
448
-    #define HEATER_4_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
449
+    #define TEMP_SENSOR_4_RAW_HI_TEMP 0
450
+    #define TEMP_SENSOR_4_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
449 451
   #endif
450 452
 #endif
451
-#ifndef HEATER_5_RAW_HI_TEMP
452
-  #if TT_REV(THERMISTOR_HEATER_5) || !HEATER_5_USES_THERMISTOR
453
-    #define HEATER_5_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
454
-    #define HEATER_5_RAW_LO_TEMP 0
453
+#ifndef TEMP_SENSOR_5_RAW_HI_TEMP
454
+  #if TT_REVRAW(5)
455
+    #define TEMP_SENSOR_5_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
456
+    #define TEMP_SENSOR_5_RAW_LO_TEMP 0
455 457
   #else
456
-    #define HEATER_5_RAW_HI_TEMP 0
457
-    #define HEATER_5_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
458
+    #define TEMP_SENSOR_5_RAW_HI_TEMP 0
459
+    #define TEMP_SENSOR_5_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
458 460
   #endif
459 461
 #endif
460
-#ifndef HEATER_6_RAW_HI_TEMP
461
-  #if TT_REV(THERMISTOR_HEATER_6) || !HEATER_6_USES_THERMISTOR
462
-    #define HEATER_6_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
463
-    #define HEATER_6_RAW_LO_TEMP 0
462
+#ifndef TEMP_SENSOR_6_RAW_HI_TEMP
463
+  #if TT_REVRAW(6)
464
+    #define TEMP_SENSOR_6_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
465
+    #define TEMP_SENSOR_6_RAW_LO_TEMP 0
464 466
   #else
465
-    #define HEATER_6_RAW_HI_TEMP 0
466
-    #define HEATER_6_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
467
+    #define TEMP_SENSOR_6_RAW_HI_TEMP 0
468
+    #define TEMP_SENSOR_6_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
467 469
   #endif
468 470
 #endif
469
-#ifndef HEATER_7_RAW_HI_TEMP
470
-  #if TT_REV(THERMISTOR_HEATER_7) || !HEATER_7_USES_THERMISTOR
471
-    #define HEATER_7_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
472
-    #define HEATER_7_RAW_LO_TEMP 0
471
+#ifndef TEMP_SENSOR_7_RAW_HI_TEMP
472
+  #if TT_REVRAW(7)
473
+    #define TEMP_SENSOR_7_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
474
+    #define TEMP_SENSOR_7_RAW_LO_TEMP 0
473 475
   #else
474
-    #define HEATER_7_RAW_HI_TEMP 0
475
-    #define HEATER_7_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
476
+    #define TEMP_SENSOR_7_RAW_HI_TEMP 0
477
+    #define TEMP_SENSOR_7_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
476 478
   #endif
477 479
 #endif
478
-#ifndef HEATER_BED_RAW_HI_TEMP
479
-  #if TT_REV(THERMISTORBED) || !HEATER_BED_USES_THERMISTOR
480
-    #define HEATER_BED_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
481
-    #define HEATER_BED_RAW_LO_TEMP 0
480
+#ifndef TEMP_SENSOR_BED_RAW_HI_TEMP
481
+  #if TT_REVRAW(BED)
482
+    #define TEMP_SENSOR_BED_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
483
+    #define TEMP_SENSOR_BED_RAW_LO_TEMP 0
482 484
   #else
483
-    #define HEATER_BED_RAW_HI_TEMP 0
484
-    #define HEATER_BED_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
485
+    #define TEMP_SENSOR_BED_RAW_HI_TEMP 0
486
+    #define TEMP_SENSOR_BED_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
485 487
   #endif
486 488
 #endif
487
-#ifndef HEATER_CHAMBER_RAW_HI_TEMP
488
-  #if TT_REV(THERMISTORCHAMBER) || !HEATER_CHAMBER_USES_THERMISTOR
489
-    #define HEATER_CHAMBER_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
490
-    #define HEATER_CHAMBER_RAW_LO_TEMP 0
489
+#ifndef TEMP_SENSOR_CHAMBER_RAW_HI_TEMP
490
+  #if TT_REVRAW(CHAMBER)
491
+    #define TEMP_SENSOR_CHAMBER_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
492
+    #define TEMP_SENSOR_CHAMBER_RAW_LO_TEMP 0
491 493
   #else
492
-    #define HEATER_CHAMBER_RAW_HI_TEMP 0
493
-    #define HEATER_CHAMBER_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
494
+    #define TEMP_SENSOR_CHAMBER_RAW_HI_TEMP 0
495
+    #define TEMP_SENSOR_CHAMBER_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
494 496
   #endif
495 497
 #endif
496
-#ifndef HEATER_PROBE_RAW_HI_TEMP
497
-  #if TT_REV(THERMISTORPROBE) || !HEATER_PROBE_USES_THERMISTOR
498
-    #define HEATER_PROBE_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
499
-    #define HEATER_PROBE_RAW_LO_TEMP 0
498
+#ifndef TEMP_SENSOR_PROBE_RAW_HI_TEMP
499
+  #if TT_REVRAW(PROBE)
500
+    #define TEMP_SENSOR_PROBE_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
501
+    #define TEMP_SENSOR_PROBE_RAW_LO_TEMP 0
500 502
   #else
501
-    #define HEATER_PROBE_RAW_HI_TEMP 0
502
-    #define HEATER_PROBE_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
503
+    #define TEMP_SENSOR_PROBE_RAW_HI_TEMP 0
504
+    #define TEMP_SENSOR_PROBE_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
503 505
   #endif
504 506
 #endif
505 507
 
506 508
 #undef _TT_REV
507 509
 #undef TT_REV
510
+#undef _TT_REVRAW
511
+#undef TT_REVRAW

+ 1
- 1
Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h View File

@@ -135,7 +135,7 @@
135 135
 #define Y_STEP_PIN                          PE11
136 136
 #define Y_DIR_PIN                           PE8
137 137
 #define Y_ENABLE_PIN                        PD7
138
- #ifndef Y_CS_PIN
138
+#ifndef Y_CS_PIN
139 139
   #define Y_CS_PIN                          PB8
140 140
 #endif
141 141
 

+ 1
- 1
platformio.ini View File

@@ -235,7 +235,7 @@ HAS_L64XX               = Arduino-L6470@0.8.0
235 235
                           src_filter=+<src/libs/L64XX> +<src/module/stepper/L64xx.cpp> +<src/gcode/feature/L6470> +<src/HAL/shared/HAL_spi_L6470.cpp>
236 236
 NEOPIXEL_LED            = Adafruit NeoPixel@1.5.0
237 237
                           src_filter=+<src/feature/leds/neopixel.cpp>
238
-MAX6675_._IS_MAX31865   = Adafruit MAX31865 library@~1.1.0
238
+TEMP_.+_IS_MAX31865     = Adafruit MAX31865 library@~1.1.0
239 239
 USES_LIQUIDCRYSTAL      = bitbucket-fmalpartida/LiquidCrystal@1.5.0
240 240
 USES_LIQUIDCRYSTAL_I2C  = marcoschwartz/LiquidCrystal_I2C@1.1.4
241 241
 USES_LIQUIDTWI2         = LiquidTWI2@1.2.7

Loading…
Cancel
Save