Skip to content

Commit

Permalink
beta 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Silverquark committed May 31, 2017
1 parent 4656f92 commit c01853e
Show file tree
Hide file tree
Showing 115 changed files with 228 additions and 10,720 deletions.
Binary file removed LCDFirmware/27 Progress bar/1.bmp
Binary file not shown.
Binary file removed LCDFirmware/27 Progress bar/10.bmp
Binary file not shown.
Binary file removed LCDFirmware/27 Progress bar/11.bmp
Binary file not shown.
Binary file removed LCDFirmware/27 Progress bar/12.bmp
Binary file not shown.
Binary file removed LCDFirmware/27 Progress bar/13.bmp
Binary file not shown.
Binary file removed LCDFirmware/27 Progress bar/14.bmp
Binary file not shown.
Binary file removed LCDFirmware/27 Progress bar/15.bmp
Binary file not shown.
Binary file removed LCDFirmware/27 Progress bar/16.bmp
Binary file not shown.
Binary file removed LCDFirmware/27 Progress bar/17.bmp
Binary file not shown.
Binary file removed LCDFirmware/27 Progress bar/18.bmp
Binary file not shown.
Binary file removed LCDFirmware/27 Progress bar/19.bmp
Binary file not shown.
Binary file removed LCDFirmware/27 Progress bar/2.bmp
Binary file not shown.
Binary file removed LCDFirmware/27 Progress bar/20.bmp
Binary file not shown.
Binary file removed LCDFirmware/27 Progress bar/21.bmp
Binary file not shown.
Binary file removed LCDFirmware/27 Progress bar/3.bmp
Binary file not shown.
Binary file removed LCDFirmware/27 Progress bar/4.bmp
Binary file not shown.
Binary file removed LCDFirmware/27 Progress bar/5.bmp
Binary file not shown.
Binary file removed LCDFirmware/27 Progress bar/6.bmp
Binary file not shown.
Binary file removed LCDFirmware/27 Progress bar/7.bmp
Binary file not shown.
Binary file removed LCDFirmware/27 Progress bar/8.bmp
Binary file not shown.
Binary file removed LCDFirmware/27 Progress bar/9.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/001_boot_animation.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/002_boot_animation.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/003_boot_animation.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/004_boot_animation.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/005_boot_animation.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/006_boot_animation.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/007_boot_animation.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/008_boot_animation.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/009_boot_animation.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/010_boot_animation.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/011_main_menu.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/012_main_menu_pressed.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/031 sd card.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/032 sd card press.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/033 print.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/034 print press.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/035 print config.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/036 print config press.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/037 tool menu.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/038 tool menu press.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/039 preheat.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/040 preheat press.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/041 move.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/042 move press.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/043 system menu.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/044 system menu press.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/051 unload filament.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/052 unload filament press.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/053 load filament.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/054 load filament press.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/055 level 1.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/056 level 2.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/057 level 2 press.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/059_statistics.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/060_statistics_pressed.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/061_auto_pid.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/062_auto_pid_pressed.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/063_temperature_graph.bmp
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/064_temperature_graph_press.bmp
Binary file not shown.
Binary file added LCDFirmware/DWIN_SET/065_auto_pid_graph.bmp
Binary file not shown.
Binary file added LCDFirmware/DWIN_SET/066_pid_finished.bmp
Binary file not shown.
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/13Touch_Control_Config.bin
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/14Variable_Config.bin
Binary file not shown.
Binary file modified LCDFirmware/DWIN_SET/22_Config.bin
Binary file not shown.
Binary file removed LCDFirmware/DWIN_SET/27 Progress bar.ICO
Binary file not shown.
2 changes: 1 addition & 1 deletion LCDFirmware/DWIN_SET/CONFIG.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
R1=07 ;Band Rate,07=250000
R1=07 ;Band Rate,07=115200
R2=28 ;Sys_CFG
R3=5A ;
R6=40 ;
Expand Down
3 changes: 3 additions & 0 deletions LCDFirmware/DWprj.hmi
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ SPADDRESS=5000
62=062_auto_pid_pressed.bmp
63=063_temperature_graph.bmp
64=064_temperature_graph_press.bmp
65=065_auto_pid_graph.bmp
66=066_pid_finished.bmp
67=067_pid_finished_pressed.bmp
Binary file modified LCDFirmware/TFT/000_boot_animation.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/001_boot_animation.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/010_boot_animation.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/011_main_menu.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/031 sd card.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/032 sd card press.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/033 print.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/035 print config.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/037 tool menu.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/039 preheat.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/041 move.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/042 move press.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/043 system menu.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/044 system menu press.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/045 pid.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/047 motor.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/049 filament.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/051 unload filament.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/053 load filament.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/054 load filament press.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/056 level 2.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/057 level 2 press.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/058 lcd update mode.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/059_statistics.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/060_statistics_pressed.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/061_auto_pid.bmp.tft
Binary file not shown.
Binary file modified LCDFirmware/TFT/063_temperature_graph.bmp.tft
Binary file not shown.
Binary file added LCDFirmware/TFT/065_auto_pid_graph.bmp.tft
Binary file not shown.
Binary file added LCDFirmware/TFT/066_pid_finished.bmp.tft
Binary file not shown.
Binary file added LCDFirmware/TFT/067_pid_finished_pressed.bmp.tft
Binary file not shown.
Binary file modified Marlin/.vs/Marlin/v14/.suo
Binary file not shown.
7 changes: 7 additions & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,13 @@
#define DEFAULT_RETRACT_ACCELERATION 800 // E acceleration for retracts
#define DEFAULT_TRAVEL_ACCELERATION 800 // X, Y, Z acceleration for travel (non printing) moves

#define DEFAULT_PREHEAT_PRESET1_HOTEND 180 // Preheat Presets
#define DEFAULT_PREHEAT_PRESET1_BED 50
#define DEFAULT_PREHEAT_PRESET2_HOTEND 220
#define DEFAULT_PREHEAT_PRESET2_BED 60
#define DEFAULT_PREHEAT_PRESET3_HOTEND 200
#define DEFAULT_PREHEAT_PRESET3_BED 60

/**
* Default Jerk (mm/s)
* Override with M205 X Y Z E
Expand Down
2 changes: 2 additions & 0 deletions Marlin/Marlin.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ extern bool Running;
inline bool IsRunning() { return Running; }
inline bool IsStopped() { return !Running; }

uint8_t get_command_queue_count();

bool enqueue_and_echo_command(const char* cmd, bool say_ok=false); // Add a single command to the end of the buffer. Return false on failure.
void enqueue_and_echo_commands_P(const char * const cmd); // Set one or more commands to be prioritized over the next Serial/SD command.
void clear_command_queue();
Expand Down
4,902 changes: 0 additions & 4,902 deletions Marlin/Marlin.ino.mega.hex

This file was deleted.

5,370 changes: 0 additions & 5,370 deletions Marlin/Marlin.ino.with_bootloader.mega.hex

This file was deleted.

5 changes: 1 addition & 4 deletions Marlin/Marlin.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\..\..\..\Program Files (x86)\Arduino\libraries\LiquidCrystal\src;$(ProjectDir)..\..\..\..\..\..\..\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src;$(ProjectDir)..\..\..\..\..\..\..\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src\utility;$(ProjectDir)..\..\..\..\..\..\..\Program Files (x86)\Arduino\libraries;$(ProjectDir)..\..\..\..\..\..\..\Program Files (x86)\Arduino\hardware\arduino\avr\libraries;$(ProjectDir)..\..\..\..\..\Documents\Arduino\libraries;$(ProjectDir)..\..\..\..\..\..\..\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino;$(ProjectDir)..\..\..\..\..\..\..\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega;$(ProjectDir)..\Marlin;$(ProjectDir)..\..\..\..\..\..\..\Program Files (x86)\Arduino\hardware\tools\avr\avr\include\;$(ProjectDir)..\..\..\..\..\..\..\Program Files (x86)\Arduino\hardware\tools\avr\avr\include\avr\;$(ProjectDir)..\..\..\..\..\..\..\Program Files (x86)\Arduino\hardware\tools\avr\lib\gcc\avr\4.8.1\include;$(ProjectDir)..\..\..\..\..\..\..\Program Files (x86)\Arduino\hardware\tools\avr\lib\gcc\avr\4.9.2\include;$(ProjectDir)..\..\..\..\..\..\..\Program Files (x86)\Arduino\hardware\tools\avr\lib\gcc\avr\4.9.3\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\..\..\Program Files (x86)\Arduino\libraries\LiquidCrystal\src;$(ProjectDir)..\..\..\..\..\..\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src;$(ProjectDir)..\..\..\..\..\..\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src\utility;$(ProjectDir)..\..\..\..\..\..\Program Files (x86)\Arduino\libraries;$(ProjectDir)..\..\..\..\..\..\Program Files (x86)\Arduino\hardware\arduino\avr\libraries;$(ProjectDir)..\..\..\..\Documents\Arduino\libraries;$(ProjectDir)..\..\..\..\..\..\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino;$(ProjectDir)..\..\..\..\..\..\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega;$(ProjectDir)..\Marlin;$(ProjectDir)..\..\..\..\..\..\Program Files (x86)\Arduino\hardware\tools\avr\avr\include\;$(ProjectDir)..\..\..\..\..\..\Program Files (x86)\Arduino\hardware\tools\avr\avr\include\avr\;$(ProjectDir)..\..\..\..\..\..\Program Files (x86)\Arduino\hardware\tools\avr\lib\gcc\avr\4.8.1\include;$(ProjectDir)..\..\..\..\..\..\Program Files (x86)\Arduino\hardware\tools\avr\lib\gcc\avr\4.9.2\include;$(ProjectDir)..\..\..\..\..\..\Program Files (x86)\Arduino\hardware\tools\avr\lib\gcc\avr\4.9.3\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ForcedIncludeFiles>$(ProjectDir)__vm\.Marlin.vsarduino.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<PreprocessorDefinitions>__AVR_ATmega2560__;_VMDEBUG=1;F_CPU=16000000L;ARDUINO=10801;ARDUINO_AVR_MEGA2560;ARDUINO_ARCH_AVR;__cplusplus=201103L;_VMICRO_INTELLISENSE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand Down Expand Up @@ -353,9 +353,6 @@
<ClInclude Include="pins_5DPRINT.h">
<FileType>CppCode</FileType>
</ClInclude>
<ClInclude Include="pins_A4JP.h">
<FileType>CppCode</FileType>
</ClInclude>
<ClInclude Include="pins_AZTEEG_X1.h">
<FileType>CppCode</FileType>
</ClInclude>
Expand Down
3 changes: 0 additions & 3 deletions Marlin/Marlin.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,6 @@
<ClInclude Include="pins_5DPRINT.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="pins_A4JP.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="pins_AZTEEG_X1.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand Down
6 changes: 6 additions & 0 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,12 @@ extern "C" {
extern void digipot_i2c_init();
#endif


uint8_t get_command_queue_count() {
return commands_in_queue;
}


/**
* Inject the next "immediate" command, when possible, onto the front of the queue.
* Return true if any immediate commands remain to inject.
Expand Down
187 changes: 152 additions & 35 deletions Marlin/bi3_plus_lcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ millis_t nextOpTime, nextLcdUpdate = 0;
uint8_t opMode = OPMODE_NONE;
uint8_t eventCnt = 0;
uint8_t tempGraphUpdate = 0;
uint8_t lastPage = -1;

//init OK
void lcdSetup() {
Expand Down Expand Up @@ -79,7 +80,14 @@ void executeLoopedOperation(millis_t ms) {
}
}
else if (opMode == OPMODE_AUTO_PID) {
//TODO
if (get_command_queue_count == 0) {
lcdShowPage(11);
opMode = OPMODE_NONE;
}
else {
nextOpTime = ms + 200;
Serial.println(get_command_queue_count());
}
}
}
}
Expand Down Expand Up @@ -120,19 +128,7 @@ void lcdStatusUpdate(millis_t ms) {
if (tempGraphUpdate) {
if (tempGraphUpdate == 2) {
tempGraphUpdate = 1;

lcdBuff[0] = 0x5A;
lcdBuff[1] = 0xA5;
lcdBuff[2] = 0x06; //data length
lcdBuff[3] = 0x84; //update curve
lcdBuff[4] = 0x03; //channels 0,1
tmp = thermalManager.degHotend(0);
lcdBuff[5] = highByte(tmp);
lcdBuff[6] = lowByte(tmp);
lcdBuff[7] = 0x00;//0x03 bed temp
lcdBuff[8] = thermalManager.degBed();

Serial2.write(lcdBuff, 9);
updateGraphData();
}
else
tempGraphUpdate = 2;
Expand All @@ -156,6 +152,27 @@ void lcdShowPage(uint8_t pageNumber) {
Serial2.write(lcdBuff, 7);
}

//show page OK
uint8_t lcdgetCurrentPage() {
lcdBuff[0] = 0x5A;//frame header
lcdBuff[1] = 0xA5;

lcdBuff[2] = 0x03;//data length

lcdBuff[3] = 0x81;//command - write read to register
lcdBuff[4] = 0x03;//register 0x03

lcdBuff[5] = 0x02;//2bytes

Serial2.write(lcdBuff, 6);

uint8_t bytesRead = Serial2.readBytes(lcdBuff, 8);
if ((bytesRead == 8) && (lcdBuff[0] == 0x5A) && (lcdBuff[1] == 0xA5)) {
return (uint8_t)lcdBuff[7];
}

}

//receive data from lcd OK
void readLcdSerial() {
if (Serial2.available() > 0) {
Expand Down Expand Up @@ -247,6 +264,8 @@ void readLcdSerial() {
card.startFileprint();
print_job_timer.start();

tempGraphUpdate = 2;

lcdShowPage(33);//print menu
}
break;
Expand All @@ -260,7 +279,7 @@ void readLcdSerial() {
#if FAN_COUNT > 0
for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0;
#endif

tempGraphUpdate = 0;
lcdShowPage(11); //main menu
break;
}
Expand All @@ -281,16 +300,87 @@ void readLcdSerial() {
#endif
break;
}
case 0x3C: {//preheat pla OK
thermalManager.setTargetHotend(185, 0);
thermalManager.setTargetBed(50);
break;
case 0x3C: { //Preheat options
if (lcdData == 0) {
//Serial.println(thermalManager.target_temperature[0]);
//writing preset temps to lcd
lcdBuff[0] = 0x5A;
lcdBuff[1] = 0xA5;
lcdBuff[2] = 0x0F; //data length
lcdBuff[3] = 0x82; //write data to sram
lcdBuff[4] = 0x05; //starting at 0x0570 vp
lcdBuff[5] = 0x70;

int tmp = planner.preheat_preset1_hotend;
lcdBuff[6] = highByte(tmp);
lcdBuff[7] = lowByte(tmp);
tmp = planner.preheat_preset1_bed;
lcdBuff[8] = 0x00;
lcdBuff[9] = lowByte(tmp);
tmp = planner.preheat_preset2_hotend;
lcdBuff[10] = highByte(tmp);
lcdBuff[11] = lowByte(tmp);
tmp = planner.preheat_preset2_bed;
lcdBuff[12] = 0x00;
lcdBuff[13] = lowByte(tmp);
tmp = planner.preheat_preset3_hotend;
lcdBuff[14] = highByte(tmp);
lcdBuff[15] = lowByte(tmp);
tmp = planner.preheat_preset3_bed;
lcdBuff[16] = 0x00;
lcdBuff[17] = lowByte(tmp);

Serial2.write(lcdBuff, 18);

lcdShowPage(39);//open preheat screen
//Serial.println(thermalManager.target_temperature[0]);
}
case 0x3D: {//preheat abs OK
thermalManager.setTargetHotend(210, 0);
thermalManager.setTargetBed(70);
break;
else {
//Serial.println(thermalManager.target_temperature[0]);
//read presets

lcdBuff[0] = 0x5A;
lcdBuff[1] = 0xA5;
lcdBuff[2] = 0x04; //data length
lcdBuff[3] = 0x83; //read sram
lcdBuff[4] = 0x05; //vp 0570
lcdBuff[5] = 0x70;
lcdBuff[6] = 0x06; //length

Serial2.write(lcdBuff, 7);

//read user entered values from sram
uint8_t bytesRead = Serial2.readBytes(lcdBuff, 19);
if ((bytesRead == 19) && (lcdBuff[0] == 0x5A) && (lcdBuff[1] == 0xA5)) {
planner.preheat_preset1_hotend = (int16_t)lcdBuff[7] * 255 + lcdBuff[8];
planner.preheat_preset1_bed = (int8_t)lcdBuff[10];
planner.preheat_preset2_hotend = (int16_t)lcdBuff[11] * 255 + lcdBuff[12];
planner.preheat_preset2_bed = (int8_t)lcdBuff[14];
planner.preheat_preset3_hotend = (int16_t)lcdBuff[15] * 255 + lcdBuff[16];
planner.preheat_preset3_bed = (int8_t)lcdBuff[18];
settings.save();
char command[20];
if (lcdData == 1) {
thermalManager.setTargetHotend(planner.preheat_preset1_hotend, 0);
//Serial.println(thermalManager.target_temperature[0]);
sprintf(command, "M104 S%d", planner.preheat_preset1_hotend); //build heat up command (extruder)
enqueue_and_echo_command((const char*)&command); //enque heat command
sprintf(command, "M140 S%d", planner.preheat_preset1_bed); //build heat up command (bed)
enqueue_and_echo_command((const char*)&command); //enque heat command
} else if (lcdData == 2) {
sprintf(command, "M104 S%d", planner.preheat_preset2_hotend); //build heat up command (extruder)
enqueue_and_echo_command((const char*)&command); //enque heat command
sprintf(command, "M140 S%d", planner.preheat_preset2_bed); //build heat up command (bed)
enqueue_and_echo_command((const char*)&command); //enque heat command
} else if (lcdData == 3) {
sprintf(command, "M104 S%d", planner.preheat_preset3_hotend); //build heat up command (extruder)
enqueue_and_echo_command((const char*)&command); //enque heat command
sprintf(command, "M140 S%d", planner.preheat_preset3_bed); //build heat up command (bed)
enqueue_and_echo_command((const char*)&command); //enque heat command
}
}
}
}
case 0x34: {//cool down OK
thermalManager.disable_all_heaters();
break;
Expand Down Expand Up @@ -360,10 +450,10 @@ void readLcdSerial() {
uint8_t bytesRead = Serial2.readBytes(lcdBuff, 21);
if ((bytesRead == 21) && (lcdBuff[0] == 0x5A) && (lcdBuff[1] == 0xA5)) {
planner.axis_steps_per_mm[X_AXIS] = (float)((uint16_t)lcdBuff[7] * 255 + lcdBuff[8]) / 10;
Serial.println(lcdBuff[7]);
Serial.println(lcdBuff[8]);
Serial.println(lcdBuff[9]);
Serial.println(lcdBuff[10]);
//Serial.println(lcdBuff[7]);
//Serial.println(lcdBuff[8]);
//Serial.println(lcdBuff[9]);
//Serial.println(lcdBuff[10]);
planner.axis_steps_per_mm[Y_AXIS] = (float)((uint16_t)lcdBuff[9] * 255 + lcdBuff[10]) / 10;
planner.axis_steps_per_mm[Z_AXIS] = (float)((uint16_t)lcdBuff[11] * 255 + lcdBuff[12]) / 10;
planner.axis_steps_per_mm[E_AXIS] = (float)((uint16_t)lcdBuff[13] * 255 + lcdBuff[14]) / 10;
Expand Down Expand Up @@ -648,23 +738,36 @@ void readLcdSerial() {
if ((bytesRead == 11) && (lcdBuff[0] == 0x5A) && (lcdBuff[1] == 0xA5)) {
uint16_t hotendTemp = (uint16_t)lcdBuff[7] * 255 + lcdBuff[8];
uint16_t bedTemp = (uint16_t)lcdBuff[9] * 255 + lcdBuff[10];
Serial.println(hotendTemp);
Serial.println(bedTemp);
//Serial.println(hotendTemp);
//Serial.println(bedTemp);
char command[20];
if (lcdData == 1) { //Hotend pid autotune
sprintf(command, "G303 S%d E0 C10 U1", hotendTemp); //build auto pid command (extruder)
sprintf(command, "M303 S%d E0 C1 U1", hotendTemp); //build auto pid command (extruder)
}
else if (lcdData == 2) { //Bed pid autotune
sprintf(command, "G303 S%d E-1 C10 U1", bedTemp); //build auto pid command (bed)
sprintf(command, "M303 S%d E-1 C1 U1", bedTemp); //build auto pid command (bed)
}
opMode == OPMODE_AUTO_PID;
enqueue_and_echo_command((const char*)&command); //enque pid command
opMode == OPMODE_AUTO_PID;
tempGraphUpdate = 2;
}
}
break;
}
case 0xFF: {
}
case 0x3D: { //Close temp screen
if (lcdData == 1) {
tempGraphUpdate = 0;
Serial.println(lastPage);
lcdShowPage(lastPage);
}
else {
lastPage = lcdgetCurrentPage();
Serial.println(lastPage);
tempGraphUpdate = 2;
lcdShowPage(63);
}
}
/*case 0xFF: {
lcdShowPage(58); //enable lcd bridge mode
while (1) {
watchdog_reset();
Expand All @@ -674,7 +777,7 @@ void readLcdSerial() {
Serial.write(Serial2.read());
}
break;
}
}*/
default:
break;
}
Expand Down Expand Up @@ -748,3 +851,17 @@ void lcdSendStats() {
Serial2.write(lcdBuff, 27);

}

void updateGraphData() {
lcdBuff[0] = 0x5A;
lcdBuff[1] = 0xA5;
lcdBuff[2] = 0x06; //data length
lcdBuff[3] = 0x84; //update curve
lcdBuff[4] = 0x03; //channels 0,1
lcdBuff[5] = highByte(thermalManager.degHotend(0));
lcdBuff[6] = lowByte(thermalManager.degHotend(0));
lcdBuff[7] = 0x00;//0x03 bed temp
lcdBuff[8] = thermalManager.degBed();

Serial2.write(lcdBuff, 9);
}
2 changes: 2 additions & 0 deletions Marlin/bi3_plus_lcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ void lcdTask();
void executeLoopedOperation(millis_t ms);
void lcdStatusUpdate(millis_t ms);
void lcdShowPage(uint8_t pageNumber);
uint8_t lcdgetCurrentPage();
void readLcdSerial();
void lcdSendStats();
void lcdSendMarlinVersion();
void updateGraphData();

#endif
Loading

0 comments on commit c01853e

Please sign in to comment.