made many possible variables static, so they cannot be used extern.

This commit is contained in:
Bernhard Kubicek 2011-11-06 19:36:29 +01:00
parent 1d171e9e52
commit 79d1bfb5c0
3 changed files with 39 additions and 31 deletions

View file

@ -65,6 +65,7 @@
#include "temperature.h" #include "temperature.h"
#include "ultralcd.h" #include "ultralcd.h"
//public variables
unsigned long minsegmenttime; unsigned long minsegmenttime;
float max_feedrate[4]; // set the max speeds float max_feedrate[4]; // set the max speeds
float axis_steps_per_unit[4]; float axis_steps_per_unit[4];
@ -76,14 +77,16 @@ float max_xy_jerk; //speed than can be stopped at once, if i understand correctl
float max_z_jerk; float max_z_jerk;
float mintravelfeedrate; float mintravelfeedrate;
unsigned long axis_steps_per_sqr_second[NUM_AXIS]; unsigned long axis_steps_per_sqr_second[NUM_AXIS];
// Manage heater variables. long position[4]; //rescaled from extern when axis_steps_per_unit are changed by gcode
//private variables
static block_t block_buffer[BLOCK_BUFFER_SIZE]; // A ring buffer for motion instfructions static block_t block_buffer[BLOCK_BUFFER_SIZE]; // A ring buffer for motion instfructions
static volatile unsigned char block_buffer_head; // Index of the next block to be pushed static volatile unsigned char block_buffer_head; // Index of the next block to be pushed
static volatile unsigned char block_buffer_tail; // Index of the block to process now static volatile unsigned char block_buffer_tail; // Index of the block to process now
// The current position of the tool in absolute steps // The current position of the tool in absolute steps
long position[4];
#define ONE_MINUTE_OF_MICROSECONDS 60000000.0 #define ONE_MINUTE_OF_MICROSECONDS 60000000.0

View file

@ -42,25 +42,29 @@
int target_raw[3] = {0, 0, 0}; int target_raw[3] = {0, 0, 0};
int current_raw[3] = {0, 0, 0}; int current_raw[3] = {0, 0, 0};
bool temp_meas_ready = false; static bool temp_meas_ready = false;
unsigned long previous_millis_heater, previous_millis_bed_heater; static unsigned long previous_millis_heater, previous_millis_bed_heater;
#ifdef PIDTEMP #ifdef PIDTEMP
float temp_iState = 0; //static cannot be external:
float temp_dState = 0; static float temp_iState = 0;
float pTerm; static float temp_dState = 0;
float iTerm; static float pTerm;
float dTerm; static float iTerm;
static float dTerm;
//int output; //int output;
float pid_error; static float pid_error;
float temp_iState_min; static float temp_iState_min;
float temp_iState_max; static float temp_iState_max;
float pid_setpoint = 0.0; static float pid_input;
float pid_input; static float pid_output;
float pid_output; static bool pid_reset;
bool pid_reset;
// probably used external
float HeaterPower; float HeaterPower;
float pid_setpoint = 0.0;
float Kp=DEFAULT_Kp; float Kp=DEFAULT_Kp;
float Ki=DEFAULT_Ki; float Ki=DEFAULT_Ki;
@ -69,29 +73,29 @@ unsigned long previous_millis_heater, previous_millis_bed_heater;
#endif //PIDTEMP #endif //PIDTEMP
#ifdef WATCHPERIOD #ifdef WATCHPERIOD
int watch_raw[3] = {-1000,-1000,-1000}; static int watch_raw[3] = {-1000,-1000,-1000};
unsigned long watchmillis = 0; static unsigned long watchmillis = 0;
#endif //WATCHPERIOD #endif //WATCHPERIOD
#ifdef HEATER_0_MINTEMP #ifdef HEATER_0_MINTEMP
int minttemp_0 = temp2analog(HEATER_0_MINTEMP); static int minttemp_0 = temp2analog(HEATER_0_MINTEMP);
#endif //MINTEMP #endif //MINTEMP
#ifdef HEATER_0_MAXTEMP #ifdef HEATER_0_MAXTEMP
int maxttemp_0 = temp2analog(HEATER_0_MAXTEMP); static int maxttemp_0 = temp2analog(HEATER_0_MAXTEMP);
#endif //MAXTEMP #endif //MAXTEMP
#ifdef HEATER_1_MINTEMP #ifdef HEATER_1_MINTEMP
int minttemp_1 = temp2analog(HEATER_1_MINTEMP); static int minttemp_1 = temp2analog(HEATER_1_MINTEMP);
#endif //MINTEMP #endif //MINTEMP
#ifdef HEATER_1_MAXTEMP #ifdef HEATER_1_MAXTEMP
int maxttemp_1 = temp2analog(HEATER_1_MAXTEMP); static int maxttemp_1 = temp2analog(HEATER_1_MAXTEMP);
#endif //MAXTEMP #endif //MAXTEMP
#ifdef BED_MINTEMP #ifdef BED_MINTEMP
int bed_minttemp = temp2analog(BED_MINTEMP); static int bed_minttemp = temp2analog(BED_MINTEMP);
#endif //BED_MINTEMP #endif //BED_MINTEMP
#ifdef BED_MAXTEMP #ifdef BED_MAXTEMP
int bed_maxttemp = temp2analog(BED_MAXTEMP); static int bed_maxttemp = temp2analog(BED_MAXTEMP);
#endif //BED_MAXTEMP #endif //BED_MAXTEMP
void manage_heater() void manage_heater()

View file

@ -3,14 +3,17 @@
extern volatile int feedmultiply; extern volatile int feedmultiply;
extern volatile bool feedmultiplychanged;
extern long position[4]; extern long position[4];
char messagetext[LCD_WIDTH]=""; static char messagetext[LCD_WIDTH]="";
#include <LiquidCrystal.h> #include <LiquidCrystal.h>
LiquidCrystal lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5,LCD_PINS_D6,LCD_PINS_D7); //RS,Enable,D4,D5,D6,D7 LiquidCrystal lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5,LCD_PINS_D6,LCD_PINS_D7); //RS,Enable,D4,D5,D6,D7
unsigned long previous_millis_lcd=0; static unsigned long previous_millis_lcd=0;
static long previous_millis_buttons=0;
inline int intround(const float &x){return int(0.5+x);} inline int intround(const float &x){return int(0.5+x);}
@ -18,9 +21,9 @@ volatile char buttons=0; //the last checked buttons in a bit array.
int encoderpos=0; int encoderpos=0;
short lastenc=0; short lastenc=0;
#ifdef NEWPANEL #ifdef NEWPANEL
long blocking=0; static long blocking=0;
#else #else
long blocking[8]={0,0,0,0,0,0,0,0}; static long blocking[8]={0,0,0,0,0,0,0,0};
#endif #endif
MainMenu menu; MainMenu menu;
@ -31,10 +34,9 @@ void lcd_status(const char* message)
inline void clear() inline void clear()
{ {
lcd.clear(); lcd.clear();
} }
long previous_millis_buttons=0;
void lcd_init() void lcd_init()
{ {
@ -228,7 +230,6 @@ MainMenu::MainMenu()
linechanging=false; linechanging=false;
} }
extern volatile bool feedmultiplychanged;
void MainMenu::showStatus() void MainMenu::showStatus()
{ {