Add TEMP_SENSOR_BOARD (#22279, #22342, #22343, #22344, #22350)

This commit is contained in:
Scott Lahteine
2021-08-18 20:12:41 -05:00
parent 9ddb4de70a
commit 416234f43a
19 changed files with 829 additions and 519 deletions

View File

@@ -51,6 +51,7 @@
|| TEMP_SENSOR_IS(n, CHAMBER) \
|| TEMP_SENSOR_IS(n, COOLER) \
|| TEMP_SENSOR_IS(n, PROBE) \
|| TEMP_SENSOR_IS(n, BOARD) \
|| TEMP_SENSOR_IS(n, REDUNDANT) )
typedef struct { int16_t value; celsius_t celsius; } temp_entry_t;
@@ -200,6 +201,9 @@ typedef struct { int16_t value; celsius_t celsius; } temp_entry_t;
#if ANY_THERMISTOR_IS(1047) // Pt1000 with 4k7 pullup
#include "thermistor_1047.h"
#endif
#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
#include "thermistor_2000.h"
#endif
#if ANY_THERMISTOR_IS(998) // User-defined table 1
#include "thermistor_998.h"
#endif
@@ -305,6 +309,13 @@ typedef struct { int16_t value; celsius_t celsius; } temp_entry_t;
#define TEMPTABLE_PROBE_LEN 0
#endif
#if TEMP_SENSOR_BOARD > 0
#define TEMPTABLE_BOARD TT_NAME(TEMP_SENSOR_BOARD)
#define TEMPTABLE_BOARD_LEN COUNT(TEMPTABLE_BOARD)
#else
#define TEMPTABLE_BOARD_LEN 0
#endif
#if TEMP_SENSOR_REDUNDANT > 0
#define TEMPTABLE_REDUNDANT TT_NAME(TEMP_SENSOR_REDUNDANT)
#define TEMPTABLE_REDUNDANT_LEN COUNT(TEMPTABLE_REDUNDANT)
@@ -319,6 +330,7 @@ static_assert(255 > TEMPTABLE_0_LEN || 255 > TEMPTABLE_1_LEN || 255 > TEMPTABLE_
|| 255 > TEMPTABLE_CHAMBER_LEN
|| 255 > TEMPTABLE_COOLER_LEN
|| 255 > TEMPTABLE_PROBE_LEN
|| 255 > TEMPTABLE_BOARD_LEN
|| 255 > TEMPTABLE_REDUNDANT_LEN
, "Temperature conversion tables over 255 entries need special consideration."
);
@@ -513,6 +525,15 @@ static_assert(255 > TEMPTABLE_0_LEN || 255 > TEMPTABLE_1_LEN || 255 > TEMPTABLE_
#define TEMP_SENSOR_PROBE_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
#endif
#endif
#ifndef TEMP_SENSOR_BOARD_RAW_HI_TEMP
#if TT_REVRAW(BOARD)
#define TEMP_SENSOR_BOARD_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
#define TEMP_SENSOR_BOARD_RAW_LO_TEMP 0
#else
#define TEMP_SENSOR_BOARD_RAW_HI_TEMP 0
#define TEMP_SENSOR_BOARD_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
#endif
#endif
#ifndef TEMP_SENSOR_REDUNDANT_RAW_HI_TEMP
#if TT_REVRAW(REDUNDANT)
#define TEMP_SENSOR_REDUNDANT_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE