Merge pull request #88 from daid/Marlin_v1

Made plan_buffer_line arguments const...
This commit is contained in:
ErikZalm 2012-03-03 11:18:14 -08:00
commit 1d5809d458
6 changed files with 29 additions and 55 deletions

View File

@ -64,39 +64,11 @@ private:
char* diveDirName;
void lsDive(const char *prepend,SdFile parent);
};
#define IS_SD_PRINTING (card.sdprinting)
#else
#define dir_t bool
class CardReader
{
public:
FORCE_INLINE CardReader(){};
FORCE_INLINE static void initsd(){};
FORCE_INLINE static void write_command(char *buf){};
FORCE_INLINE static void checkautostart(bool x) {};
FORCE_INLINE static void openFile(char* name,bool read){};
FORCE_INLINE static void closefile() {};
FORCE_INLINE static void release(){};
FORCE_INLINE static void startFileprint(){};
FORCE_INLINE static void startFilewrite(char *name){};
FORCE_INLINE static void pauseSDPrint(){};
FORCE_INLINE static void getStatus(){};
FORCE_INLINE static void selectFile(char* name){};
FORCE_INLINE static void getfilename(const uint8_t nr){};
FORCE_INLINE static uint8_t getnrfilenames(){return 0;};
#define IS_SD_PRINTING (false)
FORCE_INLINE static void ls() {};
FORCE_INLINE static bool eof() {return true;};
FORCE_INLINE static char get() {return 0;};
FORCE_INLINE static void setIndex(){};
FORCE_INLINE uint8_t percentDone(){return 0;};
};
#endif //SDSUPPORT
#endif
#endif

View File

@ -940,22 +940,20 @@
#endif
//List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN
#if EXTRUDERS == 3
#define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN
#define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN
#elif EXTRUDERS == 2
#define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN
#define _E2_PINS -1
#elif EXTRUDERS == 1
#define _E1_PINS -1
#define _E2_PINS -1
#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, HEATER_0_PIN,
#if EXTRUDERS > 1
#define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, HEATER_1_PIN,
#else
#error Unsupported number of extruders
#define _E1_PINS
#endif
#if EXTRUDERS > 2
#define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, HEATER_2_PIN,
#else
#define _E2_PINS
#endif
#define SENSITIVE_PINS {0, 1, X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, LED_PIN, PS_ON_PIN, \
HEATER_0_PIN, HEATER_1_PIN, HEATER_2_PIN, \
HEATER_BED_PIN, FAN_PIN, \
_E0_PINS, _E1_PINS, _E2_PINS, \
_E0_PINS _E1_PINS _E2_PINS \
TEMP_0_PIN, TEMP_1_PIN, TEMP_2_PIN, TEMP_BED_PIN }
#endif

View File

@ -441,7 +441,7 @@ float junction_deviation = 0.1;
// Add a new linear movement to the buffer. steps_x, _y and _z is the absolute position in
// mm. Microseconds specify how many microseconds the move should take to perform. To aid acceleration
// calculation the caller must also provide the physical length of the line in millimeters.
void plan_buffer_line(float &x, float &y, float &z, float &e, float feed_rate, uint8_t &extruder)
void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder)
{
// Calculate the buffer head after we push this byte
int next_buffer_head = next_block_index(block_buffer_head);

View File

@ -67,7 +67,7 @@ void plan_init();
// Add a new linear movement to the buffer. x, y and z is the signed, absolute target position in
// millimaters. Feed rate specifies the speed of the motion.
void plan_buffer_line(float &x, float &y, float &z, float &e, float feed_rate, uint8_t &extruder);
void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder);
// Set position. Used for G92 instructions.
void plan_set_position(const float &x, const float &y, const float &z, const float &e);

View File

@ -129,6 +129,7 @@
//conversion routines, could need some overworking
char *ftostr51(const float &x);
char *ftostr52(const float &x);
char *ftostr31(const float &x);
char *ftostr3(const float &x);
@ -142,10 +143,8 @@
#define LCD_MESSAGE(x)
#define LCD_MESSAGEPGM(x)
FORCE_INLINE void lcd_status() {};
#endif
#ifndef ULTIPANEL
#define CLICKED false
#define CLICKED false
#define BLOCK ;
#endif
@ -160,4 +159,3 @@ char *itostr3(const int &xx);
char *itostr4(const int &xx);
char *ftostr51(const float &x);
#endif //ULTRALCD

View File

@ -12,7 +12,9 @@ extern volatile bool feedmultiplychanged;
extern volatile int extrudemultiply;
extern long position[4];
#ifdef SDSUPPORT
extern CardReader card;
#endif
//===========================================================================
//=============================public variables============================
@ -480,7 +482,11 @@ void MainMenu::showPrepare()
MENUITEM( lcdprintPGM(MSG_MAIN) , BLOCK;status=Main_Menu;beepshort(); ) ;
break;
case ItemP_autostart:
MENUITEM( lcdprintPGM(MSG_AUTOSTART) , BLOCK;card.lastnr=0;card.setroot();card.checkautostart(true);beepshort(); ) ;
MENUITEM( lcdprintPGM(MSG_AUTOSTART) , BLOCK;
#ifdef SDSUPPORT
card.lastnr=0;card.setroot();card.checkautostart(true);
#endif
beepshort(); ) ;
break;
case ItemP_disstep:
MENUITEM( lcdprintPGM(MSG_DISABLE_STEPPERS) , BLOCK;enquecommand("M84");beepshort(); ) ;
@ -1629,7 +1635,7 @@ void MainMenu::showControlMotion()
if(linechanging)
{
if(encoderpos<5) encoderpos=5;
if(encoderpos>99999) encoderpos=99999;
if(encoderpos>32000) encoderpos=32000;//TODO: This is a problem, encoderpos is 16bit, but steps_per_unit for e can be wel over 800
lcd.setCursor(11,line);lcd.print(ftostr52(encoderpos/100.0));
}
@ -1957,7 +1963,7 @@ void MainMenu::showMainMenu()
#endif
if(tune)
{
if(!(movesplanned() ||card.sdprinting))
if(!(movesplanned() || IS_SD_PRINTING))
{
force_lcd_update=true;
tune=false;
@ -1965,7 +1971,7 @@ void MainMenu::showMainMenu()
}
else
{
if(movesplanned() ||card.sdprinting)
if(movesplanned() || IS_SD_PRINTING)
{
force_lcd_update=true;
tune=true;