Commit c495ec3c authored by MagoKimbra's avatar MagoKimbra

Same fix

parent 41fd5785
...@@ -26,78 +26,79 @@ ...@@ -26,78 +26,79 @@
static millis_t next_lcd_update_ms; static millis_t next_lcd_update_ms;
// Page // Page
NexPage Pstart = NexPage(0, 0, "start"); NexPage Pstart = NexPage(0, 0, "start");
NexPage Pinfo = NexPage(1, 0, "info"); NexPage Pinfo = NexPage(1, 0, "info");
NexPage Ptemp = NexPage(2, 0, "temp"); NexPage Ptemp = NexPage(2, 0, "temp");
NexPage Pmenu = NexPage(3, 0, "menu"); NexPage Pmenu = NexPage(3, 0, "menu");
NexPage Psdcard = NexPage(4, 0, "sdcard"); NexPage Psdcard = NexPage(4, 0, "sdcard");
NexPage Psetup = NexPage(5, 0, "setup"); NexPage Psetup = NexPage(5, 0, "setup");
// Text // Text
NexText Hotend0 = NexText(1, 1, "t0"); NexText Hotend0 = NexText(1, 1, "t0");
NexText Hotend1 = NexText(1, 4, "t1"); NexText Hotend1 = NexText(1, 4, "t1");
NexText Hotend2 = NexText(1, 5, "t2"); NexText Hotend2 = NexText(1, 5, "t2");
NexText Hotend21 = NexText(1, 6, "h2"); NexText Hotend21 = NexText(1, 6, "h2");
NexText LedStatus = NexText(1, 7, "t4"); NexText LedStatus = NexText(1, 7, "t4");
NexText LedCoord = NexText(1, 8, "t5"); NexText LedCoord = NexText(1, 8, "t5");
NexText set0 = NexText(2, 2, "set0"); NexText set0 = NexText(2, 2, "set0");
NexText set1 = NexText(2, 15, "set1"); NexText set1 = NexText(2, 15, "set1");
NexText sdrow0 = NexText(4, 3, "t0"); NexText sdrow0 = NexText(4, 3, "t0");
NexText sdrow1 = NexText(4, 4, "t1"); NexText sdrow1 = NexText(4, 4, "t1");
NexText sdrow2 = NexText(4, 5, "t2"); NexText sdrow2 = NexText(4, 5, "t2");
NexText sdrow3 = NexText(4, 6, "t3"); NexText sdrow3 = NexText(4, 6, "t3");
NexText sdrow4 = NexText(4, 7, "t4"); NexText sdrow4 = NexText(4, 7, "t4");
NexText sdrow5 = NexText(4, 8, "t5"); NexText sdrow5 = NexText(4, 8, "t5");
NexText sdfolder = NexText(4, 23, "sdfolder"); NexText sdfolder = NexText(4, 23, "sdfolder");
// Picture // Picture
NexPicture Menu = NexPicture(1, 10, "p0"); NexPicture Menu = NexPicture(1, 10, "p0");
NexPicture MSD = NexPicture(1, 11, "p1"); NexPicture MSD = NexPicture(1, 11, "p1");
NexPicture MSetup = NexPicture(1, 12, "p2"); NexPicture MSetup = NexPicture(1, 12, "p2");
NexPicture Hend0 = NexPicture(1, 13, "p3"); NexPicture Hend0 = NexPicture(1, 13, "p3");
NexPicture Hend1 = NexPicture(1, 14, "p4"); NexPicture Hend1 = NexPicture(1, 14, "p4");
NexPicture Hend2 = NexPicture(1, 15, "p5"); NexPicture Hend2 = NexPicture(1, 15, "p5");
NexPicture Fanpic = NexPicture(1, 19, "p6"); NexPicture Fanpic = NexPicture(1, 19, "p6");
NexPicture Folder0 = NexPicture(4, 9, "p0"); NexPicture Folder0 = NexPicture(4, 9, "p0");
NexPicture Folder1 = NexPicture(4, 10, "p1"); NexPicture Folder1 = NexPicture(4, 10, "p1");
NexPicture Folder2 = NexPicture(4, 11, "p2"); NexPicture Folder2 = NexPicture(4, 11, "p2");
NexPicture Folder3 = NexPicture(4, 12, "p3"); NexPicture Folder3 = NexPicture(4, 12, "p3");
NexPicture Folder4 = NexPicture(4, 13, "p4"); NexPicture Folder4 = NexPicture(4, 13, "p4");
NexPicture Folder5 = NexPicture(4, 14, "p5"); NexPicture Folder5 = NexPicture(4, 14, "p5");
NexPicture Folderup = NexPicture(4, 15, "p6"); NexPicture Folderup = NexPicture(4, 15, "p6");
NexPicture Exit = NexPicture(4, 16, "p7"); NexPicture Exit = NexPicture(4, 16, "p7");
// Progress Bar // Progress Bar
NexProgressBar sdbar = NexProgressBar(1, 26, "j0");
// Slider // Slider
NexSlider sdlist = NexSlider(4, 1, "h0"); NexSlider sdlist = NexSlider(4, 1, "h0");
// Wafeform // Wafeform
NexWaveform Graph0 = NexWaveform(1, 9, "s0"); NexWaveform Graph0 = NexWaveform(1, 9, "s0");
NexWaveform Graph1 = NexWaveform(1, 24, "s1"); NexWaveform Graph1 = NexWaveform(1, 24, "s1");
NexWaveform Graph2 = NexWaveform(1, 25, "s2"); NexWaveform Graph2 = NexWaveform(1, 25, "s2");
// Touch area // Touch area
NexHotspot hot0 = NexHotspot(1, 14, "hot0"); NexHotspot hot0 = NexHotspot(1, 14, "hot0");
NexHotspot hot1 = NexHotspot(1, 16, "hot1"); NexHotspot hot1 = NexHotspot(1, 16, "hot1");
NexHotspot hot2 = NexHotspot(1, 18, "hot2"); NexHotspot hot2 = NexHotspot(1, 18, "hot2");
NexHotspot m11 = NexHotspot(2, 14, "m11"); NexHotspot m11 = NexHotspot(2, 14, "m11");
NexHotspot tup = NexHotspot(2, 16, "tup"); NexHotspot tup = NexHotspot(2, 16, "tup");
NexHotspot tdown = NexHotspot(2, 17, "tdown"); NexHotspot tdown = NexHotspot(2, 17, "tdown");
// Timer // Timer
NexTimer startimer = NexTimer(0, 1, "tm0"); NexTimer startimer = NexTimer(0, 1, "tm0");
NexTimer fantimer = NexTimer(1, 23, "tm0"); NexTimer fantimer = NexTimer(1, 23, "tm0");
// Variable // Variable
NexVar Hotend = NexVar(1, 20, "he"); NexVar Hotend = NexVar(1, 20, "he");
NexVar Bed = NexVar(1, 21, "bed"); NexVar Bed = NexVar(1, 21, "bed");
NexVar filename0 = NexVar(4, 19, "va0"); NexVar filename0 = NexVar(4, 19, "va0");
NexVar filename1 = NexVar(4, 20, "va1"); NexVar filename1 = NexVar(4, 20, "va1");
NexVar filename2 = NexVar(4, 21, "va2"); NexVar filename2 = NexVar(4, 21, "va2");
NexVar filename3 = NexVar(4, 22, "va3"); NexVar filename3 = NexVar(4, 22, "va3");
NexVar filename4 = NexVar(4, 23, "va4"); NexVar filename4 = NexVar(4, 23, "va4");
NexVar filename5 = NexVar(4, 24, "va5"); NexVar filename5 = NexVar(4, 24, "va5");
NexTouch *nex_listen_list[] = NexTouch *nex_listen_list[] =
{ {
...@@ -468,7 +469,7 @@ ...@@ -468,7 +469,7 @@
color = 65519; color = 65519;
else if (prc >= 75 && prc < 95) else if (prc >= 75 && prc < 95)
color = 64487; color = 64487;
else if (prc >= 95 && prc < 100) else if (prc >= 95)
color = 63488; color = 63488;
hotend_list[h]->setText(buffer); hotend_list[h]->setText(buffer);
...@@ -548,6 +549,9 @@ ...@@ -548,6 +549,9 @@
MSD.setPic(7); MSD.setPic(7);
else else
MSD.setPic(6); MSD.setPic(6);
if (IS_SD_PRINTING)
// Progress bar solid part
sdbar.setValue(card.percentDone());
#endif #endif
next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL; next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL;
......
...@@ -2249,9 +2249,7 @@ ...@@ -2249,9 +2249,7 @@
#define ORIG_TEMP_0_PIN 6 // ANALOG NUMBERING #define ORIG_TEMP_0_PIN 6 // ANALOG NUMBERING
#define ORIG_TEMP_1_PIN 5 // 2 // ANALOG NUMBERING #define ORIG_TEMP_1_PIN 5 // 2 // ANALOG NUMBERING
#define ORIG_TEMP_2_PIN 4 // 3 // ANALOG NUMBERING #define ORIG_TEMP_2_PIN 4 // 3 // ANALOG NUMBERING
#define ORIG_TEMP_3_PIN 3 // ANALOG NUMBERING
#define ORIG_TEMP_3_PIN -1 // ANALOG NUMBERING
#define TEMP_4_PIN -1 // ANALOG NUMBERING
#if NUM_SERVOS > 0 #if NUM_SERVOS > 0
#define SERVO0_PIN 11 #define SERVO0_PIN 11
...@@ -2381,20 +2379,20 @@ ...@@ -2381,20 +2379,20 @@
#define ORIG_X_STEP_PIN 54 #define ORIG_X_STEP_PIN 54
#define ORIG_X_DIR_PIN 55 #define ORIG_X_DIR_PIN 55
#define ORIG_X_ENABLE_PIN 38 #define ORIG_X_ENABLE_PIN 38
#define ORIG_X_MIN_PIN 3 #define ORIG_X_MIN_PIN 3
#define ORIG_X_MAX_PIN 2 #define ORIG_X_MAX_PIN 2
#define ORIG_Y_STEP_PIN 60 #define ORIG_Y_STEP_PIN 60
#define ORIG_Y_DIR_PIN 61 #define ORIG_Y_DIR_PIN 61
#define ORIG_Y_ENABLE_PIN 56 #define ORIG_Y_ENABLE_PIN 56
#define ORIG_Y_MIN_PIN 14 #define ORIG_Y_MIN_PIN 14
#define ORIG_Y_MAX_PIN 15 #define ORIG_Y_MAX_PIN 15
#define ORIG_Z_STEP_PIN 46 #define ORIG_Z_STEP_PIN 46
#define ORIG_Z_DIR_PIN 48 #define ORIG_Z_DIR_PIN 48
#define ORIG_Z_ENABLE_PIN 62 #define ORIG_Z_ENABLE_PIN 62
#define ORIG_Z_MIN_PIN 18 #define ORIG_Z_MIN_PIN 18
#define ORIG_Z_MAX_PIN 19 #define ORIG_Z_MAX_PIN 19
#define Y2_STEP_PIN 36 #define Y2_STEP_PIN 36
#define Y2_DIR_PIN 34 #define Y2_DIR_PIN 34
...@@ -2412,6 +2410,18 @@ ...@@ -2412,6 +2410,18 @@
#define ORIG_E1_DIR_PIN 34 #define ORIG_E1_DIR_PIN 34
#define ORIG_E1_ENABLE_PIN 30 #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 SDPOWER -1
#define SDSS 53 #define SDSS 53
#define LED_PIN 13 #define LED_PIN 13
......
...@@ -174,7 +174,7 @@ static unsigned char soft_pwm[HOTENDS]; ...@@ -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 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 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 minttemp[HOTENDS] = { 0 };
static int maxttemp[HOTENDS] = ARRAY_BY_HOTENDS1( 16383 ); static int maxttemp[HOTENDS] = ARRAY_BY_HOTENDS1(16383);
#if ENABLED(BED_MINTEMP) #if ENABLED(BED_MINTEMP)
static int bed_minttemp_raw = HEATER_BED_RAW_LO_TEMP; static int bed_minttemp_raw = HEATER_BED_RAW_LO_TEMP;
#endif #endif
...@@ -812,24 +812,7 @@ static float analog2temp(int raw, uint8_t e) { ...@@ -812,24 +812,7 @@ static float analog2temp(int raw, uint8_t e) {
return celsius; return celsius;
} }
switch(e) { return ((raw * ((5.0 * 100.0) / 1023.0) / OVERSAMPLENR) * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET;
#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);
} }
// Derived from RepRap FiveD extruder::getTemperature() // Derived from RepRap FiveD extruder::getTemperature()
...@@ -854,7 +837,7 @@ static float analog2tempBed(int raw) { ...@@ -854,7 +837,7 @@ static float analog2tempBed(int raw) {
return celsius; return celsius;
#elif ENABLED(BED_USES_AD595) #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 #else
return 0; return 0;
#endif #endif
...@@ -932,13 +915,13 @@ static void updateTemperaturesFromRawValues() { ...@@ -932,13 +915,13 @@ static void updateTemperaturesFromRawValues() {
#if HAS(POWER_CONSUMPTION_SENSOR) #if HAS(POWER_CONSUMPTION_SENSOR)
// Convert raw Power Consumption to watt // Convert raw Power Consumption to watt
float raw_analog2voltage() { float raw_analog2voltage() {
return (5.0 * current_raw_powconsumption) / (1023 * OVERSAMPLENR); return (5.0 * current_raw_powconsumption) / (1023.0 * OVERSAMPLENR);
} }
float analog2voltage() { 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); 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 analog2current() {
float temp = analog2voltage() / POWER_SENSITIVITY; float temp = analog2voltage() / POWER_SENSITIVITY;
...@@ -954,7 +937,7 @@ static void updateTemperaturesFromRawValues() { ...@@ -954,7 +937,7 @@ static void updateTemperaturesFromRawValues() {
if(temp1 <= 0) return 0.0; if(temp1 <= 0) return 0.0;
float temp2 = (current) * POWER_VOLTAGE; float temp2 = (current) * POWER_VOLTAGE;
if(temp2 <= 0) return 0.0; if(temp2 <= 0) return 0.0;
return ((temp2/temp1)-1)*100; return ((temp2/temp1) - 1) * 100;
} }
float analog2efficiency(float watt) { float analog2efficiency(float watt) {
return (analog2current() * POWER_VOLTAGE * 100) / watt; return (analog2current() * POWER_VOLTAGE * 100) / watt;
......
...@@ -73,9 +73,9 @@ const short temptable_1[][2] PROGMEM = { ...@@ -73,9 +73,9 @@ const short temptable_1[][2] PROGMEM = {
const short temptable_2[][2] PROGMEM = { const short temptable_2[][2] PROGMEM = {
//200k ATC Semitec 204GT-2 //200k ATC Semitec 204GT-2
//Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf //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}, {1 * OVERSAMPLENR, 848},
{30 * OVERSAMPLENR, 300},//top rating 300C {30 * OVERSAMPLENR, 300}, // top rating 300C
{34 * OVERSAMPLENR, 290}, {34 * OVERSAMPLENR, 290},
{39 * OVERSAMPLENR, 280}, {39 * OVERSAMPLENR, 280},
{46 * OVERSAMPLENR, 270}, {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