Merge pull request #1258 from fmalpartida/Development

Merge branch 'SAV-MkI_merge' into Development
This commit is contained in:
Bo Herrmannsen 2014-12-28 19:56:32 +01:00
commit c1df713e4d
6 changed files with 106 additions and 17 deletions

View file

@ -657,10 +657,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
// --------------------- // ---------------------
// 2 wire Non-latching LCD SR from: // 2 wire Non-latching LCD SR from:
// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
//#define SR_LCD
#ifdef SR_LCD //#define SAV_3DLCD
#define SR_LCD_2W_NL // Non latching 2 wire shift register #ifdef SAV_3DLCD
//#define NEWPANEL #define SR_LCD_2W_NL // Non latching 2 wire shiftregister
#define NEWPANEL
#define ULTIPANEL
#endif #endif

View file

@ -463,11 +463,21 @@ void enquecommand_P(const char *cmd)
void setup_killpin() void setup_killpin()
{ {
#if defined(KILL_PIN) && KILL_PIN > -1 #if defined(KILL_PIN) && KILL_PIN > -1
pinMode(KILL_PIN,INPUT); SET_INPUT(KILL_PIN);
WRITE(KILL_PIN,HIGH); WRITE(KILL_PIN,HIGH);
#endif #endif
} }
// Set home pin
void setup_homepin(void)
{
#if defined(HOME_PIN) && HOME_PIN > -1
SET_INPUT(HOME_PIN);
WRITE(HOME_PIN,HIGH);
#endif
}
void setup_photpin() void setup_photpin()
{ {
#if defined(PHOTOGRAPH_PIN) && PHOTOGRAPH_PIN > -1 #if defined(PHOTOGRAPH_PIN) && PHOTOGRAPH_PIN > -1
@ -600,6 +610,7 @@ void setup()
pinMode(SERVO0_PIN, OUTPUT); pinMode(SERVO0_PIN, OUTPUT);
digitalWrite(SERVO0_PIN, LOW); // turn it off digitalWrite(SERVO0_PIN, LOW); // turn it off
#endif // Z_PROBE_SLED #endif // Z_PROBE_SLED
setup_homepin();
} }
@ -4303,6 +4314,18 @@ void handle_status_leds(void) {
void manage_inactivity() void manage_inactivity()
{ {
#if defined(KILL_PIN) && KILL_PIN > -1
static int killCount = 0; // make the inactivity button a bit less responsive
const int KILL_DELAY = 10000;
#endif
#if defined(HOME_PIN) && HOME_PIN > -1
static int homeDebounceCount = 0; // poor man's debouncing count
const int HOME_DEBOUNCE_DELAY = 10000;
#endif
if(buflen < (BUFSIZE-1)) if(buflen < (BUFSIZE-1))
get_command(); get_command();
@ -4332,9 +4355,49 @@ void manage_inactivity()
#endif #endif
#if defined(KILL_PIN) && KILL_PIN > -1 #if defined(KILL_PIN) && KILL_PIN > -1
// Check if the kill button was pressed and wait just in case it was an accidental
// key kill key press
// -------------------------------------------------------------------------------
if( 0 == READ(KILL_PIN) ) if( 0 == READ(KILL_PIN) )
kill(); {
killCount++;
}
else if (killCount > 0)
{
killCount--;
}
// Exceeded threshold and we can confirm that it was not accidental
// KILL the machine
// ----------------------------------------------------------------
if ( killCount >= KILL_DELAY)
{
kill();
}
#endif #endif
#if defined(HOME_PIN) && HOME_PIN > -1
// Check to see if we have to home, use poor man's debouncer
// ---------------------------------------------------------
if ( 0 == READ(HOME_PIN) )
{
if (homeDebounceCount == 0)
{
enquecommand_P((PSTR("G28")));
homeDebounceCount++;
LCD_ALERTMESSAGEPGM(MSG_AUTO_HOME);
}
else if (homeDebounceCount < HOME_DEBOUNCE_DELAY)
{
homeDebounceCount++;
}
else
{
homeDebounceCount = 0;
}
}
#endif
#if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1 #if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1
controllerFan(); //Check if fan should be turned on to cool stepper drivers down controllerFan(); //Check if fan should be turned on to cool stepper drivers down
#endif #endif
@ -4391,6 +4454,14 @@ void kill()
SERIAL_ERROR_START; SERIAL_ERROR_START;
SERIAL_ERRORLNPGM(MSG_ERR_KILLED); SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
LCD_ALERTMESSAGEPGM(MSG_KILLED); LCD_ALERTMESSAGEPGM(MSG_KILLED);
// FMC small patch to update the LCD before ending
sei(); // enable interrupts
for ( int i=5; i--; lcd_update())
{
delay(200);
}
cli(); // disable interrupts
suicide(); suicide();
while(1) { /* Intentionally left empty */ } // Wait for reset while(1) { /* Intentionally left empty */ } // Wait for reset
} }

View file

@ -43,6 +43,9 @@
#elif MB(5DPRINT) #elif MB(5DPRINT)
#define MACHINE_NAME "Makibox" #define MACHINE_NAME "Makibox"
#define FIRMWARE_URL "https://github.com/ErikZalm/Marlin/" #define FIRMWARE_URL "https://github.com/ErikZalm/Marlin/"
#elif MB(SAV_MKI)
#define MACHINE_NAME "SAV MkI"
#define FIRMWARE_URL "https://github.com/fmalpartida/Marlin/tree/SAV-MkI-config"
#else #else
#ifdef CUSTOM_MENDEL_NAME #ifdef CUSTOM_MENDEL_NAME
#define MACHINE_NAME CUSTOM_MENDEL_NAME #define MACHINE_NAME CUSTOM_MENDEL_NAME

View file

@ -1904,6 +1904,8 @@
#define X_STOP_PIN 13 #define X_STOP_PIN 13
#define Y_STOP_PIN 14 #define Y_STOP_PIN 14
#define Z_STOP_PIN 15 #define Z_STOP_PIN 15
// #define Z_STOP_PIN 36 // For inductive sensor.
#define TEMP_0_PIN 7 // Extruder / Analog pin numbering #define TEMP_0_PIN 7 // Extruder / Analog pin numbering
#define TEMP_BED_PIN 6 // Bed / Analog pin numbering #define TEMP_BED_PIN 6 // Bed / Analog pin numbering
@ -1914,7 +1916,6 @@
#define SDSS 20 // PB0 - 8 in marlin env. #define SDSS 20 // PB0 - 8 in marlin env.
#define LED_PIN -1 #define LED_PIN -1
#define PS_ON_PIN -1 #define PS_ON_PIN -1
#define KILL_PIN -1
#define ALARM_PIN -1 #define ALARM_PIN -1
#define SDCARDDETECT -1 #define SDCARDDETECT -1
@ -1933,13 +1934,24 @@
#define LCD_PINS_D5 -1 #define LCD_PINS_D5 -1
#define LCD_PINS_D6 -1 #define LCD_PINS_D6 -1
#define LCD_PINS_D7 -1 #define LCD_PINS_D7 -1
#define BTN_EN1 -1
#define BTN_EN2 -1
#define BTN_ENC -1
#ifdef SAV_3DLCD
// For LCD SHIFT register LCD // For LCD SHIFT register LCD
#define SR_DATA_PIN 0 #define SR_DATA_PIN 1
#define SR_CLK_PIN 1 #define SR_CLK_PIN 0
#define BTN_EN1 41
#define BTN_EN2 40
#define BTN_ENC 12
#define KILL_PIN 42 // A2 = 42 - teensy = 40
#define HOME_PIN -1 // A4 = marlin 44 - teensy = 42
#ifdef NUM_SERVOS
#define SERVO0_PIN 41 // In teensy's pin definition for pinMode (in Servo.cpp)
#endif
#endif
#endif // SAV_MKI #endif // SAV_MKI

View file

@ -1075,12 +1075,12 @@ void lcd_init()
lcd_implementation_init(); lcd_implementation_init();
#ifdef NEWPANEL #ifdef NEWPANEL
pinMode(BTN_EN1,INPUT); SET_INPUT(BTN_EN1);
pinMode(BTN_EN2,INPUT); SET_INPUT(BTN_EN2);
WRITE(BTN_EN1,HIGH); WRITE(BTN_EN1,HIGH);
WRITE(BTN_EN2,HIGH); WRITE(BTN_EN2,HIGH);
#if BTN_ENC > 0 #if BTN_ENC > 0
pinMode(BTN_ENC,INPUT); SET_INPUT(BTN_ENC);
WRITE(BTN_ENC,HIGH); WRITE(BTN_ENC,HIGH);
#endif #endif
#ifdef REPRAPWORLD_KEYPAD #ifdef REPRAPWORLD_KEYPAD

View file

@ -191,6 +191,7 @@ extern volatile uint16_t buttons; //an extended version of the last checked but
// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
#elif defined(SR_LCD_2W_NL) #elif defined(SR_LCD_2W_NL)
extern "C" void __cxa_pure_virtual() { while (1); }
#include <LCD.h> #include <LCD.h>
#include <LiquidCrystal_SR.h> #include <LiquidCrystal_SR.h>
#define LCD_CLASS LiquidCrystal_SR #define LCD_CLASS LiquidCrystal_SR