Browse Source

Fixing Rigidbot LCD Panel Support

pull/1/head
Ruwan J Egoda Gamage 9 years ago
committed by Richard Wackerbarth
parent
commit
becbfe1065
  1. 2
      Marlin/cardreader.cpp
  2. 11
      Marlin/example_configurations/RigidBot/Configuration.h
  3. 8
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  4. 27
      Marlin/pins_RIGIDBOARD.h
  5. 43
      Marlin/ultralcd.cpp
  6. 3
      Marlin/ultralcd.h

2
Marlin/cardreader.cpp

@ -196,7 +196,7 @@ void CardReader::initsd() {
if (root.isOpen()) root.close(); if (root.isOpen()) root.close();
#if ENABLED(SDEXTRASLOW) #if ENABLED(SDEXTRASLOW)
#define SPI_SPEED SPI_QUARTER_SPEED #define SPI_SPEED SPI_SIXTEENTH_SPEED
#elif ENABLED(SDSLOW) #elif ENABLED(SDSLOW)
#define SPI_SPEED SPI_HALF_SPEED #define SPI_SPEED SPI_HALF_SPEED
#else #else

11
Marlin/example_configurations/RigidBot/Configuration.h

@ -219,6 +219,11 @@ Here are some standard links for getting your machine calibrated:
//#define DEFAULT_Ki 0.85 //#define DEFAULT_Ki 0.85
//#define DEFAULT_Kd 245 //#define DEFAULT_Kd 245
// E3D w/ rigidbot cartridge
//#define DEFAULT_Kp 16.30
//#define DEFAULT_Ki 0.95
//#define DEFAULT_Kd 69.69
#endif // PIDTEMP #endif // PIDTEMP
//=========================================================================== //===========================================================================
@ -611,7 +616,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily). // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
// M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to.
//define this to enable EEPROM support //define this to enable EEPROM support
//#define EEPROM_SETTINGS #define EEPROM_SETTINGS
#if ENABLED(EEPROM_SETTINGS) #if ENABLED(EEPROM_SETTINGS)
// To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
@ -651,10 +656,10 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//#define ULTRA_LCD //general LCD support, also 16x2 //#define ULTRA_LCD //general LCD support, also 16x2
//#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) //#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
//#define SDSUPPORT // Enable SD Card Support in Hardware Console #define SDSUPPORT // Enable SD Card Support in Hardware Console
// Changed behaviour! If you need SDSUPPORT uncomment it! // Changed behaviour! If you need SDSUPPORT uncomment it!
//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error) //#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
//#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error) #define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
//#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
//#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
//#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking

8
Marlin/example_configurations/RigidBot/Configuration_adv.h

@ -279,9 +279,9 @@
//=============================Additional Features=========================== //=============================Additional Features===========================
//=========================================================================== //===========================================================================
#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly //#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value //#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value //#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
@ -414,7 +414,7 @@ const unsigned int dropsegments = 5; //everything with less than this number of
//The ASCII buffer for receiving from the serial: //The ASCII buffer for receiving from the serial:
#define MAX_CMD_SIZE 96 #define MAX_CMD_SIZE 96
#define BUFSIZE 4 #define BUFSIZE 8
// Bad Serial-connections can miss a received command by sending an 'ok' // Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients abort after 30 seconds in a timeout. // Therefore some clients abort after 30 seconds in a timeout.

27
Marlin/pins_RIGIDBOARD.h

@ -5,7 +5,10 @@
#include "pins_RAMPS_13.h" #include "pins_RAMPS_13.h"
#if ENABLED(Z_MIN_PROBE_ENDSTOP) #if ENABLED(Z_MIN_PROBE_ENDSTOP)
#define Z_MIN_PROBE_PIN 19 #undef Z_MAX_PIN
#define Z_MAX_PIN -1
#undef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN 19 // Z-MAX pin J14 End Stops
#endif #endif
#undef HEATER_0_PIN #undef HEATER_0_PIN
@ -25,24 +28,22 @@
#undef BEEPER_PIN #undef BEEPER_PIN
#define BEEPER_PIN -1 #define BEEPER_PIN -1
#undef SD_DETECT_PIN // Direction buttons
#define SD_DETECT_PIN 22 #define BTN_UP 37
#define BTN_DWN 35
// Extra button definitions, substitute for EN1 / EN2
#define BTN_UP 37 // BTN_EN1
#define BTN_DWN 35 // BTN_EN2
#define BTN_LFT 33 #define BTN_LFT 33
#define BTN_RT 32 #define BTN_RT 32
// Marlin can respond to UP/DOWN by default // 'R' button
// #undef BTN_EN1
// #undef BTN_EN2
//#define BTN_EN1 -1
//#define BTN_EN2 -1
#undef BTN_ENC #undef BTN_ENC
#define BTN_ENC 31 #define BTN_ENC 31
// Disable encoder
#undef BTN_EN1
#define BTN_EN1 -1
#undef BTN_EN2
#define BTN_EN2 -1
#undef SD_DETECT_PIN #undef SD_DETECT_PIN
#define SD_DETECT_PIN 22 #define SD_DETECT_PIN 22

43
Marlin/ultralcd.cpp

@ -218,6 +218,9 @@ static void lcd_status_screen();
#if ENABLED(REPRAPWORLD_KEYPAD) #if ENABLED(REPRAPWORLD_KEYPAD)
volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
#endif #endif
#if ENABLED(RIGIDBOT_PANEL)
volatile millis_t next_fake_encoder_update_ms;
#endif
#if ENABLED(LCD_HAS_SLOW_BUTTONS) #if ENABLED(LCD_HAS_SLOW_BUTTONS)
volatile uint8_t slow_buttons; // Bits of the pressed buttons. volatile uint8_t slow_buttons; // Bits of the pressed buttons.
@ -1524,11 +1527,15 @@ void lcd_init() {
lcd_implementation_init(); lcd_implementation_init();
#if ENABLED(NEWPANEL) #if ENABLED(NEWPANEL)
#if BTN_EN1 > 0
SET_INPUT(BTN_EN1); SET_INPUT(BTN_EN1);
SET_INPUT(BTN_EN2);
WRITE(BTN_EN1, HIGH); WRITE(BTN_EN1, HIGH);
#endif
#if BTN_EN2 > 0
SET_INPUT(BTN_EN2);
WRITE(BTN_EN2, HIGH); WRITE(BTN_EN2, HIGH);
#endif
#if BTN_ENC > 0 #if BTN_ENC > 0
SET_INPUT(BTN_ENC); SET_INPUT(BTN_ENC);
@ -1543,6 +1550,14 @@ void lcd_init() {
WRITE(SHIFT_LD, HIGH); WRITE(SHIFT_LD, HIGH);
#endif #endif
#ifdef RIGIDBOT_PANEL
pinMode(BTN_UP,INPUT);
pinMode(BTN_DWN,INPUT);
pinMode(BTN_LFT,INPUT);
pinMode(BTN_RT,INPUT);
next_fake_encoder_update_ms = 0;
#endif
#else // Not NEWPANEL #else // Not NEWPANEL
#if ENABLED(SR_LCD_2W_NL) // Non latching 2 wire shift register #if ENABLED(SR_LCD_2W_NL) // Non latching 2 wire shift register
@ -1843,8 +1858,32 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
void lcd_buttons_update() { void lcd_buttons_update() {
#if ENABLED(NEWPANEL) #if ENABLED(NEWPANEL)
uint8_t newbutton = 0; uint8_t newbutton = 0;
#if BTN_EN1 > 0
if (READ(BTN_EN1) == 0) newbutton |= EN_A; if (READ(BTN_EN1) == 0) newbutton |= EN_A;
#endif
#if BTN_EN2 > 0
if (READ(BTN_EN2) == 0) newbutton |= EN_B; if (READ(BTN_EN2) == 0) newbutton |= EN_B;
#endif
#if ENABLED(RIGIDBOT_PANEL)
if (millis() > next_fake_encoder_update_ms && READ(BTN_UP) == 0) {
encoderDiff = -1 * ENCODER_STEPS_PER_MENU_ITEM;
next_fake_encoder_update_ms = millis() + 300;
}
if (millis() > next_fake_encoder_update_ms && READ(BTN_DWN) == 0) {
encoderDiff = ENCODER_STEPS_PER_MENU_ITEM;
next_fake_encoder_update_ms = millis() + 300;
}
if (millis() > next_fake_encoder_update_ms && READ(BTN_LFT) == 0) {
encoderDiff = -1 * ENCODER_PULSES_PER_STEP;
next_fake_encoder_update_ms = millis() + 300;
}
if (millis() > next_fake_encoder_update_ms && READ(BTN_RT) == 0) {
encoderDiff = ENCODER_PULSES_PER_STEP;
next_fake_encoder_update_ms = millis() + 300;
}
#endif
#if BTN_ENC > 0 #if BTN_ENC > 0
if (millis() > next_button_update_ms && READ(BTN_ENC) == 0) newbutton |= EN_C; if (millis() > next_button_update_ms && READ(BTN_ENC) == 0) newbutton |= EN_C;
#endif #endif

3
Marlin/ultralcd.h

@ -41,6 +41,9 @@
#if ENABLED(REPRAPWORLD_KEYPAD) #if ENABLED(REPRAPWORLD_KEYPAD)
extern volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values extern volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
#endif #endif
#if ENABLED(RIGIDBOT_PANEL)
extern volatile millis_t next_fake_encoder_update_ms;
#endif
#else #else
FORCE_INLINE void lcd_buttons_update() {} FORCE_INLINE void lcd_buttons_update() {}
#endif #endif

Loading…
Cancel
Save