Browse Source

Support two MAX6675 thermocouples (#8686)

Mateusz Krawczuk 6 years ago
parent
commit
ca21ac6b9b

+ 16
- 6
Marlin/src/inc/Conditionals_post.h View File

275
 #elif TEMP_SENSOR_0 == -3
275
 #elif TEMP_SENSOR_0 == -3
276
   #define HEATER_0_USES_MAX6675
276
   #define HEATER_0_USES_MAX6675
277
   #define MAX6675_IS_MAX31855
277
   #define MAX6675_IS_MAX31855
278
-  #define MAX6675_TMIN -270
279
-  #define MAX6675_TMAX 1800
278
+  #define HEATER_0_MAX6675_TMIN -270
279
+  #define HEATER_0_MAX6675_TMAX 1800
280
 #elif TEMP_SENSOR_0 == -2
280
 #elif TEMP_SENSOR_0 == -2
281
   #define HEATER_0_USES_MAX6675
281
   #define HEATER_0_USES_MAX6675
282
-  #define MAX6675_TMIN 0
283
-  #define MAX6675_TMAX 1024
282
+  #define HEATER_0_MAX6675_TMIN 0
283
+  #define HEATER_0_MAX6675_TMAX 1024
284
 #elif TEMP_SENSOR_0 == -1
284
 #elif TEMP_SENSOR_0 == -1
285
   #define HEATER_0_USES_AD595
285
   #define HEATER_0_USES_AD595
286
 #elif TEMP_SENSOR_0 == 0
286
 #elif TEMP_SENSOR_0 == 0
294
 #if TEMP_SENSOR_1 == -4
294
 #if TEMP_SENSOR_1 == -4
295
   #define HEATER_1_USES_AD8495
295
   #define HEATER_1_USES_AD8495
296
 #elif TEMP_SENSOR_1 == -3
296
 #elif TEMP_SENSOR_1 == -3
297
-  #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_1."
297
+  #if TEMP_SENSOR_0 == -2
298
+    #error "If MAX31855 Thermocouple (-3) is used for TEMP_SENSOR_1 then TEMP_SENSOR_0 must match."
299
+  #endif
300
+  #define HEATER_1_USES_MAX6675
301
+  #define HEATER_1_MAX6675_TMIN -270
302
+  #define HEATER_1_MAX6675_TMAX 1800
298
 #elif TEMP_SENSOR_1 == -2
303
 #elif TEMP_SENSOR_1 == -2
299
-  #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_1."
304
+  #if TEMP_SENSOR_0 == -3
305
+    #error "If MAX31855 Thermocouple (-3) is used for TEMP_SENSOR_0 then TEMP_SENSOR_1 must match."
306
+  #endif
307
+  #define HEATER_1_USES_MAX6675
308
+  #define HEATER_1_MAX6675_TMIN 0
309
+  #define HEATER_1_MAX6675_TMAX 1024
300
 #elif TEMP_SENSOR_1 == -1
310
 #elif TEMP_SENSOR_1 == -1
301
   #define HEATER_1_USES_AD595
311
   #define HEATER_1_USES_AD595
302
 #elif TEMP_SENSOR_1 == 0
312
 #elif TEMP_SENSOR_1 == 0

+ 11
- 5
Marlin/src/inc/SanityCheck.h View File

335
   #error "MBL_Z_STEP is now MESH_EDIT_Z_STEP. Please update your configuration."
335
   #error "MBL_Z_STEP is now MESH_EDIT_Z_STEP. Please update your configuration."
336
 #elif defined(CHDK)
336
 #elif defined(CHDK)
337
   #error "CHDK is now CHDK_PIN. Please update your Configuration_adv.h."
337
   #error "CHDK is now CHDK_PIN. Please update your Configuration_adv.h."
338
+#elif defined(MAX6675_SS)
339
+  #error "MAX6675_SS is now MAX6675_SS_PIN. Please update your configuration and/or pins."
340
+#elif defined(MAX6675_SS2)
341
+  #error "MAX6675_SS2 is now MAX6675_SS2_PIN. Please update your configuration and/or pins."
338
 #endif
342
 #endif
339
 
343
 
340
 #define BOARD_MKS_13     -47
344
 #define BOARD_MKS_13     -47
1280
  */
1284
  */
1281
 #if !HAS_HEATER_0
1285
 #if !HAS_HEATER_0
1282
   #error "HEATER_0_PIN not defined for this board."
1286
   #error "HEATER_0_PIN not defined for this board."
1283
-#elif !PIN_EXISTS(TEMP_0) && !(defined(MAX6675_SS) && MAX6675_SS >= 0)
1287
+#elif !PIN_EXISTS(TEMP_0) && !PIN_EXISTS(MAX6675_SS)
1284
   #error "TEMP_0_PIN not defined for this board."
1288
   #error "TEMP_0_PIN not defined for this board."
1285
 #elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR)))
1289
 #elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR)))
1286
   #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board."
1290
   #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board."
1291
 #endif
1295
 #endif
1292
 
1296
 
1293
 // Pins are required for heaters
1297
 // Pins are required for heaters
1294
-#if ENABLED(HEATER_0_USES_MAX6675) && !(defined(MAX6675_SS) && MAX6675_SS >= 0)
1295
-  #error "MAX6675_SS (required for TEMP_SENSOR_0) not defined for this board."
1298
+#if ENABLED(HEATER_0_USES_MAX6675) && !PIN_EXISTS(MAX6675_SS)
1299
+  #error "MAX6675_SS_PIN (required for TEMP_SENSOR_0) not defined for this board."
1296
 #elif (HOTENDS > 1 || ENABLED(HEATERS_PARALLEL)) && !HAS_HEATER_1
1300
 #elif (HOTENDS > 1 || ENABLED(HEATERS_PARALLEL)) && !HAS_HEATER_1
1297
   #error "HEATER_1_PIN not defined for this board."
1301
   #error "HEATER_1_PIN not defined for this board."
1298
 #endif
1302
 #endif
1299
 
1303
 
1300
 #if HOTENDS > 1
1304
 #if HOTENDS > 1
1301
-  #if TEMP_SENSOR_1 == 0
1305
+  #if ENABLED(HEATER_1_USES_MAX6675) && !PIN_EXISTS(MAX6675_SS2)
1306
+    #error "MAX6675_SS2_PIN (required for TEMP_SENSOR_1) not defined for this board."
1307
+  #elif TEMP_SENSOR_1 == 0
1302
     #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
1308
     #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
1303
-  #elif !PIN_EXISTS(TEMP_1)
1309
+  #elif !PIN_EXISTS(TEMP_1) && !PIN_EXISTS(MAX6675_SS2)
1304
     #error "TEMP_1_PIN not defined for this board."
1310
     #error "TEMP_1_PIN not defined for this board."
1305
   #endif
1311
   #endif
1306
   #if HOTENDS > 2
1312
   #if HOTENDS > 2

+ 90
- 37
Marlin/src/module/temperature.cpp View File

775
   updateTemperaturesFromRawValues(); // also resets the watchdog
775
   updateTemperaturesFromRawValues(); // also resets the watchdog
776
 
776
 
777
   #if ENABLED(HEATER_0_USES_MAX6675)
777
   #if ENABLED(HEATER_0_USES_MAX6675)
778
-    if (current_temperature[0] > MIN(HEATER_0_MAXTEMP, MAX6675_TMAX - 1.0)) max_temp_error(0);
779
-    if (current_temperature[0] < MAX(HEATER_0_MINTEMP, MAX6675_TMIN + .01)) min_temp_error(0);
778
+    if (current_temperature[0] > MIN(HEATER_0_MAXTEMP, HEATER_0_MAX6675_TMAX - 1.0)) max_temp_error(0);
779
+    if (current_temperature[0] < MAX(HEATER_0_MINTEMP, HEATER_0_MAX6675_TMIN + .01)) min_temp_error(0);
780
+  #endif
781
+
782
+  #if ENABLED(HEATER_1_USES_MAX6675)
783
+    if (current_temperature[1] > MIN(HEATER_1_MAXTEMP, HEATER_1_MAX6675_TMAX - 1.0)) max_temp_error(1);
784
+    if (current_temperature[1] < MAX(HEATER_1_MINTEMP, HEATER_1_MAX6675_TMIN + .01)) min_temp_error(1);
780
   #endif
785
   #endif
781
 
786
 
782
   #if WATCH_HOTENDS || WATCH_THE_BED || DISABLED(PIDTEMPBED) || HAS_AUTO_FAN || HEATER_IDLE_HANDLER
787
   #if WATCH_HOTENDS || WATCH_THE_BED || DISABLED(PIDTEMPBED) || HAS_AUTO_FAN || HEATER_IDLE_HANDLER
953
         break;
958
         break;
954
       #endif
959
       #endif
955
     case 1:
960
     case 1:
956
-      #if ENABLED(HEATER_1_USES_AD595)
961
+      #if ENABLED(HEATER_1_USES_MAX6675)
962
+        return raw * 0.25;
963
+      #elif ENABLED(HEATER_1_USES_AD595)
957
         return TEMP_AD595(raw);
964
         return TEMP_AD595(raw);
958
       #elif ENABLED(HEATER_1_USES_AD8495)
965
       #elif ENABLED(HEATER_1_USES_AD8495)
959
         return TEMP_AD8495(raw);
966
         return TEMP_AD8495(raw);
1036
  */
1043
  */
1037
 void Temperature::updateTemperaturesFromRawValues() {
1044
 void Temperature::updateTemperaturesFromRawValues() {
1038
   #if ENABLED(HEATER_0_USES_MAX6675)
1045
   #if ENABLED(HEATER_0_USES_MAX6675)
1039
-    current_temperature_raw[0] = read_max6675();
1046
+    current_temperature_raw[0] = READ_MAX6675(0);
1047
+  #endif
1048
+  #if ENABLED(HEATER_1_USES_MAX6675)
1049
+    current_temperature_raw[1] = READ_MAX6675(1);
1040
   #endif
1050
   #endif
1041
   HOTEND_LOOP() current_temperature[e] = analog_to_celsius_hotend(current_temperature_raw[e], e);
1051
   HOTEND_LOOP() current_temperature[e] = analog_to_celsius_hotend(current_temperature_raw[e], e);
1042
   #if HAS_HEATED_BED
1052
   #if HAS_HEATED_BED
1170
     max6675_spi.init();
1180
     max6675_spi.init();
1171
 
1181
 
1172
     OUT_WRITE(SS_PIN, HIGH);
1182
     OUT_WRITE(SS_PIN, HIGH);
1173
-    OUT_WRITE(MAX6675_SS, HIGH);
1183
+    OUT_WRITE(MAX6675_SS_PIN, HIGH);
1174
 
1184
 
1175
   #endif // HEATER_0_USES_MAX6675
1185
   #endif // HEATER_0_USES_MAX6675
1176
 
1186
 
1187
+  #if ENABLED(HEATER_1_USES_MAX6675)
1188
+    OUT_WRITE(MAX6675_SS2_PIN, HIGH);
1189
+  #endif
1190
+
1177
   HAL_adc_init();
1191
   HAL_adc_init();
1178
 
1192
 
1179
   #if HAS_TEMP_ADC_0
1193
   #if HAS_TEMP_ADC_0
1595
 
1609
 
1596
 #endif // PROBING_HEATERS_OFF
1610
 #endif // PROBING_HEATERS_OFF
1597
 
1611
 
1598
-#if ENABLED(HEATER_0_USES_MAX6675)
1599
-
1600
-  #define MAX6675_HEAT_INTERVAL 250u
1612
+#if HAS_MAX6675
1601
 
1613
 
1602
-  #if ENABLED(MAX6675_IS_MAX31855)
1603
-    uint32_t max6675_temp = 2000;
1604
-    #define MAX6675_ERROR_MASK 7
1605
-    #define MAX6675_DISCARD_BITS 18
1606
-    #define MAX6675_SPEED_BITS 3  // (_BV(SPR1)) // clock ÷ 64
1607
-  #else
1608
-    uint16_t max6675_temp = 2000;
1609
-    #define MAX6675_ERROR_MASK 4
1610
-    #define MAX6675_DISCARD_BITS 3
1611
-    #define MAX6675_SPEED_BITS 2 // (_BV(SPR0)) // clock ÷ 16
1612
-  #endif
1614
+  int Temperature::read_max6675(
1615
+    #if COUNT_6675 > 1
1616
+      const uint8_t hindex
1617
+    #endif
1618
+  ) {
1619
+    #if COUNT_6675 == 1
1620
+      constexpr uint8_t hindex = 0;
1621
+    #endif
1613
 
1622
 
1614
-  int Temperature::read_max6675() {
1623
+    #define MAX6675_HEAT_INTERVAL 250UL
1615
 
1624
 
1616
-    static millis_t next_max6675_ms = 0;
1625
+    #if ENABLED(MAX6675_IS_MAX31855)
1626
+      static uint32_t max6675_temp = 2000;
1627
+      #define MAX6675_ERROR_MASK    7
1628
+      #define MAX6675_DISCARD_BITS 18
1629
+      #define MAX6675_SPEED_BITS    3  // (_BV(SPR1)) // clock ÷ 64
1630
+    #else
1631
+      static uint16_t max6675_temp = 2000;
1632
+      #define MAX6675_ERROR_MASK    4
1633
+      #define MAX6675_DISCARD_BITS  3
1634
+      #define MAX6675_SPEED_BITS    2  // (_BV(SPR0)) // clock ÷ 16
1635
+    #endif
1617
 
1636
 
1637
+    // Return last-read value between readings
1638
+    static millis_t next_max6675_ms[COUNT_6675] = { 0 };
1618
     millis_t ms = millis();
1639
     millis_t ms = millis();
1640
+    if (PENDING(ms, next_max6675_ms[hindex])) return int(max6675_temp);
1641
+    next_max6675_ms[hindex] = ms + MAX6675_HEAT_INTERVAL;
1619
 
1642
 
1620
-    if (PENDING(ms, next_max6675_ms)) return (int)max6675_temp;
1621
-
1622
-    next_max6675_ms = ms + MAX6675_HEAT_INTERVAL;
1643
+    //
1644
+    // TODO: spiBegin, spiRec and spiInit doesn't work when soft spi is used.
1645
+    //
1646
+    #if MB(MIGHTYBOARD_REVE)
1647
+      spiBegin();
1648
+      spiInit(MAX6675_SPEED_BITS);
1649
+    #endif
1623
 
1650
 
1624
-    spiBegin();
1625
-    spiInit(MAX6675_SPEED_BITS);
1651
+    #if COUNT_6675 > 1
1652
+      #define WRITE_MAX6675(V) do{ switch (hindex) { case 1: WRITE(MAX6675_SS2_PIN, V); break; default: WRITE(MAX6675_SS_PIN, V); } }while(0)
1653
+    #elif ENABLED(HEATER_1_USES_MAX6675)
1654
+      #define WRITE_MAX6675(V) WRITE(MAX6675_SS2_PIN, V)
1655
+    #else
1656
+      #define WRITE_MAX6675(V) WRITE(MAX6675_SS_PIN, V)
1657
+    #endif
1626
 
1658
 
1627
-    WRITE(MAX6675_SS, 0); // enable TT_MAX6675
1659
+    WRITE_MAX6675(LOW);  // enable TT_MAX6675
1628
 
1660
 
1629
     DELAY_NS(100);       // Ensure 100ns delay
1661
     DELAY_NS(100);       // Ensure 100ns delay
1630
 
1662
 
1631
     // Read a big-endian temperature value
1663
     // Read a big-endian temperature value
1632
     max6675_temp = 0;
1664
     max6675_temp = 0;
1633
     for (uint8_t i = sizeof(max6675_temp); i--;) {
1665
     for (uint8_t i = sizeof(max6675_temp); i--;) {
1634
-      max6675_temp |= spiRec();
1666
+      max6675_temp |= (
1667
+        #if MB(MIGHTYBOARD_REVE)
1668
+          max6675_spi.receive()
1669
+        #else
1670
+          spiRec()
1671
+        #endif
1672
+      );
1635
       if (i > 0) max6675_temp <<= 8; // shift left if not the last byte
1673
       if (i > 0) max6675_temp <<= 8; // shift left if not the last byte
1636
     }
1674
     }
1637
 
1675
 
1638
-    WRITE(MAX6675_SS, 1); // disable TT_MAX6675
1676
+    WRITE_MAX6675(HIGH); // disable TT_MAX6675
1639
 
1677
 
1640
     if (max6675_temp & MAX6675_ERROR_MASK) {
1678
     if (max6675_temp & MAX6675_ERROR_MASK) {
1641
       SERIAL_ERROR_START();
1679
       SERIAL_ERROR_START();
1651
       #else
1689
       #else
1652
         SERIAL_ERRORLNPGM("MAX6675");
1690
         SERIAL_ERRORLNPGM("MAX6675");
1653
       #endif
1691
       #endif
1654
-      max6675_temp = MAX6675_TMAX * 4; // thermocouple open
1692
+
1693
+      // Thermocouple open
1694
+      max6675_temp = 4 * (
1695
+        #if COUNT_6675 > 1
1696
+          hindex ? HEATER_1_MAX6675_TMAX : HEATER_0_MAX6675_TMAX
1697
+        #elif ENABLED(HEATER_1_USES_MAX6675)
1698
+          HEATER_1_MAX6675_TMAX
1699
+        #else
1700
+          HEATER_0_MAX6675_TMAX
1701
+        #endif
1702
+      );
1655
     }
1703
     }
1656
     else
1704
     else
1657
       max6675_temp >>= MAX6675_DISCARD_BITS;
1705
       max6675_temp >>= MAX6675_DISCARD_BITS;
1660
         if (max6675_temp & 0x00002000) max6675_temp |= 0xFFFFC000;
1708
         if (max6675_temp & 0x00002000) max6675_temp |= 0xFFFFC000;
1661
       #endif
1709
       #endif
1662
 
1710
 
1663
-    return (int)max6675_temp;
1711
+    return int(max6675_temp);
1664
   }
1712
   }
1665
 
1713
 
1666
-#endif // HEATER_0_USES_MAX6675
1714
+#endif // HAS_MAX6675
1667
 
1715
 
1668
 /**
1716
 /**
1669
  * Get raw temperatures
1717
  * Get raw temperatures
1670
  */
1718
  */
1671
 void Temperature::set_current_temp_raw() {
1719
 void Temperature::set_current_temp_raw() {
1720
+
1672
   #if HAS_TEMP_ADC_0 && DISABLED(HEATER_0_USES_MAX6675)
1721
   #if HAS_TEMP_ADC_0 && DISABLED(HEATER_0_USES_MAX6675)
1673
     current_temperature_raw[0] = raw_temp_value[0];
1722
     current_temperature_raw[0] = raw_temp_value[0];
1674
   #endif
1723
   #endif
1724
+
1675
   #if HAS_TEMP_ADC_1
1725
   #if HAS_TEMP_ADC_1
1726
+
1676
     #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
1727
     #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
1677
       redundant_temperature_raw = raw_temp_value[1];
1728
       redundant_temperature_raw = raw_temp_value[1];
1678
-    #else
1729
+    #elif DISABLED(HEATER_1_USES_MAX6675)
1679
       current_temperature_raw[1] = raw_temp_value[1];
1730
       current_temperature_raw[1] = raw_temp_value[1];
1680
     #endif
1731
     #endif
1732
+
1681
     #if HAS_TEMP_ADC_2
1733
     #if HAS_TEMP_ADC_2
1682
       current_temperature_raw[2] = raw_temp_value[2];
1734
       current_temperature_raw[2] = raw_temp_value[2];
1683
       #if HAS_TEMP_ADC_3
1735
       #if HAS_TEMP_ADC_3
1690
         #endif // HAS_TEMP_ADC_4
1742
         #endif // HAS_TEMP_ADC_4
1691
       #endif // HAS_TEMP_ADC_3
1743
       #endif // HAS_TEMP_ADC_3
1692
     #endif // HAS_TEMP_ADC_2
1744
     #endif // HAS_TEMP_ADC_2
1745
+
1693
   #endif // HAS_TEMP_ADC_1
1746
   #endif // HAS_TEMP_ADC_1
1694
 
1747
 
1695
   #if HAS_HEATED_BED
1748
   #if HAS_HEATED_BED
1771
 
1824
 
1772
   #if HAS_HEATED_BED
1825
   #if HAS_HEATED_BED
1773
     #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP
1826
     #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP
1774
-      #define GEBED <=
1827
+      #define BEDCMP(A,B) ((A)<=(B))
1775
     #else
1828
     #else
1776
-      #define GEBED >=
1829
+      #define BEDCMP(A,B) ((A)>=(B))
1777
     #endif
1830
     #endif
1778
     const bool bed_on = (target_temperature_bed > 0)
1831
     const bool bed_on = (target_temperature_bed > 0)
1779
       #if ENABLED(PIDTEMPBED)
1832
       #if ENABLED(PIDTEMPBED)
1780
         || (soft_pwm_amount_bed > 0)
1833
         || (soft_pwm_amount_bed > 0)
1781
       #endif
1834
       #endif
1782
     ;
1835
     ;
1783
-    if (current_temperature_bed_raw GEBED bed_maxttemp_raw) max_temp_error(-1);
1784
-    if (bed_minttemp_raw GEBED current_temperature_bed_raw && bed_on) min_temp_error(-1);
1836
+    if (BEDCMP(current_temperature_bed_raw, bed_maxttemp_raw)) max_temp_error(-1);
1837
+    if (BEDCMP(bed_minttemp_raw, current_temperature_bed_raw) && bed_on) min_temp_error(-1);
1785
   #endif
1838
   #endif
1786
 }
1839
 }
1787
 
1840
 

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

632
 
632
 
633
     static void updateTemperaturesFromRawValues();
633
     static void updateTemperaturesFromRawValues();
634
 
634
 
635
-    #if ENABLED(HEATER_0_USES_MAX6675)
636
-      static int read_max6675();
635
+    #define HAS_MAX6675 (ENABLED(HEATER_0_USES_MAX6675) || ENABLED(HEATER_1_USES_MAX6675))
636
+    #if HAS_MAX6675
637
+      #if ENABLED(HEATER_0_USES_MAX6675) && ENABLED(HEATER_1_USES_MAX6675)
638
+        #define COUNT_6675 2
639
+      #else
640
+        #define COUNT_6675 1
641
+      #endif
642
+      #if COUNT_6675 > 1
643
+        #define READ_MAX6675(N) read_max6675(N)
644
+      #else
645
+        #define READ_MAX6675(N) read_max6675()
646
+      #endif
647
+      static int read_max6675(
648
+        #if COUNT_6675 > 1
649
+          const uint8_t hindex=0
650
+        #endif
651
+      );
637
     #endif
652
     #endif
638
 
653
 
639
     static void checkExtruderAutoFans();
654
     static void checkExtruderAutoFans();

+ 9
- 6
Marlin/src/pins/pinsDebug_list.h View File

572
 #if PIN_EXISTS(MAX6675_SCK)
572
 #if PIN_EXISTS(MAX6675_SCK)
573
   REPORT_NAME_DIGITAL(__LINE__, MAX6675_SCK_PIN)
573
   REPORT_NAME_DIGITAL(__LINE__, MAX6675_SCK_PIN)
574
 #endif
574
 #endif
575
-#if defined(MAX6675_SS) && MAX6675_SS >= 0
576
-  REPORT_NAME_DIGITAL(__LINE__, MAX6675_SS)
575
+#if PIN_EXISTS(MAX6675_SS)
576
+  REPORT_NAME_DIGITAL(__LINE__, MAX6675_SS_PIN)
577
+#endif
578
+#if PIN_EXISTS(MAX6675_SS2)
579
+  REPORT_NAME_DIGITAL(__LINE__, MAX6675_SS2_PIN)
577
 #endif
580
 #endif
578
 // #if defined(MISO) && MISO >= 0
581
 // #if defined(MISO) && MISO >= 0
579
 //   REPORT_NAME_DIGITAL(__LINE__, MISO)
582
 //   REPORT_NAME_DIGITAL(__LINE__, MISO)
803
 #if PIN_EXISTS(SUICIDE)
806
 #if PIN_EXISTS(SUICIDE)
804
   REPORT_NAME_DIGITAL(__LINE__, SUICIDE_PIN)
807
   REPORT_NAME_DIGITAL(__LINE__, SUICIDE_PIN)
805
 #endif
808
 #endif
806
-#if defined(THERMO_CS1) && THERMO_CS1 >= 0
807
-  REPORT_NAME_DIGITAL(__LINE__, THERMO_CS1)
809
+#if PIN_EXISTS(THERMO_CS1)
810
+  REPORT_NAME_DIGITAL(__LINE__, THERMO_CS1_PIN)
808
 #endif
811
 #endif
809
-#if defined(THERMO_CS2) && THERMO_CS2 >= 0
810
-  REPORT_NAME_DIGITAL(__LINE__, THERMO_CS2)
812
+#if PIN_EXISTS(THERMO_CS2)
813
+  REPORT_NAME_DIGITAL(__LINE__, THERMO_CS2_PIN)
811
 #endif
814
 #endif
812
 #if PIN_EXISTS(THERMO_DO)
815
 #if PIN_EXISTS(THERMO_DO)
813
   REPORT_NAME_DIGITAL(__LINE__, THERMO_DO_PIN)
816
   REPORT_NAME_DIGITAL(__LINE__, THERMO_DO_PIN)

+ 2
- 2
Marlin/src/pins/pins_DUE3DOM.h View File

85
 
85
 
86
 // SPI for Max6675 or Max31855 Thermocouple
86
 // SPI for Max6675 or Max31855 Thermocouple
87
 #if DISABLED(SDSUPPORT)
87
 #if DISABLED(SDSUPPORT)
88
-  #define MAX6675_SS        -1
88
+  #define MAX6675_SS_PIN   -1
89
 #else
89
 #else
90
-  #define MAX6675_SS        -1
90
+  #define MAX6675_SS_PIN   -1
91
 #endif
91
 #endif
92
 
92
 
93
 //
93
 //

+ 2
- 2
Marlin/src/pins/pins_DUE3DOM_MINI.h View File

77
 
77
 
78
 // SPI for Max6675 or Max31855 Thermocouple
78
 // SPI for Max6675 or Max31855 Thermocouple
79
 #if DISABLED(SDSUPPORT)
79
 #if DISABLED(SDSUPPORT)
80
-  #define MAX6675_SS       53
80
+  #define MAX6675_SS_PIN   53
81
 #else
81
 #else
82
-  #define MAX6675_SS       53
82
+  #define MAX6675_SS_PIN   53
83
 #endif
83
 #endif
84
 
84
 
85
 //
85
 //

+ 2
- 2
Marlin/src/pins/pins_FORMBOT_RAPTOR.h View File

113
 
113
 
114
 // SPI for Max6675 or Max31855 Thermocouple
114
 // SPI for Max6675 or Max31855 Thermocouple
115
 #if DISABLED(SDSUPPORT)
115
 #if DISABLED(SDSUPPORT)
116
-  #define MAX6675_SS       66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card
116
+  #define MAX6675_SS_PIN   66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card
117
 #else
117
 #else
118
-  #define MAX6675_SS       66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
118
+  #define MAX6675_SS_PIN   66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
119
 #endif
119
 #endif
120
 
120
 
121
 //
121
 //

+ 2
- 2
Marlin/src/pins/pins_FORMBOT_TREX2PLUS.h View File

113
 
113
 
114
 // SPI for Max6675 or Max31855 Thermocouple
114
 // SPI for Max6675 or Max31855 Thermocouple
115
 #if DISABLED(SDSUPPORT)
115
 #if DISABLED(SDSUPPORT)
116
-  #define MAX6675_SS       66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card
116
+  #define MAX6675_SS_PIN   66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card
117
 #else
117
 #else
118
-  #define MAX6675_SS       66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
118
+  #define MAX6675_SS_PIN   66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
119
 #endif
119
 #endif
120
 
120
 
121
 //
121
 //

+ 2
- 2
Marlin/src/pins/pins_FORMBOT_TREX3.h View File

113
 
113
 
114
 // SPI for Max6675 or Max31855 Thermocouple
114
 // SPI for Max6675 or Max31855 Thermocouple
115
 #if DISABLED(SDSUPPORT)
115
 #if DISABLED(SDSUPPORT)
116
-  #define MAX6675_SS       66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card
116
+  #define MAX6675_SS_PIN   66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card
117
 #else
117
 #else
118
-  #define MAX6675_SS       66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
118
+  #define MAX6675_SS_PIN   66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
119
 #endif
119
 #endif
120
 
120
 
121
 //
121
 //

+ 5
- 3
Marlin/src/pins/pins_MIGHTYBOARD_REVE.h View File

136
 //
136
 //
137
 #define THERMO_SCK_PIN     78   // E2
137
 #define THERMO_SCK_PIN     78   // E2
138
 #define THERMO_DO_PIN       3   // E5
138
 #define THERMO_DO_PIN       3   // E5
139
-#define THERMO_CS1          5   // E3
140
-#define THERMO_CS2          2   // E4
139
+#define THERMO_CS1_PIN      5   // E3
140
+#define THERMO_CS2_PIN      2   // E4
141
 
141
 
142
-#define MAX6675_SS         THERMO_CS1
142
+#define MAX6675_SS_PIN     THERMO_CS1_PIN
143
+#define MAX6675_SS2_PIN    THERMO_CS2_PIN
143
 #define MAX6675_SCK_PIN    THERMO_SCK_PIN
144
 #define MAX6675_SCK_PIN    THERMO_SCK_PIN
144
 #define MAX6675_DO_PIN     THERMO_DO_PIN
145
 #define MAX6675_DO_PIN     THERMO_DO_PIN
146
+
145
 //
147
 //
146
 // Augmentation for auto-assigning plugs
148
 // Augmentation for auto-assigning plugs
147
 //
149
 //

+ 2
- 2
Marlin/src/pins/pins_RADDS.h View File

172
 
172
 
173
 // SPI for Max6675 or Max31855 Thermocouple
173
 // SPI for Max6675 or Max31855 Thermocouple
174
 #if DISABLED(SDSUPPORT)
174
 #if DISABLED(SDSUPPORT)
175
-  #define MAX6675_SS       53
175
+  #define MAX6675_SS_PIN   53
176
 #else
176
 #else
177
-  #define MAX6675_SS       49
177
+  #define MAX6675_SS_PIN   49
178
 #endif
178
 #endif
179
 
179
 
180
 //
180
 //

+ 2
- 2
Marlin/src/pins/pins_RAMPS.h View File

205
 
205
 
206
 // SPI for Max6675 or Max31855 Thermocouple
206
 // SPI for Max6675 or Max31855 Thermocouple
207
 #if DISABLED(SDSUPPORT)
207
 #if DISABLED(SDSUPPORT)
208
-  #define MAX6675_SS       66   // Do not use pin 53 if there is even the remote possibility of using Display/SD card
208
+  #define MAX6675_SS_PIN   66   // Do not use pin 53 if there is even the remote possibility of using Display/SD card
209
 #else
209
 #else
210
-  #define MAX6675_SS       66   // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
210
+  #define MAX6675_SS_PIN   66   // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
211
 #endif
211
 #endif
212
 
212
 
213
 //
213
 //

+ 3
- 3
Marlin/src/pins/pins_RAMPS_DUO.h View File

64
 #define TEMP_BED_PIN       10   // Analog Input
64
 #define TEMP_BED_PIN       10   // Analog Input
65
 
65
 
66
 // SPI for Max6675 or Max31855 Thermocouple
66
 // SPI for Max6675 or Max31855 Thermocouple
67
-#undef MAX6675_SS
67
+#undef MAX6675_SS_PIN
68
 #if DISABLED(SDSUPPORT)
68
 #if DISABLED(SDSUPPORT)
69
-  #define MAX6675_SS       69   // Do not use pin 53 if there is even the remote possibility of using Display/SD card
69
+  #define MAX6675_SS_PIN   69   // Do not use pin 53 if there is even the remote possibility of using Display/SD card
70
 #else
70
 #else
71
-  #define MAX6675_SS       69   // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
71
+  #define MAX6675_SS_PIN   69   // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
72
 #endif
72
 #endif
73
 
73
 
74
 //
74
 //

+ 2
- 2
Marlin/src/pins/pins_RAMPS_FD_V1.h View File

112
 
112
 
113
 // SPI for Max6675 or Max31855 Thermocouple
113
 // SPI for Max6675 or Max31855 Thermocouple
114
 #if DISABLED(SDSUPPORT)
114
 #if DISABLED(SDSUPPORT)
115
-  #define MAX6675_SS       53
115
+  #define MAX6675_SS_PIN   53
116
 #else
116
 #else
117
-  #define MAX6675_SS       49
117
+  #define MAX6675_SS_PIN   49
118
 #endif
118
 #endif
119
 
119
 
120
 //
120
 //

+ 2
- 2
Marlin/src/pins/pins_RAMPS_OLD.h View File

77
 
77
 
78
 // SPI for Max6675 or Max31855 Thermocouple
78
 // SPI for Max6675 or Max31855 Thermocouple
79
 #if DISABLED(SDSUPPORT)
79
 #if DISABLED(SDSUPPORT)
80
-  #define MAX6675_SS       66   // Do not use pin 53 if there is even the remote possibility of using Display/SD card
80
+  #define MAX6675_SS_PIN   66   // Do not use pin 53 if there is even the remote possibility of using Display/SD card
81
 #else
81
 #else
82
-  #define MAX6675_SS       66   // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
82
+  #define MAX6675_SS_PIN   66   // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
83
 #endif
83
 #endif
84
 
84
 
85
 //
85
 //

+ 3
- 4
Marlin/src/pins/pins_RAMPS_SMART.h View File

87
 #define TEMP_BED_PIN       11   // Analog Input
87
 #define TEMP_BED_PIN       11   // Analog Input
88
 
88
 
89
 // SPI for Max6675 or Max31855 Thermocouple
89
 // SPI for Max6675 or Max31855 Thermocouple
90
+#undef MAX6675_SS_PIN
90
 #if DISABLED(SDSUPPORT)
91
 #if DISABLED(SDSUPPORT)
91
-  #undef MAX6675_SS
92
-  #define MAX6675_SS       67   // Do not use pin 53 if there is even the remote possibility of using Display/SD card
92
+  #define MAX6675_SS_PIN   67   // Do not use pin 53 if there is even the remote possibility of using Display/SD card
93
 #else
93
 #else
94
-  #undef MAX6675_SS
95
-  #define MAX6675_SS       67   // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
94
+  #define MAX6675_SS_PIN   67   // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
96
 #endif
95
 #endif
97
 
96
 
98
 //
97
 //

+ 3
- 3
Marlin/src/pins/pins_RIGIDBOARD.h View File

73
 #define TEMP_BED_PIN       15   // Analog Input
73
 #define TEMP_BED_PIN       15   // Analog Input
74
 
74
 
75
 // SPI for Max6675 or Max31855 Thermocouple
75
 // SPI for Max6675 or Max31855 Thermocouple
76
-#undef MAX6675_SS
76
+#undef MAX6675_SS_PIN
77
 #if DISABLED(SDSUPPORT)
77
 #if DISABLED(SDSUPPORT)
78
-  #define MAX6675_SS       53   // Don't use pin 53 if there is even the remote possibility of using Display/SD card
78
+  #define MAX6675_SS_PIN   53   // Don't use pin 53 if there is even the remote possibility of using Display/SD card
79
 #else
79
 #else
80
-  #define MAX6675_SS       49   // Don't use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
80
+  #define MAX6675_SS_PIN   49   // Don't use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
81
 #endif
81
 #endif
82
 
82
 
83
 //
83
 //

+ 7
- 5
Marlin/src/pins/pins_RURAMPS4D_11.h View File

158
 #endif
158
 #endif
159
 
159
 
160
 // SPI for Max6675 or Max31855 Thermocouple
160
 // SPI for Max6675 or Max31855 Thermocouple
161
-//#if DISABLED(SDSUPPORT)
162
-//  #define MAX6675_SS        53
163
-//#else
164
-//  #define MAX6675_SS        49
165
-//#endif
161
+/*
162
+#if DISABLED(SDSUPPORT)
163
+  #define MAX6675_SS_PIN   53
164
+#else
165
+  #define MAX6675_SS_PIN   49
166
+#endif
167
+*/
166
 
168
 
167
 //
169
 //
168
 // Misc. Functions
170
 // Misc. Functions

+ 7
- 5
Marlin/src/pins/pins_RURAMPS4D_13.h View File

144
 #endif
144
 #endif
145
 
145
 
146
 // SPI for Max6675 or Max31855 Thermocouple
146
 // SPI for Max6675 or Max31855 Thermocouple
147
-//#if DISABLED(SDSUPPORT)
148
-//  #define MAX6675_SS        53
149
-//#else
150
-//  #define MAX6675_SS        49
151
-//#endif
147
+/*
148
+#if DISABLED(SDSUPPORT)
149
+  #define MAX6675_SS_PIN   53
150
+#else
151
+  #define MAX6675_SS_PIN   49
152
+#endif
153
+*/
152
 
154
 
153
 //
155
 //
154
 // Misc. Functions
156
 // Misc. Functions

+ 1
- 1
Marlin/src/pins/pins_ULTRATRONICS_PRO.h View File

125
 #define SPI_FLASH_CS       -1
125
 #define SPI_FLASH_CS       -1
126
 
126
 
127
 // SPI for Max6675 or Max31855 Thermocouple
127
 // SPI for Max6675 or Max31855 Thermocouple
128
-#define MAX6675_SS         65
128
+#define MAX6675_SS_PIN     65
129
 #define MAX31855_SS0       65
129
 #define MAX31855_SS0       65
130
 #define MAX31855_SS1       52
130
 #define MAX31855_SS1       52
131
 #define MAX31855_SS2       50
131
 #define MAX31855_SS2       50

Loading…
Cancel
Save