made local variables static

pull/1/head
Simen Svale Skogsrud 2011-01-25 23:33:19 +01:00
rodzic d8e2778b7b
commit 35064b53e9
4 zmienionych plików z 17 dodań i 16 usunięć

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

@ -39,21 +39,21 @@ void set_step_events_per_minute(uint32_t steps_per_minute);
#define MINIMUM_STEPS_PER_MINUTE 1200
#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
uint8_t out_bits; // The next stepping-bits to be output
int32_t counter_x,
counter_y,
counter_z; // counter variables for the bresenham line tracer
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.
static uint8_t out_bits; // The next stepping-bits to be output
static int32_t counter_x, // Counter variables for the bresenham line tracer
counter_y,
counter_z;
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.
// Variables used by the trapezoid generation
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
// 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 cycles_per_step_event; // The number of machine cycles between each step event
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
static uint32_t trapezoid_adjusted_rate; // The current rate of step_events according to the trapezoid generator
// Two trapezoids:
// __________________________

Wyświetl plik

@ -60,10 +60,11 @@
#include "config.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_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