Skip to content

Commit

Permalink
Hyperfine, Filament Runout Sensor, some fixes...
Browse files Browse the repository at this point in the history
and preparing for multiple hex files depending on needed languages
  • Loading branch information
3d-gussner authored Oct 14, 2017
1 parent b18035a commit 730f6a0
Show file tree
Hide file tree
Showing 14 changed files with 1,040 additions and 783 deletions.
4 changes: 2 additions & 2 deletions Firmware/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@
//#define STRING_VERSION "1.0.2"

#define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
#define STRING_CONFIG_H_AUTHOR "3d-gussner,1014v5" // Who made the changes.

// SERIAL_PORT selects which serial port should be used for communication with the host.
// This allows the connection of wireless adapters (for instance) to non-default port pins.
// Serial port 0 is still used by the Arduino bootloader regardless of this setting.
#define SERIAL_PORT 0

// This determines the communication speed of the printer
#define BAUDRATE 250000
#define BAUDRATE 115200

// This enables the serial port associated to the Bluetooth interface
//#define BTENABLED // Enable BT interface on AT90USB devices
Expand Down
28 changes: 17 additions & 11 deletions Firmware/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,7 @@ void setup()
#ifndef DEBUG_DISABLE_STARTMSGS
check_babystep(); //checking if Z babystep is in allowed range

for (int i = 0; i < 4; i++) EEPROM_read_B(EEPROM_BOWDEN_LENGTH + i * 2, &bowden_length[i]);
if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) == 1) {
lcd_wizard(0);
}
Expand Down Expand Up @@ -1274,7 +1275,6 @@ void setup()
lcd_show_fullscreen_message_and_wait_P(MSG_DEFAULT_SETTINGS_LOADED);
}
}
for (int i = 0; i < 4; i++) EEPROM_read_B(EEPROM_BOWDEN_LENGTH + i * 2, &bowden_length[i]);

#endif //DEBUG_DISABLE_STARTMSGS

Expand All @@ -1284,7 +1284,7 @@ void setup()
FIL_RUNOUT_INVERTING = eeprom_read_byte((uint8_t*)EEPROM_FIL_RUNOUT_INVERTING);
ENDSTOPPULLUP_FIL_RUNOUT = eeprom_read_byte((uint8_t*)EEPROM_ENDSTOPPULLUP_FIL_RUNOUT);
#endif
// end FILAMENT_RUNOUT_SENSOR
// end FILAMENT_RUNOUT_SENSOR

lcd_update_enable(true);

Expand Down Expand Up @@ -1404,6 +1404,7 @@ void host_keepalive() {
// Before loop(), the setup() function is called by the main() routine.
void loop()
{
KEEPALIVE_STATE(NOT_BUSY);
if (usb_printing_counter > 0 && millis()-_usb_timer > 1000)
{
is_usb_printing = true;
Expand Down Expand Up @@ -1503,7 +1504,8 @@ void get_command()
continue;
if(serial_char == '\n' ||
serial_char == '\r' ||
serial_count >= (MAX_CMD_SIZE - 1) )
(serial_char == ':' && comment_mode == false) ||
serial_count >= (MAX_CMD_SIZE - 1) )
{
if(!serial_count) { //if empty line
comment_mode = false; //for new command
Expand Down Expand Up @@ -1666,6 +1668,7 @@ void get_command()
if(serial_char == '\n' ||
serial_char == '\r' ||
(serial_char == '#' && comment_mode == false) ||
(serial_char == ':' && comment_mode == false) ||
serial_count >= (MAX_CMD_SIZE - 1)||n==-1)
{
if(card.eof()){
Expand Down Expand Up @@ -2447,7 +2450,7 @@ void process_commands()
return;
} else if (code_seen("SERIAL HIGH")) {
MYSERIAL.println("SERIAL HIGH");
MYSERIAL.begin(250000);
MYSERIAL.begin(115200);
return;
} else if(code_seen("Beat")) {
// Kick farm link timer
Expand All @@ -2474,7 +2477,9 @@ void process_commands()

#ifdef FILAMENT_RUNOUT_SENSOR
if(((READ(FIL_RUNOUT_PIN) ^ FIL_RUNOUT_INVERTING) == 0) && fil_runout_active) {
feedmultiplyBckp=feedmultiply;
//enqueue_and_echo_commands_P(PSTR(FILAMENT_RUNOUT_SCRIPT));
enquecommand_front_P((PSTR(FILAMENT_RUNOUT_SCRIPT)));
/* feedmultiplyBckp=feedmultiply;
float target[4];
float lastpos[4];
target[X_AXIS]=current_position[X_AXIS];
Expand All @@ -2493,6 +2498,9 @@ void process_commands()
target[Z_AXIS]+= FILAMENTCHANGE_ZADD ;
if(target[Z_AXIS] < 20){
target[Z_AXIS]+= 20 ;
}
plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 300, active_extruder);
Expand Down Expand Up @@ -2636,7 +2644,7 @@ void process_commands()
sprintf_P(cmd, PSTR("M220 S%i"), feedmultiplyBckp);
enquecommand(cmd);

*/
}


Expand Down Expand Up @@ -3498,9 +3506,7 @@ void process_commands()
eeprom_bed_correction_valid ? SERIAL_PROTOCOLPGM("Bed correction data valid\n") : SERIAL_PROTOCOLPGM("Bed correction data not valid\n");
}

// bed correction routine
// PJR's amendment:
// YOKOTSUNO
// Hyperfine bed correction routine
for (uint8_t i = 0; i < 8; ++i) {
unsigned char codes[8] = { 'a', 'b', 'c', 'd' , 'e' , 'f', 'g', 'h'};
long correction = 0;
Expand Down Expand Up @@ -5499,8 +5505,8 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
#ifdef FILAMENTCHANGE_ZADD
target[Z_AXIS]+= FILAMENTCHANGE_ZADD ;
// XXX: Removed unused var 'TooLowZ'
if(target[Z_AXIS] < 10){
target[Z_AXIS]+= 10 ;
if(target[Z_AXIS] < 20){
target[Z_AXIS]+= 20 ;
}
#endif

Expand Down
6 changes: 3 additions & 3 deletions Firmware/cardreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
createFilename(filename, p);
SERIAL_PROTOCOL(prepend);
if (longFilename[0] != 0) {
SERIAL_PROTOCOL(longFilename);
SERIAL_PROTOCOL(longFilename);
} else {
SERIAL_PROTOCOL(filename);
SERIAL_PROTOCOL(filename);
}
MYSERIAL.write(' ');
SERIAL_PROTOCOLLN(p.fileSize);
Expand Down Expand Up @@ -1060,7 +1060,7 @@ void CardReader::printingHasFinished()
}
autotempShutdown();
#ifdef SDCARD_SORT_ALPHA
presort();
//presort();
#endif
}
}
Expand Down
2 changes: 1 addition & 1 deletion Firmware/langtool.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use strict;
use warnings;

my @langs = ("en","cz","it","es","pl","de","nl");
my @langs = ("en","cz","it","es","pl","de");

sub parselang
{
Expand Down
Loading

0 comments on commit 730f6a0

Please sign in to comment.