Skip to content

Commit

Permalink
laser on/off names renamed to enable/disable
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Hechenberger committed Mar 20, 2012
1 parent 71c9d3e commit 89d164b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
16 changes: 8 additions & 8 deletions gcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
#define NEXT_ACTION_AIRGAS_DISABLE 6
#define NEXT_ACTION_AIR_ENABLE 7
#define NEXT_ACTION_GAS_ENABLE 8
#define NEXT_ACTION_LASER_ON 9
#define NEXT_ACTION_LASER_OFF 10
#define NEXT_ACTION_LASER_ENABLE 9
#define NEXT_ACTION_LASER_DISABLE 10

#define STATUS_OK 0
#define STATUS_BAD_NUMBER_FORMAT 1
Expand Down Expand Up @@ -235,8 +235,8 @@ uint8_t gcode_execute_line(char *line) {
case 7: next_action = NEXT_ACTION_AIR_ENABLE;break;
case 8: next_action = NEXT_ACTION_GAS_ENABLE;break;
case 9: next_action = NEXT_ACTION_AIRGAS_DISABLE;break;
case 140: next_action = NEXT_ACTION_LASER_ON;break;
case 141: next_action = NEXT_ACTION_LASER_OFF;break;
case 140: next_action = NEXT_ACTION_LASER_ENABLE;break;
case 141: next_action = NEXT_ACTION_LASER_DISABLE;break;
default: FAIL(STATUS_UNSUPPORTED_STATEMENT);
}
break;
Expand Down Expand Up @@ -367,11 +367,11 @@ uint8_t gcode_execute_line(char *line) {
case NEXT_ACTION_GAS_ENABLE:
planner_control_gas_enable();
break;
case NEXT_ACTION_LASER_ON:
planner_control_laser_on();
case NEXT_ACTION_LASER_ENABLE:
planner_control_laser_enable();
break;
case NEXT_ACTION_LASER_OFF:
planner_control_laser_off();
case NEXT_ACTION_LASER_DISABLE:
planner_control_laser_disable();
break;
}

Expand Down
8 changes: 4 additions & 4 deletions planner.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
#define TYPE_AIRGAS_DISABLE 1
#define TYPE_AIR_ENABLE 2
#define TYPE_GAS_ENABLE 3
#define TYPE_LASER_ON 4
#define TYPE_LASER_OFF 5
#define TYPE_LASER_ENABLE 4
#define TYPE_LASER_DISABLE 5

#define planner_control_airgas_disable() planner_command(TYPE_AIRGAS_DISABLE)
#define planner_control_air_enable() planner_command(TYPE_AIR_ENABLE)
#define planner_control_gas_enable() planner_command(TYPE_GAS_ENABLE)
#define planner_control_laser_on() planner_command(TYPE_LASER_ON)
#define planner_control_laser_off() planner_command(TYPE_LASER_OFF)
#define planner_control_laser_enable() planner_command(TYPE_LASER_ENABLE)
#define planner_control_laser_disable() planner_command(TYPE_LASER_DISABLE)


// This struct is used when buffering the setup for each linear movement "nominal" values are as specified in
Expand Down
6 changes: 3 additions & 3 deletions sense_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ void control_init() {
TCCR0A |= (1 << WGM00); // set phase correct PWM mode, has half the freq of fast PWM
TCCR0B |= (1 << CS00); // prescaler to 1, PWMfreq = 16000/(2*256*1) = 31.25kH

//// laser on/off pin
//// laser enable/disable pin
LASER_DDR |= (1 << LASER_ENABLE_BIT); // set as output pin
control_laser(false);
control_laser_enable(false);

//// air and gas assist control
AIRGAS_DDR |= (1 << AIR_BIT); // set as output pin
Expand All @@ -65,7 +65,7 @@ void control_init() {
}


void control_laser(bool enable) {
void control_laser_enable(bool enable) {
if (enable) {
LASER_PORT &= ~(1 << LASER_ENABLE_BIT);
} else {
Expand Down
2 changes: 1 addition & 1 deletion sense_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void sense_init();

void control_init();

void control_laser(bool enable);
void control_laser_enable(bool enable);
void control_laser_intensity(uint8_t intensity); //0-255 is 0-100%

void control_air(bool enable);
Expand Down
8 changes: 4 additions & 4 deletions stepper.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,14 @@ ISR(TIMER1_COMPA_vect) {
planner_discard_current_block();
break;

case TYPE_LASER_ON:
control_laser(true);
case TYPE_LASER_ENABLE:
control_laser_enable(true);
current_block = NULL;
planner_discard_current_block();
break;

case TYPE_LASER_OFF:
control_laser(false);
case TYPE_LASER_DISABLE:
control_laser_enable(false);
current_block = NULL;
planner_discard_current_block();
break;
Expand Down

0 comments on commit 89d164b

Please sign in to comment.