My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

thermistors.h 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. #include "../../inc/MarlinConfig.h"
  24. #define THERMISTOR_TABLE_ADC_RESOLUTION 10
  25. #define THERMISTOR_TABLE_SCALE (HAL_ADC_RANGE / _BV(THERMISTOR_TABLE_ADC_RESOLUTION))
  26. #if ENABLED(HAL_ADC_FILTERED)
  27. #define OVERSAMPLENR 1
  28. #else
  29. #define OVERSAMPLENR 16
  30. #endif
  31. // Currently Marlin stores all oversampled ADC values as uint16_t, make sure the HAL settings do not overflow 16 bit
  32. #if (HAL_ADC_RANGE) * (OVERSAMPLENR) > 1 << 16
  33. #error "MAX_RAW_THERMISTOR_VALUE is too large for uint16_t. Reduce OVERSAMPLENR or HAL_ADC_RESOLUTION."
  34. #endif
  35. #define MAX_RAW_THERMISTOR_VALUE (uint16_t(HAL_ADC_RANGE) * (OVERSAMPLENR) - 1)
  36. #define OV_SCALE(N) float(N)
  37. #define OV(N) raw_adc_t(OV_SCALE(N) * (OVERSAMPLENR) * (THERMISTOR_TABLE_SCALE))
  38. typedef struct { raw_adc_t value; celsius_t celsius; } temp_entry_t;
  39. // Pt1000 and Pt100 handling
  40. //
  41. // Rt=R0*(1+a*T+b*T*T) [for T>0]
  42. // a=3.9083E-3, b=-5.775E-7
  43. #define PtA 3.9083E-3
  44. #define PtB -5.775E-7
  45. #define PtRt(T,R0) ((R0) * (1.0 + (PtA) * (T) + (PtB) * (T) * (T)))
  46. #define PtAdVal(T,R0,Rup) (short)(1024 / (Rup / PtRt(T, R0) + 1))
  47. #define PtLine(T,R0,Rup) { OV(PtAdVal(T, R0, Rup)), T }
  48. #if ANY_THERMISTOR_IS(1) // beta25 = 4092 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "EPCOS"
  49. #include "thermistor_1.h"
  50. #endif
  51. #if ANY_THERMISTOR_IS(2) // 4338 K, R25 = 200 kOhm, Pull-up = 4.7 kOhm, "ATC Semitec 204GT-2"
  52. #include "thermistor_2.h"
  53. #endif
  54. #if ANY_THERMISTOR_IS(3) // beta25 = 4120 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Mendel-parts"
  55. #include "thermistor_3.h"
  56. #endif
  57. #if ANY_THERMISTOR_IS(4) // beta25 = 3950 K, R25 = 10 kOhm, Pull-up = 4.7 kOhm, "Generic"
  58. #include "thermistor_4.h"
  59. #endif
  60. #if ANY_THERMISTOR_IS(5) // beta25 = 4267 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "ParCan, ATC 104GT-2"
  61. #include "thermistor_5.h"
  62. #endif
  63. #if ANY_THERMISTOR_IS(501) // 100K Zonestar thermistor
  64. #include "thermistor_501.h"
  65. #endif
  66. #if ANY_THERMISTOR_IS(502) // Unknown thermistor used by the Zonestar Průša P802M hot bed
  67. #include "thermistor_502.h"
  68. #endif
  69. #if ANY_THERMISTOR_IS(503) // Zonestar (Z8XM2) Heated Bed thermistor
  70. #include "thermistor_503.h"
  71. #endif
  72. #if ANY_THERMISTOR_IS(504) // Zonestar (P802QR2 Hot End) thermistors
  73. #include "thermistor_504.h"
  74. #endif
  75. #if ANY_THERMISTOR_IS(505) // Zonestar (P802QR2 Bed) thermistor
  76. #include "thermistor_505.h"
  77. #endif
  78. #if ANY_THERMISTOR_IS(512) // 100k thermistor in RPW-Ultra hotend, Pull-up = 4.7 kOhm, "unknown model"
  79. #include "thermistor_512.h"
  80. #endif
  81. #if ANY_THERMISTOR_IS(6) // beta25 = 4092 K, R25 = 100 kOhm, Pull-up = 8.2 kOhm, "EPCOS ?"
  82. #include "thermistor_6.h"
  83. #endif
  84. #if ANY_THERMISTOR_IS(7) // beta25 = 3974 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Honeywell 135-104LAG-J01"
  85. #include "thermistor_7.h"
  86. #endif
  87. #if ANY_THERMISTOR_IS(71) // beta25 = 3974 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Honeywell 135-104LAF-J01"
  88. #include "thermistor_71.h"
  89. #endif
  90. #if ANY_THERMISTOR_IS(8) // beta25 = 3950 K, R25 = 100 kOhm, Pull-up = 10 kOhm, "Vishay E3104FHT"
  91. #include "thermistor_8.h"
  92. #endif
  93. #if ANY_THERMISTOR_IS(9) // beta25 = 3960 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "GE Sensing AL03006-58.2K-97-G1"
  94. #include "thermistor_9.h"
  95. #endif
  96. #if ANY_THERMISTOR_IS(10) // beta25 = 3960 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "RS 198-961"
  97. #include "thermistor_10.h"
  98. #endif
  99. #if ANY_THERMISTOR_IS(11) // beta25 = 3950 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "QU-BD silicone bed, QWG-104F-3950"
  100. #include "thermistor_11.h"
  101. #endif
  102. #if ANY_THERMISTOR_IS(13) // beta25 = 4100 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Hisens"
  103. #include "thermistor_13.h"
  104. #endif
  105. #if ANY_THERMISTOR_IS(15) // JGAurora A5 thermistor calibration
  106. #include "thermistor_15.h"
  107. #endif
  108. #if ANY_THERMISTOR_IS(17) // Dagoma NTC 100k white thermistor
  109. #include "thermistor_17.h"
  110. #endif
  111. #if ANY_THERMISTOR_IS(18) // ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327
  112. #include "thermistor_18.h"
  113. #endif
  114. #if ANY_THERMISTOR_IS(20) // Pt100 with INA826 amp on Ultimaker v2.0 electronics
  115. #include "thermistor_20.h"
  116. #endif
  117. #if ANY_THERMISTOR_IS(21) // Pt100 with INA826 amp with 3.3v excitation based on "Pt100 with INA826 amp on Ultimaker v2.0 electronics"
  118. #include "thermistor_21.h"
  119. #endif
  120. #if ANY_THERMISTOR_IS(22) // Thermistor in a Rostock 301 hot end, calibrated with a multimeter
  121. #include "thermistor_22.h"
  122. #endif
  123. #if ANY_THERMISTOR_IS(23) // By AluOne #12622. Formerly 22 above. May need calibration/checking.
  124. #include "thermistor_23.h"
  125. #endif
  126. #if ANY_THERMISTOR_IS(30) // Kis3d Silicone mat 24V 200W/300W with 6mm Precision cast plate (EN AW 5083)
  127. #include "thermistor_30.h"
  128. #endif
  129. #if ANY_THERMISTOR_IS(51) // beta25 = 4092 K, R25 = 100 kOhm, Pull-up = 1 kOhm, "EPCOS"
  130. #include "thermistor_51.h"
  131. #endif
  132. #if ANY_THERMISTOR_IS(52) // beta25 = 4338 K, R25 = 200 kOhm, Pull-up = 1 kOhm, "ATC Semitec 204GT-2"
  133. #include "thermistor_52.h"
  134. #endif
  135. #if ANY_THERMISTOR_IS(55) // beta25 = 4267 K, R25 = 100 kOhm, Pull-up = 1 kOhm, "ATC Semitec 104GT-2 (Used on ParCan)"
  136. #include "thermistor_55.h"
  137. #endif
  138. #if ANY_THERMISTOR_IS(60) // beta25 = 3950 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Maker's Tool Works Kapton Bed"
  139. #include "thermistor_60.h"
  140. #endif
  141. #if ANY_THERMISTOR_IS(61) // beta25 = 3950 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Formbot 350°C Thermistor"
  142. #include "thermistor_61.h"
  143. #endif
  144. #if ANY_THERMISTOR_IS(66) // beta25 = 4500 K, R25 = 2.5 MOhm, Pull-up = 4.7 kOhm, "DyzeDesign 500 °C Thermistor"
  145. #include "thermistor_66.h"
  146. #endif
  147. #if ANY_THERMISTOR_IS(67) // R25 = 500 KOhm, beta25 = 3800 K, 4.7 kOhm pull-up, SliceEngineering 450 °C Thermistor
  148. #include "thermistor_67.h"
  149. #endif
  150. #if ANY_THERMISTOR_IS(68) // PT-100 with Dyze amplifier board
  151. #include "thermistor_68.h"
  152. #endif
  153. #if ANY_THERMISTOR_IS(12) // beta25 = 4700 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Personal calibration for Makibox hot bed"
  154. #include "thermistor_12.h"
  155. #endif
  156. #if ANY_THERMISTOR_IS(70) // beta25 = 4100 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Hephestos 2, bqh2 stock thermistor"
  157. #include "thermistor_70.h"
  158. #endif
  159. #if ANY_THERMISTOR_IS(75) // beta25 = 4100 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "MGB18-104F39050L32 thermistor"
  160. #include "thermistor_75.h"
  161. #endif
  162. #if ANY_THERMISTOR_IS(99) // 100k bed thermistor with a 10K pull-up resistor (on some Wanhao i3 models)
  163. #include "thermistor_99.h"
  164. #endif
  165. #if ANY_THERMISTOR_IS(110) // Pt100 with 1k0 pullup
  166. #include "thermistor_110.h"
  167. #endif
  168. #if ANY_THERMISTOR_IS(147) // Pt100 with 4k7 pullup
  169. #include "thermistor_147.h"
  170. #endif
  171. #if ANY_THERMISTOR_IS(201) // Pt100 with LMV324 Overlord
  172. #include "thermistor_201.h"
  173. #endif
  174. #if ANY_THERMISTOR_IS(202) // 200K thermistor in Copymaker3D hotend
  175. #include "thermistor_202.h"
  176. #endif
  177. #if ANY_THERMISTOR_IS(331) // Like table 1, but with 3V3 as input voltage for MEGA
  178. #include "thermistor_331.h"
  179. #endif
  180. #if ANY_THERMISTOR_IS(332) // Like table 1, but with 3V3 as input voltage for DUE
  181. #include "thermistor_332.h"
  182. #endif
  183. #if ANY_THERMISTOR_IS(666) // beta25 = UNK, R25 = 200K, Pull-up = 10 kOhm, "Unidentified 200K NTC thermistor (Einstart S)"
  184. #include "thermistor_666.h"
  185. #endif
  186. #if ANY_THERMISTOR_IS(1010) // Pt1000 with 1k0 pullup
  187. #include "thermistor_1010.h"
  188. #endif
  189. #if ANY_THERMISTOR_IS(1022) // Pt1000 with 2k2 pullup
  190. #include "thermistor_1022.h"
  191. #endif
  192. #if ANY_THERMISTOR_IS(1047) // Pt1000 with 4k7 pullup
  193. #include "thermistor_1047.h"
  194. #endif
  195. #if ANY_THERMISTOR_IS(2000) // "Ultimachine Rambo TDK NTCG104LH104KT1 NTC100K motherboard Thermistor" https://product.tdk.com/en/search/sensor/ntc/chip-ntc-thermistor/info?part_no=NTCG104LH104KT1
  196. #include "thermistor_2000.h"
  197. #endif
  198. #if ANY_THERMISTOR_IS(998) // User-defined table 1
  199. #include "thermistor_998.h"
  200. #endif
  201. #if ANY_THERMISTOR_IS(999) // User-defined table 2
  202. #include "thermistor_999.h"
  203. #endif
  204. #if ANY_THERMISTOR_IS(1000) // Custom
  205. constexpr temp_entry_t temptable_1000[] PROGMEM = { { 0, 0 } };
  206. #endif
  207. #define _TT_NAME(_N) temptable_ ## _N
  208. #define TT_NAME(_N) _TT_NAME(_N)
  209. #if TEMP_SENSOR_0 > 0
  210. #define TEMPTABLE_0 TT_NAME(TEMP_SENSOR_0)
  211. #define TEMPTABLE_0_LEN COUNT(TEMPTABLE_0)
  212. #else
  213. #define TEMPTABLE_0 nullptr
  214. #define TEMPTABLE_0_LEN 0
  215. #endif
  216. #if TEMP_SENSOR_1 > 0
  217. #define TEMPTABLE_1 TT_NAME(TEMP_SENSOR_1)
  218. #define TEMPTABLE_1_LEN COUNT(TEMPTABLE_1)
  219. #else
  220. #define TEMPTABLE_1 nullptr
  221. #define TEMPTABLE_1_LEN 0
  222. #endif
  223. #if TEMP_SENSOR_2 > 0
  224. #define TEMPTABLE_2 TT_NAME(TEMP_SENSOR_2)
  225. #define TEMPTABLE_2_LEN COUNT(TEMPTABLE_2)
  226. #else
  227. #define TEMPTABLE_2 nullptr
  228. #define TEMPTABLE_2_LEN 0
  229. #endif
  230. #if TEMP_SENSOR_3 > 0
  231. #define TEMPTABLE_3 TT_NAME(TEMP_SENSOR_3)
  232. #define TEMPTABLE_3_LEN COUNT(TEMPTABLE_3)
  233. #else
  234. #define TEMPTABLE_3 nullptr
  235. #define TEMPTABLE_3_LEN 0
  236. #endif
  237. #if TEMP_SENSOR_4 > 0
  238. #define TEMPTABLE_4 TT_NAME(TEMP_SENSOR_4)
  239. #define TEMPTABLE_4_LEN COUNT(TEMPTABLE_4)
  240. #else
  241. #define TEMPTABLE_4 nullptr
  242. #define TEMPTABLE_4_LEN 0
  243. #endif
  244. #if TEMP_SENSOR_5 > 0
  245. #define TEMPTABLE_5 TT_NAME(TEMP_SENSOR_5)
  246. #define TEMPTABLE_5_LEN COUNT(TEMPTABLE_5)
  247. #else
  248. #define TEMPTABLE_5 nullptr
  249. #define TEMPTABLE_5_LEN 0
  250. #endif
  251. #if TEMP_SENSOR_6 > 0
  252. #define TEMPTABLE_6 TT_NAME(TEMP_SENSOR_6)
  253. #define TEMPTABLE_6_LEN COUNT(TEMPTABLE_6)
  254. #else
  255. #define TEMPTABLE_6 nullptr
  256. #define TEMPTABLE_6_LEN 0
  257. #endif
  258. #if TEMP_SENSOR_7 > 0
  259. #define TEMPTABLE_7 TT_NAME(TEMP_SENSOR_7)
  260. #define TEMPTABLE_7_LEN COUNT(TEMPTABLE_7)
  261. #else
  262. #define TEMPTABLE_7 nullptr
  263. #define TEMPTABLE_7_LEN 0
  264. #endif
  265. #if TEMP_SENSOR_BED > 0
  266. #define TEMPTABLE_BED TT_NAME(TEMP_SENSOR_BED)
  267. #define TEMPTABLE_BED_LEN COUNT(TEMPTABLE_BED)
  268. #else
  269. #define TEMPTABLE_BED_LEN 0
  270. #endif
  271. #if TEMP_SENSOR_CHAMBER > 0
  272. #define TEMPTABLE_CHAMBER TT_NAME(TEMP_SENSOR_CHAMBER)
  273. #define TEMPTABLE_CHAMBER_LEN COUNT(TEMPTABLE_CHAMBER)
  274. #else
  275. #define TEMPTABLE_CHAMBER_LEN 0
  276. #endif
  277. #if TEMP_SENSOR_PROBE > 0
  278. #define TEMPTABLE_PROBE TT_NAME(TEMP_SENSOR_PROBE)
  279. #define TEMPTABLE_PROBE_LEN COUNT(TEMPTABLE_PROBE)
  280. #else
  281. #define TEMPTABLE_PROBE_LEN 0
  282. #endif
  283. #if TEMP_SENSOR_COOLER > 0
  284. #define TEMPTABLE_COOLER TT_NAME(TEMP_SENSOR_COOLER)
  285. #define TEMPTABLE_COOLER_LEN COUNT(TEMPTABLE_COOLER)
  286. #else
  287. #define TEMPTABLE_COOLER_LEN 0
  288. #endif
  289. #if TEMP_SENSOR_BOARD > 0
  290. #define TEMPTABLE_BOARD TT_NAME(TEMP_SENSOR_BOARD)
  291. #define TEMPTABLE_BOARD_LEN COUNT(TEMPTABLE_BOARD)
  292. #else
  293. #define TEMPTABLE_BOARD_LEN 0
  294. #endif
  295. #if TEMP_SENSOR_REDUNDANT > 0
  296. #define TEMPTABLE_REDUNDANT TT_NAME(TEMP_SENSOR_REDUNDANT)
  297. #define TEMPTABLE_REDUNDANT_LEN COUNT(TEMPTABLE_REDUNDANT)
  298. #else
  299. #define TEMPTABLE_REDUNDANT_LEN 0
  300. #endif
  301. // The SCAN_THERMISTOR_TABLE macro needs alteration?
  302. static_assert(255 > TEMPTABLE_0_LEN || 255 > TEMPTABLE_1_LEN || 255 > TEMPTABLE_2_LEN || 255 > TEMPTABLE_3_LEN
  303. || 255 > TEMPTABLE_4_LEN || 255 > TEMPTABLE_5_LEN || 255 > TEMPTABLE_6_LEN || 255 > TEMPTABLE_7_LEN
  304. || 255 > TEMPTABLE_BED_LEN
  305. || 255 > TEMPTABLE_CHAMBER_LEN
  306. || 255 > TEMPTABLE_PROBE_LEN
  307. || 255 > TEMPTABLE_COOLER_LEN
  308. || 255 > TEMPTABLE_BOARD_LEN
  309. || 255 > TEMPTABLE_REDUNDANT_LEN
  310. , "Temperature conversion tables over 255 entries need special consideration."
  311. );
  312. // Set the high and low raw values for the heaters
  313. // For thermistors the highest temperature results in the lowest ADC value
  314. // For thermocouples the highest temperature results in the highest ADC value
  315. #define _TT_REV(N) REVERSE_TEMP_SENSOR_RANGE_##N
  316. #define TT_REV(N) TERN0(TEMP_SENSOR_##N##_IS_THERMISTOR, DEFER4(_TT_REV)(TEMP_SENSOR(N)))
  317. #define _TT_REVRAW(N) !TEMP_SENSOR_##N##_IS_THERMISTOR
  318. #define TT_REVRAW(N) (TT_REV(N) || _TT_REVRAW(N))
  319. #ifdef TEMPTABLE_0
  320. #if TT_REV(0)
  321. #define TEMP_SENSOR_0_MINTEMP_IND 0
  322. #define TEMP_SENSOR_0_MAXTEMP_IND TEMPTABLE_0_LEN - 1
  323. #else
  324. #define TEMP_SENSOR_0_MINTEMP_IND TEMPTABLE_0_LEN - 1
  325. #define TEMP_SENSOR_0_MAXTEMP_IND 0
  326. #endif
  327. #endif
  328. #ifdef TEMPTABLE_1
  329. #if TT_REV(1)
  330. #define TEMP_SENSOR_1_MINTEMP_IND 0
  331. #define TEMP_SENSOR_1_MAXTEMP_IND TEMPTABLE_1_LEN - 1
  332. #else
  333. #define TEMP_SENSOR_1_MINTEMP_IND TEMPTABLE_1_LEN - 1
  334. #define TEMP_SENSOR_1_MAXTEMP_IND 0
  335. #endif
  336. #endif
  337. #ifdef TEMPTABLE_2
  338. #if TT_REV(2)
  339. #define TEMP_SENSOR_2_MINTEMP_IND 0
  340. #define TEMP_SENSOR_2_MAXTEMP_IND TEMPTABLE_2_LEN - 1
  341. #else
  342. #define TEMP_SENSOR_2_MINTEMP_IND TEMPTABLE_2_LEN - 1
  343. #define TEMP_SENSOR_2_MAXTEMP_IND 0
  344. #endif
  345. #endif
  346. #ifdef TEMPTABLE_3
  347. #if TT_REV(3)
  348. #define TEMP_SENSOR_3_MINTEMP_IND 0
  349. #define TEMP_SENSOR_3_MAXTEMP_IND TEMPTABLE_3_LEN - 1
  350. #else
  351. #define TEMP_SENSOR_3_MINTEMP_IND TEMPTABLE_3_LEN - 1
  352. #define TEMP_SENSOR_3_MAXTEMP_IND 0
  353. #endif
  354. #endif
  355. #ifdef TEMPTABLE_4
  356. #if TT_REV(4)
  357. #define TEMP_SENSOR_4_MINTEMP_IND 0
  358. #define TEMP_SENSOR_4_MAXTEMP_IND TEMPTABLE_4_LEN - 1
  359. #else
  360. #define TEMP_SENSOR_4_MINTEMP_IND TEMPTABLE_4_LEN - 1
  361. #define TEMP_SENSOR_4_MAXTEMP_IND 0
  362. #endif
  363. #endif
  364. #ifdef TEMPTABLE_5
  365. #if TT_REV(5)
  366. #define TEMP_SENSOR_5_MINTEMP_IND 0
  367. #define TEMP_SENSOR_5_MAXTEMP_IND TEMPTABLE_5_LEN - 1
  368. #else
  369. #define TEMP_SENSOR_5_MINTEMP_IND TEMPTABLE_5_LEN - 1
  370. #define TEMP_SENSOR_5_MAXTEMP_IND 0
  371. #endif
  372. #endif
  373. #ifdef TEMPTABLE_6
  374. #if TT_REV(6)
  375. #define TEMP_SENSOR_6_MINTEMP_IND 0
  376. #define TEMP_SENSOR_6_MAXTEMP_IND TEMPTABLE_6_LEN - 1
  377. #else
  378. #define TEMP_SENSOR_6_MINTEMP_IND TEMPTABLE_6_LEN - 1
  379. #define TEMP_SENSOR_6_MAXTEMP_IND 0
  380. #endif
  381. #endif
  382. #ifdef TEMPTABLE_7
  383. #if TT_REV(7)
  384. #define TEMP_SENSOR_7_MINTEMP_IND 0
  385. #define TEMP_SENSOR_7_MAXTEMP_IND TEMPTABLE_7_LEN - 1
  386. #else
  387. #define TEMP_SENSOR_7_MINTEMP_IND TEMPTABLE_7_LEN - 1
  388. #define TEMP_SENSOR_7_MAXTEMP_IND 0
  389. #endif
  390. #endif
  391. #ifndef TEMP_SENSOR_0_RAW_HI_TEMP
  392. #if TT_REVRAW(0)
  393. #define TEMP_SENSOR_0_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
  394. #define TEMP_SENSOR_0_RAW_LO_TEMP 0
  395. #else
  396. #define TEMP_SENSOR_0_RAW_HI_TEMP 0
  397. #define TEMP_SENSOR_0_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
  398. #endif
  399. #endif
  400. #ifndef TEMP_SENSOR_1_RAW_HI_TEMP
  401. #if TT_REVRAW(1)
  402. #define TEMP_SENSOR_1_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
  403. #define TEMP_SENSOR_1_RAW_LO_TEMP 0
  404. #else
  405. #define TEMP_SENSOR_1_RAW_HI_TEMP 0
  406. #define TEMP_SENSOR_1_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
  407. #endif
  408. #endif
  409. #ifndef TEMP_SENSOR_2_RAW_HI_TEMP
  410. #if TT_REVRAW(2)
  411. #define TEMP_SENSOR_2_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
  412. #define TEMP_SENSOR_2_RAW_LO_TEMP 0
  413. #else
  414. #define TEMP_SENSOR_2_RAW_HI_TEMP 0
  415. #define TEMP_SENSOR_2_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
  416. #endif
  417. #endif
  418. #ifndef TEMP_SENSOR_3_RAW_HI_TEMP
  419. #if TT_REVRAW(3)
  420. #define TEMP_SENSOR_3_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
  421. #define TEMP_SENSOR_3_RAW_LO_TEMP 0
  422. #else
  423. #define TEMP_SENSOR_3_RAW_HI_TEMP 0
  424. #define TEMP_SENSOR_3_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
  425. #endif
  426. #endif
  427. #ifndef TEMP_SENSOR_4_RAW_HI_TEMP
  428. #if TT_REVRAW(4)
  429. #define TEMP_SENSOR_4_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
  430. #define TEMP_SENSOR_4_RAW_LO_TEMP 0
  431. #else
  432. #define TEMP_SENSOR_4_RAW_HI_TEMP 0
  433. #define TEMP_SENSOR_4_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
  434. #endif
  435. #endif
  436. #ifndef TEMP_SENSOR_5_RAW_HI_TEMP
  437. #if TT_REVRAW(5)
  438. #define TEMP_SENSOR_5_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
  439. #define TEMP_SENSOR_5_RAW_LO_TEMP 0
  440. #else
  441. #define TEMP_SENSOR_5_RAW_HI_TEMP 0
  442. #define TEMP_SENSOR_5_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
  443. #endif
  444. #endif
  445. #ifndef TEMP_SENSOR_6_RAW_HI_TEMP
  446. #if TT_REVRAW(6)
  447. #define TEMP_SENSOR_6_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
  448. #define TEMP_SENSOR_6_RAW_LO_TEMP 0
  449. #else
  450. #define TEMP_SENSOR_6_RAW_HI_TEMP 0
  451. #define TEMP_SENSOR_6_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
  452. #endif
  453. #endif
  454. #ifndef TEMP_SENSOR_7_RAW_HI_TEMP
  455. #if TT_REVRAW(7)
  456. #define TEMP_SENSOR_7_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
  457. #define TEMP_SENSOR_7_RAW_LO_TEMP 0
  458. #else
  459. #define TEMP_SENSOR_7_RAW_HI_TEMP 0
  460. #define TEMP_SENSOR_7_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
  461. #endif
  462. #endif
  463. #ifndef TEMP_SENSOR_BED_RAW_HI_TEMP
  464. #if TT_REVRAW(BED)
  465. #define TEMP_SENSOR_BED_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
  466. #define TEMP_SENSOR_BED_RAW_LO_TEMP 0
  467. #else
  468. #define TEMP_SENSOR_BED_RAW_HI_TEMP 0
  469. #define TEMP_SENSOR_BED_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
  470. #endif
  471. #endif
  472. #ifndef TEMP_SENSOR_CHAMBER_RAW_HI_TEMP
  473. #if TT_REVRAW(CHAMBER)
  474. #define TEMP_SENSOR_CHAMBER_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
  475. #define TEMP_SENSOR_CHAMBER_RAW_LO_TEMP 0
  476. #else
  477. #define TEMP_SENSOR_CHAMBER_RAW_HI_TEMP 0
  478. #define TEMP_SENSOR_CHAMBER_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
  479. #endif
  480. #endif
  481. #ifndef TEMP_SENSOR_COOLER_RAW_HI_TEMP
  482. #if TT_REVRAW(COOLER)
  483. #define TEMP_SENSOR_COOLER_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
  484. #define TEMP_SENSOR_COOLER_RAW_LO_TEMP 0
  485. #else
  486. #define TEMP_SENSOR_COOLER_RAW_HI_TEMP 0
  487. #define TEMP_SENSOR_COOLER_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
  488. #endif
  489. #endif
  490. #ifndef TEMP_SENSOR_PROBE_RAW_HI_TEMP
  491. #if TT_REVRAW(PROBE)
  492. #define TEMP_SENSOR_PROBE_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
  493. #define TEMP_SENSOR_PROBE_RAW_LO_TEMP 0
  494. #else
  495. #define TEMP_SENSOR_PROBE_RAW_HI_TEMP 0
  496. #define TEMP_SENSOR_PROBE_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
  497. #endif
  498. #endif
  499. #ifndef TEMP_SENSOR_BOARD_RAW_HI_TEMP
  500. #if TT_REVRAW(BOARD)
  501. #define TEMP_SENSOR_BOARD_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
  502. #define TEMP_SENSOR_BOARD_RAW_LO_TEMP 0
  503. #else
  504. #define TEMP_SENSOR_BOARD_RAW_HI_TEMP 0
  505. #define TEMP_SENSOR_BOARD_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
  506. #endif
  507. #endif
  508. #ifndef TEMP_SENSOR_REDUNDANT_RAW_HI_TEMP
  509. #if TT_REVRAW(REDUNDANT)
  510. #define TEMP_SENSOR_REDUNDANT_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
  511. #define TEMP_SENSOR_REDUNDANT_RAW_LO_TEMP 0
  512. #else
  513. #define TEMP_SENSOR_REDUNDANT_RAW_HI_TEMP 0
  514. #define TEMP_SENSOR_REDUNDANT_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
  515. #endif
  516. #endif
  517. #undef __TT_REV
  518. #undef _TT_REV
  519. #undef TT_REV
  520. #undef _TT_REVRAW
  521. #undef TT_REVRAW