|
|
|
@ -8,6 +8,8 @@
|
|
|
|
|
#include "stepper.h"
|
|
|
|
|
#include "ConfigurationStore.h"
|
|
|
|
|
|
|
|
|
|
int8_t encoderDiff; /* encoderDiff is updated from interrupt context and added to encoderPosition every LCD update */
|
|
|
|
|
|
|
|
|
|
/* Configuration settings */
|
|
|
|
|
int plaPreheatHotendTemp;
|
|
|
|
|
int plaPreheatHPBTemp;
|
|
|
|
@ -122,13 +124,11 @@ static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned l
|
|
|
|
|
#ifndef REPRAPWORLD_KEYPAD
|
|
|
|
|
volatile uint8_t buttons;//Contains the bits of the currently pressed buttons.
|
|
|
|
|
#else
|
|
|
|
|
volatile uint16_t buttons;//Contains the bits of the currently pressed buttons (extended).
|
|
|
|
|
volatile uint8_t buttons_reprapworld_keypad; // to store the reprapworld_keypad shiftregister values
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
uint8_t currentMenuViewOffset; /* scroll offset in the current menu */
|
|
|
|
|
uint32_t blocking_enc;
|
|
|
|
|
uint8_t lastEncoderBits;
|
|
|
|
|
int8_t encoderDiff; /* encoderDiff is updated from interrupt context and added to encoderPosition every LCD update */
|
|
|
|
|
uint32_t encoderPosition;
|
|
|
|
|
#if (SDCARDDETECT > 0)
|
|
|
|
|
bool lcd_oldcardstatus;
|
|
|
|
@ -410,7 +410,7 @@ static void lcd_move_z()
|
|
|
|
|
if (current_position[Z_AXIS] > Z_MAX_POS)
|
|
|
|
|
current_position[Z_AXIS] = Z_MAX_POS;
|
|
|
|
|
encoderPosition = 0;
|
|
|
|
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 60, active_extruder);
|
|
|
|
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], homing_feedrate[Z_AXIS]/60, active_extruder);
|
|
|
|
|
lcdDrawUpdate = 1;
|
|
|
|
|
}
|
|
|
|
|
if (lcdDrawUpdate)
|
|
|
|
@ -736,6 +736,26 @@ menu_edit_type(float, float52, ftostr52, 100)
|
|
|
|
|
menu_edit_type(unsigned long, long5, ftostr5, 0.01)
|
|
|
|
|
|
|
|
|
|
#ifdef REPRAPWORLD_KEYPAD
|
|
|
|
|
static void reprapworld_keypad_move_z_up() {
|
|
|
|
|
encoderPosition = 1;
|
|
|
|
|
move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
|
|
|
|
|
lcd_move_z();
|
|
|
|
|
}
|
|
|
|
|
static void reprapworld_keypad_move_z_down() {
|
|
|
|
|
encoderPosition = -1;
|
|
|
|
|
move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
|
|
|
|
|
lcd_move_z();
|
|
|
|
|
}
|
|
|
|
|
static void reprapworld_keypad_move_x_left() {
|
|
|
|
|
encoderPosition = -1;
|
|
|
|
|
move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
|
|
|
|
|
lcd_move_x();
|
|
|
|
|
}
|
|
|
|
|
static void reprapworld_keypad_move_x_right() {
|
|
|
|
|
encoderPosition = 1;
|
|
|
|
|
move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
|
|
|
|
|
lcd_move_x();
|
|
|
|
|
}
|
|
|
|
|
static void reprapworld_keypad_move_y_down() {
|
|
|
|
|
encoderPosition = 1;
|
|
|
|
|
move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
|
|
|
|
@ -747,9 +767,7 @@ menu_edit_type(unsigned long, long5, ftostr5, 0.01)
|
|
|
|
|
lcd_move_y();
|
|
|
|
|
}
|
|
|
|
|
static void reprapworld_keypad_move_home() {
|
|
|
|
|
//enquecommand_P((PSTR("G28"))); // move all axis home
|
|
|
|
|
// TODO gregor: move all axis home, i have currently only one axis on my prusa i3
|
|
|
|
|
enquecommand_P((PSTR("G28 Y")));
|
|
|
|
|
enquecommand_P((PSTR("G28"))); // move all axis home
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
@ -878,6 +896,18 @@ void lcd_update()
|
|
|
|
|
{
|
|
|
|
|
#ifdef ULTIPANEL
|
|
|
|
|
#ifdef REPRAPWORLD_KEYPAD
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) {
|
|
|
|
|
reprapworld_keypad_move_z_up();
|
|
|
|
|
}
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_Z_DOWN) {
|
|
|
|
|
reprapworld_keypad_move_z_down();
|
|
|
|
|
}
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_X_LEFT) {
|
|
|
|
|
reprapworld_keypad_move_x_left();
|
|
|
|
|
}
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_X_RIGHT) {
|
|
|
|
|
reprapworld_keypad_move_x_right();
|
|
|
|
|
}
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_Y_DOWN) {
|
|
|
|
|
reprapworld_keypad_move_y_down();
|
|
|
|
|
}
|
|
|
|
@ -973,7 +1003,7 @@ void lcd_buttons_update()
|
|
|
|
|
#if BTN_ENC > 0
|
|
|
|
|
if((blocking_enc<millis()) && (READ(BTN_ENC)==0))
|
|
|
|
|
newbutton |= EN_C;
|
|
|
|
|
#endif
|
|
|
|
|
buttons = newbutton;
|
|
|
|
|
#ifdef REPRAPWORLD_KEYPAD
|
|
|
|
|
// for the reprapworld_keypad
|
|
|
|
|
uint8_t newbutton_reprapworld_keypad=0;
|
|
|
|
@ -986,9 +1016,8 @@ void lcd_buttons_update()
|
|
|
|
|
WRITE(SHIFT_CLK,HIGH);
|
|
|
|
|
WRITE(SHIFT_CLK,LOW);
|
|
|
|
|
}
|
|
|
|
|
newbutton |= ((~newbutton_reprapworld_keypad) << REPRAPWORLD_BTN_OFFSET); //invert it, because a pressed switch produces a logical 0
|
|
|
|
|
buttons_reprapworld_keypad=~newbutton_reprapworld_keypad; //invert it, because a pressed switch produces a logical 0
|
|
|
|
|
#endif
|
|
|
|
|
buttons = newbutton;
|
|
|
|
|
#else //read it from the shift register
|
|
|
|
|
uint8_t newbutton=0;
|
|
|
|
|
WRITE(SHIFT_LD,LOW);
|
|
|
|
|