|
@@ -117,7 +117,7 @@ static int maxttemp[EXTRUDERS] = ARRAY_BY_EXTRUDERS( 16383, 16383, 16383 );
|
117
|
117
|
static int bed_maxttemp_raw = HEATER_BED_RAW_HI_TEMP;
|
118
|
118
|
#endif
|
119
|
119
|
static void *heater_ttbl_map[EXTRUDERS] = ARRAY_BY_EXTRUDERS( (void *)HEATER_0_TEMPTABLE, (void *)HEATER_1_TEMPTABLE, (void *)HEATER_2_TEMPTABLE );
|
120
|
|
-static int heater_ttbllen_map[EXTRUDERS] = ARRAY_BY_EXTRUDERS( HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN );
|
|
120
|
+static uint8_t heater_ttbllen_map[EXTRUDERS] = ARRAY_BY_EXTRUDERS( HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN );
|
121
|
121
|
|
122
|
122
|
static float analog2temp(int raw, uint8_t e);
|
123
|
123
|
static float analog2tempBed(int raw);
|
|
@@ -493,7 +493,7 @@ static float analog2temp(int raw, uint8_t e) {
|
493
|
493
|
if(heater_ttbl_map[e] != NULL)
|
494
|
494
|
{
|
495
|
495
|
float celsius = 0;
|
496
|
|
- byte i;
|
|
496
|
+ uint8_t i;
|
497
|
497
|
short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]);
|
498
|
498
|
|
499
|
499
|
for (i=1; i<heater_ttbllen_map[e]; i++)
|
|
@@ -523,20 +523,20 @@ static float analog2tempBed(int raw) {
|
523
|
523
|
float celsius = 0;
|
524
|
524
|
byte i;
|
525
|
525
|
|
526
|
|
- for (i=1; i<bedtemptable_len; i++)
|
|
526
|
+ for (i=1; i<BEDTEMPTABLE_LEN; i++)
|
527
|
527
|
{
|
528
|
|
- if (PGM_RD_W(bedtemptable[i][0]) > raw)
|
|
528
|
+ if (PGM_RD_W(BEDTEMPTABLE[i][0]) > raw)
|
529
|
529
|
{
|
530
|
|
- celsius = PGM_RD_W(bedtemptable[i-1][1]) +
|
531
|
|
- (raw - PGM_RD_W(bedtemptable[i-1][0])) *
|
532
|
|
- (float)(PGM_RD_W(bedtemptable[i][1]) - PGM_RD_W(bedtemptable[i-1][1])) /
|
533
|
|
- (float)(PGM_RD_W(bedtemptable[i][0]) - PGM_RD_W(bedtemptable[i-1][0]));
|
|
530
|
+ celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) +
|
|
531
|
+ (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) *
|
|
532
|
+ (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) /
|
|
533
|
+ (float)(PGM_RD_W(BEDTEMPTABLE[i][0]) - PGM_RD_W(BEDTEMPTABLE[i-1][0]));
|
534
|
534
|
break;
|
535
|
535
|
}
|
536
|
536
|
}
|
537
|
537
|
|
538
|
538
|
// Overflow: Set to last value in the table
|
539
|
|
- if (i == bedtemptable_len) celsius = PGM_RD_W(bedtemptable[i-1][1]);
|
|
539
|
+ if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]);
|
540
|
540
|
|
541
|
541
|
return celsius;
|
542
|
542
|
#elif defined BED_USES_AD595
|