removed inline-keywords because gcc ignores them anyway
This commit is contained in:
parent
b8eee5ac9a
commit
124bc363bd
2
gcode.c
2
gcode.c
@ -98,7 +98,7 @@ void gc_init() {
|
|||||||
gc.absolute_mode = TRUE;
|
gc.absolute_mode = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline float to_millimeters(double value) {
|
float to_millimeters(double value) {
|
||||||
return(gc.inches_mode ? (value * MM_PER_INCH) : value);
|
return(gc.inches_mode ? (value * MM_PER_INCH) : value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
planner.c
12
planner.c
@ -79,7 +79,7 @@ static uint8_t acceleration_manager_enabled; // Acceleration management active
|
|||||||
|
|
||||||
// Calculates the distance (not time) it takes to accelerate from initial_rate to target_rate using the
|
// Calculates the distance (not time) it takes to accelerate from initial_rate to target_rate using the
|
||||||
// given acceleration:
|
// given acceleration:
|
||||||
inline double estimate_acceleration_distance(double initial_rate, double target_rate, double acceleration) {
|
double estimate_acceleration_distance(double initial_rate, double target_rate, double acceleration) {
|
||||||
return(
|
return(
|
||||||
(target_rate*target_rate-initial_rate*initial_rate)/
|
(target_rate*target_rate-initial_rate*initial_rate)/
|
||||||
(2L*acceleration)
|
(2L*acceleration)
|
||||||
@ -101,7 +101,7 @@ inline double estimate_acceleration_distance(double initial_rate, double target_
|
|||||||
| |
|
| |
|
||||||
intersection_distance distance */
|
intersection_distance distance */
|
||||||
|
|
||||||
inline double intersection_distance(double initial_rate, double final_rate, double acceleration, double distance) {
|
double intersection_distance(double initial_rate, double final_rate, double acceleration, double distance) {
|
||||||
return(
|
return(
|
||||||
(2*acceleration*distance-initial_rate*initial_rate+final_rate*final_rate)/
|
(2*acceleration*distance-initial_rate*initial_rate+final_rate*final_rate)/
|
||||||
(4*acceleration)
|
(4*acceleration)
|
||||||
@ -148,7 +148,7 @@ void calculate_trapezoid_for_block(block_t *block, double entry_factor, double e
|
|||||||
|
|
||||||
// Calculates the maximum allowable speed at this point when you must be able to reach target_velocity using the
|
// Calculates the maximum allowable speed at this point when you must be able to reach target_velocity using the
|
||||||
// acceleration within the allotted distance.
|
// acceleration within the allotted distance.
|
||||||
inline double max_allowable_speed(double acceleration, double target_velocity, double distance) {
|
double max_allowable_speed(double acceleration, double target_velocity, double distance) {
|
||||||
return(
|
return(
|
||||||
sqrt(target_velocity*target_velocity-2*acceleration*60*60*distance)
|
sqrt(target_velocity*target_velocity-2*acceleration*60*60*distance)
|
||||||
);
|
);
|
||||||
@ -157,7 +157,7 @@ inline double max_allowable_speed(double acceleration, double target_velocity, d
|
|||||||
// "Junction jerk" in this context is the immediate change in speed at the junction of two blocks.
|
// "Junction jerk" in this context is the immediate change in speed at the junction of two blocks.
|
||||||
// This method will calculate the junction jerk as the euclidean distance between the nominal
|
// This method will calculate the junction jerk as the euclidean distance between the nominal
|
||||||
// velocities of the respective blocks.
|
// velocities of the respective blocks.
|
||||||
inline double junction_jerk(block_t *before, block_t *after) {
|
double junction_jerk(block_t *before, block_t *after) {
|
||||||
return(sqrt(
|
return(sqrt(
|
||||||
pow(before->speed_x-after->speed_x, 2)+
|
pow(before->speed_x-after->speed_x, 2)+
|
||||||
pow(before->speed_y-after->speed_y, 2)+
|
pow(before->speed_y-after->speed_y, 2)+
|
||||||
@ -322,13 +322,13 @@ int plan_is_acceleration_manager_enabled() {
|
|||||||
return(acceleration_manager_enabled);
|
return(acceleration_manager_enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void plan_discard_current_block() {
|
void plan_discard_current_block() {
|
||||||
if (block_buffer_head != block_buffer_tail) {
|
if (block_buffer_head != block_buffer_tail) {
|
||||||
block_buffer_tail = (block_buffer_tail + 1) % BLOCK_BUFFER_SIZE;
|
block_buffer_tail = (block_buffer_tail + 1) % BLOCK_BUFFER_SIZE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline block_t *plan_get_current_block() {
|
block_t *plan_get_current_block() {
|
||||||
if (block_buffer_head == block_buffer_tail) { return(NULL); }
|
if (block_buffer_head == block_buffer_tail) { return(NULL); }
|
||||||
return(&block_buffer[block_buffer_tail]);
|
return(&block_buffer[block_buffer_tail]);
|
||||||
}
|
}
|
||||||
|
@ -62,10 +62,10 @@ void plan_buffer_line(double x, double y, double z, double feed_rate, int invert
|
|||||||
|
|
||||||
// Called when the current block is no longer needed. Discards the block and makes the memory
|
// Called when the current block is no longer needed. Discards the block and makes the memory
|
||||||
// availible for new blocks.
|
// availible for new blocks.
|
||||||
inline void plan_discard_current_block();
|
void plan_discard_current_block();
|
||||||
|
|
||||||
// Gets the current block. Returns NULL if buffer empty
|
// Gets the current block. Returns NULL if buffer empty
|
||||||
inline block_t *plan_get_current_block();
|
block_t *plan_get_current_block();
|
||||||
|
|
||||||
// Enables or disables acceleration-management for upcoming blocks
|
// Enables or disables acceleration-management for upcoming blocks
|
||||||
void plan_set_acceleration_manager_enabled(int enabled);
|
void plan_set_acceleration_manager_enabled(int enabled);
|
||||||
|
@ -88,7 +88,7 @@ void st_wake_up() {
|
|||||||
|
|
||||||
// Initializes the trapezoid generator from the current block. Called whenever a new
|
// Initializes the trapezoid generator from the current block. Called whenever a new
|
||||||
// block begins.
|
// block begins.
|
||||||
inline void trapezoid_generator_reset() {
|
void trapezoid_generator_reset() {
|
||||||
trapezoid_adjusted_rate = current_block->initial_rate;
|
trapezoid_adjusted_rate = current_block->initial_rate;
|
||||||
trapezoid_tick_cycle_counter = 0; // Always start a new trapezoid with a full acceleration tick
|
trapezoid_tick_cycle_counter = 0; // Always start a new trapezoid with a full acceleration tick
|
||||||
set_step_events_per_minute(trapezoid_adjusted_rate);
|
set_step_events_per_minute(trapezoid_adjusted_rate);
|
||||||
@ -97,7 +97,7 @@ inline void trapezoid_generator_reset() {
|
|||||||
// This is called ACCELERATION_TICKS_PER_SECOND times per second by the step_event
|
// 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
|
// 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.
|
// current_block stays untouched by outside handlers for the duration of this function call.
|
||||||
inline void trapezoid_generator_tick() {
|
void trapezoid_generator_tick() {
|
||||||
if (current_block) {
|
if (current_block) {
|
||||||
if (step_events_completed < current_block->accelerate_until) {
|
if (step_events_completed < current_block->accelerate_until) {
|
||||||
trapezoid_adjusted_rate += current_block->rate_delta;
|
trapezoid_adjusted_rate += current_block->rate_delta;
|
||||||
|
Loading…
Reference in New Issue
Block a user