made most internal function static to allow gcc to inline them
This commit is contained in:
10
stepper.c
10
stepper.c
@@ -80,7 +80,7 @@ static uint32_t trapezoid_adjusted_rate; // The current rate of step_events
|
||||
// The slope of acceleration is always +/- block->rate_delta and is applied at a constant rate by trapezoid_generator_tick()
|
||||
// that is called ACCELERATION_TICKS_PER_SECOND times per second.
|
||||
|
||||
void set_step_events_per_minute(uint32_t steps_per_minute);
|
||||
static void set_step_events_per_minute(uint32_t steps_per_minute);
|
||||
|
||||
void st_wake_up() {
|
||||
ENABLE_STEPPER_DRIVER_INTERRUPT();
|
||||
@@ -88,7 +88,7 @@ void st_wake_up() {
|
||||
|
||||
// Initializes the trapezoid generator from the current block. Called whenever a new
|
||||
// block begins.
|
||||
void trapezoid_generator_reset() {
|
||||
static void trapezoid_generator_reset() {
|
||||
trapezoid_adjusted_rate = current_block->initial_rate;
|
||||
trapezoid_tick_cycle_counter = 0; // Always start a new trapezoid with a full acceleration tick
|
||||
set_step_events_per_minute(trapezoid_adjusted_rate);
|
||||
@@ -97,7 +97,7 @@ void trapezoid_generator_reset() {
|
||||
// This is called ACCELERATION_TICKS_PER_SECOND times per second by the step_event
|
||||
// interrupt. It can be assumed that the trapezoid-generator-parameters and the
|
||||
// current_block stays untouched by outside handlers for the duration of this function call.
|
||||
void trapezoid_generator_tick() {
|
||||
static void trapezoid_generator_tick() {
|
||||
if (current_block) {
|
||||
if (step_events_completed < current_block->accelerate_until) {
|
||||
trapezoid_adjusted_rate += current_block->rate_delta;
|
||||
@@ -248,7 +248,7 @@ void st_synchronize()
|
||||
|
||||
// Configures the prescaler and ceiling of timer 1 to produce the given rate as accurately as possible.
|
||||
// Returns the actual number of cycles per interrupt
|
||||
uint32_t config_step_timer(uint32_t cycles)
|
||||
static uint32_t config_step_timer(uint32_t cycles)
|
||||
{
|
||||
uint16_t ceiling;
|
||||
uint16_t prescaler;
|
||||
@@ -286,7 +286,7 @@ uint32_t config_step_timer(uint32_t cycles)
|
||||
return(actual_cycles);
|
||||
}
|
||||
|
||||
void set_step_events_per_minute(uint32_t steps_per_minute) {
|
||||
static void set_step_events_per_minute(uint32_t steps_per_minute) {
|
||||
if (steps_per_minute < MINIMUM_STEPS_PER_MINUTE) { steps_per_minute = MINIMUM_STEPS_PER_MINUTE; }
|
||||
cycles_per_step_event = config_step_timer((TICKS_PER_MICROSECOND*1000000*60)/steps_per_minute);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user