lowercased boolean constants

This commit is contained in:
Simen Svale Skogsrud 2011-02-18 23:04:12 +01:00
parent 9876e14f0b
commit 6edbbe322c
6 changed files with 23 additions and 23 deletions

24
gcode.c
View File

@ -90,7 +90,7 @@ void gc_init() {
gc.feed_rate = settings.default_feed_rate/60; gc.feed_rate = settings.default_feed_rate/60;
gc.seek_rate = settings.default_seek_rate/60; gc.seek_rate = settings.default_seek_rate/60;
select_plane(X_AXIS, Y_AXIS, Z_AXIS); select_plane(X_AXIS, Y_AXIS, Z_AXIS);
gc.absolute_mode = TRUE; gc.absolute_mode = true;
} }
float to_millimeters(double value) { float to_millimeters(double value) {
@ -122,9 +122,9 @@ uint8_t gc_execute_line(char *line) {
double value; double value;
double unit_converted_value; double unit_converted_value;
double inverse_feed_rate = -1; // negative inverse_feed_rate means no inverse_feed_rate specified double inverse_feed_rate = -1; // negative inverse_feed_rate means no inverse_feed_rate specified
int radius_mode = FALSE; int radius_mode = false;
uint8_t absolute_override = FALSE; /* 1 = absolute motion for this block only {G53} */ uint8_t absolute_override = false; /* 1 = absolute motion for this block only {G53} */
uint8_t next_action = NEXT_ACTION_DEFAULT; /* The action that will be taken by the parsed line */ uint8_t next_action = NEXT_ACTION_DEFAULT; /* The action that will be taken by the parsed line */
double target[3], offset[3]; double target[3], offset[3];
@ -155,15 +155,15 @@ uint8_t gc_execute_line(char *line) {
case 17: select_plane(X_AXIS, Y_AXIS, Z_AXIS); break; case 17: select_plane(X_AXIS, Y_AXIS, Z_AXIS); break;
case 18: select_plane(X_AXIS, Z_AXIS, Y_AXIS); break; case 18: select_plane(X_AXIS, Z_AXIS, Y_AXIS); break;
case 19: select_plane(Y_AXIS, Z_AXIS, X_AXIS); break; case 19: select_plane(Y_AXIS, Z_AXIS, X_AXIS); break;
case 20: gc.inches_mode = TRUE; break; case 20: gc.inches_mode = true; break;
case 21: gc.inches_mode = FALSE; break; case 21: gc.inches_mode = false; break;
case 28: case 30: next_action = NEXT_ACTION_GO_HOME; break; case 28: case 30: next_action = NEXT_ACTION_GO_HOME; break;
case 53: absolute_override = TRUE; break; case 53: absolute_override = true; break;
case 80: gc.motion_mode = MOTION_MODE_CANCEL; break; case 80: gc.motion_mode = MOTION_MODE_CANCEL; break;
case 90: gc.absolute_mode = TRUE; break; case 90: gc.absolute_mode = true; break;
case 91: gc.absolute_mode = FALSE; break; case 91: gc.absolute_mode = false; break;
case 93: gc.inverse_feed_rate_mode = TRUE; break; case 93: gc.inverse_feed_rate_mode = true; break;
case 94: gc.inverse_feed_rate_mode = FALSE; break; case 94: gc.inverse_feed_rate_mode = false; break;
default: FAIL(STATUS_UNSUPPORTED_STATEMENT); default: FAIL(STATUS_UNSUPPORTED_STATEMENT);
} }
break; break;
@ -208,7 +208,7 @@ uint8_t gc_execute_line(char *line) {
break; break;
case 'I': case 'J': case 'K': offset[letter-'I'] = unit_converted_value; break; case 'I': case 'J': case 'K': offset[letter-'I'] = unit_converted_value; break;
case 'P': p = value; break; case 'P': p = value; break;
case 'R': r = unit_converted_value; radius_mode = TRUE; break; case 'R': r = unit_converted_value; radius_mode = true; break;
case 'S': gc.spindle_speed = value; break; case 'S': gc.spindle_speed = value; break;
case 'X': case 'Y': case 'Z': case 'X': case 'Y': case 'Z':
if (gc.absolute_mode || absolute_override) { if (gc.absolute_mode || absolute_override) {
@ -238,7 +238,7 @@ uint8_t gc_execute_line(char *line) {
switch (gc.motion_mode) { switch (gc.motion_mode) {
case MOTION_MODE_CANCEL: break; case MOTION_MODE_CANCEL: break;
case MOTION_MODE_SEEK: case MOTION_MODE_SEEK:
mc_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], gc.seek_rate, FALSE); mc_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], gc.seek_rate, false);
break; break;
case MOTION_MODE_LINEAR: case MOTION_MODE_LINEAR:
mc_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], mc_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS],

View File

@ -48,7 +48,7 @@ void mc_arc(double theta, double angular_travel, double radius, double linear_tr
int axis_linear, double feed_rate, int invert_feed_rate, double *position) int axis_linear, double feed_rate, int invert_feed_rate, double *position)
{ {
int acceleration_manager_was_enabled = plan_is_acceleration_manager_enabled(); int acceleration_manager_was_enabled = plan_is_acceleration_manager_enabled();
plan_set_acceleration_manager_enabled(FALSE); // disable acceleration management for the duration of the arc plan_set_acceleration_manager_enabled(false); // disable acceleration management for the duration of the arc
double millimeters_of_travel = hypot(angular_travel*radius, labs(linear_travel)); double millimeters_of_travel = hypot(angular_travel*radius, labs(linear_travel));
if (millimeters_of_travel == 0.0) { return; } if (millimeters_of_travel == 0.0) { return; }
uint16_t segments = ceil(millimeters_of_travel/settings.mm_per_arc_segment); uint16_t segments = ceil(millimeters_of_travel/settings.mm_per_arc_segment);

View File

@ -23,8 +23,8 @@
#include <string.h> #include <string.h>
#include <stdint.h> #include <stdint.h>
#define FALSE 0 #define false 0
#define TRUE 1 #define true 1
#define X_AXIS 0 #define X_AXIS 0
#define Y_AXIS 1 #define Y_AXIS 1

View File

@ -307,7 +307,7 @@ void planner_recalculate() {
void plan_init() { void plan_init() {
block_buffer_head = 0; block_buffer_head = 0;
block_buffer_tail = 0; block_buffer_tail = 0;
plan_set_acceleration_manager_enabled(TRUE); plan_set_acceleration_manager_enabled(true);
clear_vector(position); clear_vector(position);
} }

View File

@ -116,19 +116,19 @@ int read_settings() {
if (version == SETTINGS_VERSION) { if (version == SETTINGS_VERSION) {
// Read settings-record and check checksum // Read settings-record and check checksum
if (!(memcpy_from_eeprom_with_checksum((char*)&settings, 1, sizeof(settings_t)))) { if (!(memcpy_from_eeprom_with_checksum((char*)&settings, 1, sizeof(settings_t)))) {
return(FALSE); return(false);
} }
} else if (version == 1) { } else if (version == 1) {
// Migrate from old settings version // Migrate from old settings version
if (!(memcpy_from_eeprom_with_checksum((char*)&settings, 1, sizeof(settings_v1_t)))) { if (!(memcpy_from_eeprom_with_checksum((char*)&settings, 1, sizeof(settings_v1_t)))) {
return(FALSE); return(false);
} }
settings.acceleration = DEFAULT_ACCELERATION; settings.acceleration = DEFAULT_ACCELERATION;
settings.max_jerk = DEFAULT_MAX_JERK; settings.max_jerk = DEFAULT_MAX_JERK;
} else { } else {
return(FALSE); return(false);
} }
return(TRUE); return(true);
} }
// A helper method to set settings from command line // A helper method to set settings from command line

View File

@ -55,7 +55,7 @@ static int32_t counter_x, // Counter variables for the bresenham line trac
counter_y, counter_y,
counter_z; counter_z;
static 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
static volatile int busy; // TRUE when SIG_OUTPUT_COMPARE1A is being serviced. Used to avoid retriggering that handler. static 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
static 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
@ -138,7 +138,7 @@ SIGNAL(TIMER1_COMPA_vect)
// exactly settings.pulse_microseconds microseconds. // exactly settings.pulse_microseconds microseconds.
TCNT2 = -(((settings.pulse_microseconds-2)*TICKS_PER_MICROSECOND)/8); TCNT2 = -(((settings.pulse_microseconds-2)*TICKS_PER_MICROSECOND)/8);
busy = TRUE; busy = true;
sei(); // Re enable interrupts (normally disabled while inside an interrupt handler) sei(); // Re enable interrupts (normally disabled while inside an interrupt handler)
// ((We re-enable interrupts in order for SIG_OVERFLOW2 to be able to be triggered // ((We re-enable interrupts in order for SIG_OVERFLOW2 to be able to be triggered
// at exactly the right time even if we occasionally spend a lot of time inside this handler.)) // at exactly the right time even if we occasionally spend a lot of time inside this handler.))
@ -195,7 +195,7 @@ SIGNAL(TIMER1_COMPA_vect)
trapezoid_generator_tick(); trapezoid_generator_tick();
} }
busy=FALSE; busy=false;
} }
// This interrupt is set up by SIG_OUTPUT_COMPARE1A when it sets the motor port bits. It resets // This interrupt is set up by SIG_OUTPUT_COMPARE1A when it sets the motor port bits. It resets