Commit c495ec3c authored by MagoKimbra's avatar MagoKimbra

Same fix

parent 41fd5785
......@@ -68,6 +68,7 @@
NexPicture Exit = NexPicture(4, 16, "p7");
// Progress Bar
NexProgressBar sdbar = NexProgressBar(1, 26, "j0");
// Slider
NexSlider sdlist = NexSlider(4, 1, "h0");
......@@ -468,7 +469,7 @@
color = 65519;
else if (prc >= 75 && prc < 95)
color = 64487;
else if (prc >= 95 && prc < 100)
else if (prc >= 95)
color = 63488;
hotend_list[h]->setText(buffer);
......@@ -548,6 +549,9 @@
MSD.setPic(7);
else
MSD.setPic(6);
if (IS_SD_PRINTING)
// Progress bar solid part
sdbar.setValue(card.percentDone());
#endif
next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL;
......
......@@ -2249,9 +2249,7 @@
#define ORIG_TEMP_0_PIN 6 // ANALOG NUMBERING
#define ORIG_TEMP_1_PIN 5 // 2 // ANALOG NUMBERING
#define ORIG_TEMP_2_PIN 4 // 3 // ANALOG NUMBERING
#define ORIG_TEMP_3_PIN -1 // ANALOG NUMBERING
#define TEMP_4_PIN -1 // ANALOG NUMBERING
#define ORIG_TEMP_3_PIN 3 // ANALOG NUMBERING
#if NUM_SERVOS > 0
#define SERVO0_PIN 11
......@@ -2412,6 +2410,18 @@
#define ORIG_E1_DIR_PIN 34
#define ORIG_E1_ENABLE_PIN 30
#define ORIG_HEATER_0_PIN 10
#define ORIG_HEATER_1_PIN -1
#define ORIG_HEATER_2_PIN -1
#define ORIG_HEATER_BED_PIN 8 // BED
#define ORIG_TEMP_0_PIN 9 // ANALOG NUMBERING
#define ORIG_TEMP_1_PIN -1 // ANALOG NUMBERING
#define ORIG_TEMP_2_PIN -1 // ANALOG NUMBERING
#define ORIG_TEMP_BED_PIN 10 // ANALOG NUMBERING
#define ORIG_FAN_PIN 9
#define PS_ON_PIN 12
#define SDPOWER -1
#define SDSS 53
#define LED_PIN 13
......
......@@ -174,7 +174,7 @@ static unsigned char soft_pwm[HOTENDS];
static int minttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS( HEATER_0_RAW_LO_TEMP , HEATER_1_RAW_LO_TEMP , HEATER_2_RAW_LO_TEMP, HEATER_3_RAW_LO_TEMP);
static int maxttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS( HEATER_0_RAW_HI_TEMP , HEATER_1_RAW_HI_TEMP , HEATER_2_RAW_HI_TEMP, HEATER_3_RAW_HI_TEMP);
static int minttemp[HOTENDS] = { 0 };
static int maxttemp[HOTENDS] = ARRAY_BY_HOTENDS1( 16383 );
static int maxttemp[HOTENDS] = ARRAY_BY_HOTENDS1(16383);
#if ENABLED(BED_MINTEMP)
static int bed_minttemp_raw = HEATER_BED_RAW_LO_TEMP;
#endif
......@@ -812,24 +812,7 @@ static float analog2temp(int raw, uint8_t e) {
return celsius;
}
switch(e) {
#if TEMP_SENSOR_BED
case -1: return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET;
#endif
#if HEATER_0_USES_AD595
case 0: return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET;
#endif
#if HEATER_1_USES_AD595
case 1: return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET;
#endif
#if HEATER_2_USES_AD595
case 2: return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET;
#endif
#if HEATER_3_USES_AD595
case 3: return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET;
#endif
}
return (raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR);
return ((raw * ((5.0 * 100.0) / 1023.0) / OVERSAMPLENR) * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET;
}
// Derived from RepRap FiveD extruder::getTemperature()
......@@ -854,7 +837,7 @@ static float analog2tempBed(int raw) {
return celsius;
#elif ENABLED(BED_USES_AD595)
return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET;
return ((raw * ((5.0 * 100.0) / 1023.0) / OVERSAMPLENR) * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET;
#else
return 0;
#endif
......@@ -932,13 +915,13 @@ static void updateTemperaturesFromRawValues() {
#if HAS(POWER_CONSUMPTION_SENSOR)
// Convert raw Power Consumption to watt
float raw_analog2voltage() {
return (5.0 * current_raw_powconsumption) / (1023 * OVERSAMPLENR);
return (5.0 * current_raw_powconsumption) / (1023.0 * OVERSAMPLENR);
}
float analog2voltage() {
float power_zero_raw = (POWER_ZERO * 1023 * OVERSAMPLENR) / 5.0;
float power_zero_raw = (POWER_ZERO * 1023.0 * OVERSAMPLENR) / 5.0;
float rel_raw_power = (current_raw_powconsumption < power_zero_raw) ? (2 * power_zero_raw - current_raw_powconsumption) : (current_raw_powconsumption);
return ((5.0 * rel_raw_power) / (1023 * OVERSAMPLENR)) - POWER_ZERO;
return ((5.0 * rel_raw_power) / (1023.0 * OVERSAMPLENR)) - POWER_ZERO;
}
float analog2current() {
float temp = analog2voltage() / POWER_SENSITIVITY;
......@@ -954,7 +937,7 @@ static void updateTemperaturesFromRawValues() {
if(temp1 <= 0) return 0.0;
float temp2 = (current) * POWER_VOLTAGE;
if(temp2 <= 0) return 0.0;
return ((temp2/temp1)-1)*100;
return ((temp2/temp1) - 1) * 100;
}
float analog2efficiency(float watt) {
return (analog2current() * POWER_VOLTAGE * 100) / watt;
......
......@@ -73,9 +73,9 @@ const short temptable_1[][2] PROGMEM = {
const short temptable_2[][2] PROGMEM = {
//200k ATC Semitec 204GT-2
//Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf
// Calculated using 4.7kohm pullup,voltage divider math,and manufacturer provided temp/resistance
// Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance
{1 * OVERSAMPLENR, 848},
{30 * OVERSAMPLENR, 300},//top rating 300C
{30 * OVERSAMPLENR, 300}, // top rating 300C
{34 * OVERSAMPLENR, 290},
{39 * OVERSAMPLENR, 280},
{46 * OVERSAMPLENR, 270},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment