made local variables static

This commit is contained in:
Simen Svale Skogsrud 2011-01-25 23:33:19 +01:00
parent d8e2778b7b
commit 35064b53e9
4 changed files with 17 additions and 16 deletions

View File

@ -89,7 +89,7 @@ typedef struct {
int16_t spindle_speed; /* RPM/100 */ int16_t spindle_speed; /* RPM/100 */
uint8_t plane_axis_0, plane_axis_1, plane_axis_2; // The axes of the selected plane uint8_t plane_axis_0, plane_axis_1, plane_axis_2; // The axes of the selected plane
} parser_state_t; } parser_state_t;
parser_state_t gc; static parser_state_t gc;
#define FAIL(status) gc.status_code = status; #define FAIL(status) gc.status_code = status;

View File

@ -28,8 +28,8 @@
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#define LINE_BUFFER_SIZE 50 #define LINE_BUFFER_SIZE 50
char line[LINE_BUFFER_SIZE]; static char line[LINE_BUFFER_SIZE];
uint8_t char_counter; static uint8_t char_counter;
void prompt() { void prompt() {
printPgmString(PSTR("ok\r\n")); printPgmString(PSTR("ok\r\n"));

View File

@ -39,21 +39,21 @@ void set_step_events_per_minute(uint32_t steps_per_minute);
#define MINIMUM_STEPS_PER_MINUTE 1200 #define MINIMUM_STEPS_PER_MINUTE 1200
#define CYCLES_PER_ACCELERATION_TICK ((TICKS_PER_MICROSECOND*1000000)/ACCELERATION_TICKS_PER_SECOND) #define CYCLES_PER_ACCELERATION_TICK ((TICKS_PER_MICROSECOND*1000000)/ACCELERATION_TICKS_PER_SECOND)
block_t *current_block; // A convenience pointer to the block currently being traced static block_t *current_block; // A convenience pointer to the block currently being traced
// Variables used by The Stepper Driver Interrupt // Variables used by The Stepper Driver Interrupt
uint8_t out_bits; // The next stepping-bits to be output static uint8_t out_bits; // The next stepping-bits to be output
int32_t counter_x, static int32_t counter_x, // Counter variables for the bresenham line tracer
counter_y, counter_y,
counter_z; // counter variables for the bresenham line tracer counter_z;
uint32_t step_events_completed; // The number of step events executed in the current block static uint32_t step_events_completed; // The number of step events executed in the current block
volatile int busy; // TRUE when SIG_OUTPUT_COMPARE1A is being serviced. Used to avoid retriggering that handler. volatile int busy; // TRUE when SIG_OUTPUT_COMPARE1A is being serviced. Used to avoid retriggering that handler.
// Variables used by the trapezoid generation // Variables used by the trapezoid generation
uint32_t cycles_per_step_event; // The number of machine cycles between each step event static uint32_t cycles_per_step_event; // The number of machine cycles between each step event
uint32_t trapezoid_tick_cycle_counter; // The cycles since last trapezoid_tick. Used to generate ticks at a steady static uint32_t trapezoid_tick_cycle_counter; // The cycles since last trapezoid_tick. Used to generate ticks at a steady
// pace without allocating a separate timer // pace without allocating a separate timer
uint32_t trapezoid_adjusted_rate; // The current rate of step_events according to the trapezoid generator static uint32_t trapezoid_adjusted_rate; // The current rate of step_events according to the trapezoid generator
// Two trapezoids: // Two trapezoids:
// __________________________ // __________________________

View File

@ -60,10 +60,11 @@
#include "config.h" #include "config.h"
#include "wiring_serial.h" #include "wiring_serial.h"
block_t block_buffer[BLOCK_BUFFER_SIZE]; // A ring buffer for motion instructions block_t block_buffer[BLOCK_BUFFER_SIZE]; // A ring buffer for motion instructions
volatile int block_buffer_head; // Index of the next block to be pushed volatile int block_buffer_head; // Index of the next block to be pushed
volatile int block_buffer_tail; // Index of the block to process now volatile int block_buffer_tail; // Index of the block to process now
uint8_t acceleration_management; // Acceleration management active?
static uint8_t acceleration_management; // Acceleration management active?
// NOTE: See bottom of this module for a comment outlining the reasoning behind the mathematics of the // NOTE: See bottom of this module for a comment outlining the reasoning behind the mathematics of the