add direction change on layer finish
This commit is contained in:
18
spule.c
18
spule.c
@@ -82,6 +82,24 @@ void do_spule(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
ISR(TIMER1_OVF_vect) {
|
ISR(TIMER1_OVF_vect) {
|
||||||
|
if(ioHelperReadBit(outStates, MOTOR_TRANS_DIR)){
|
||||||
|
spule_trans_pos -= 1;
|
||||||
|
if(spule_trans_homed && spule_trans_pos <= 0){
|
||||||
|
//TCCR1B &= ~(_BV(CS11));
|
||||||
|
//TIMSK5 |= 1<<TOIE5;
|
||||||
|
printf("front stop\n");
|
||||||
|
set_Output(MOTOR_TRANS_DIR, 0); // direction: back
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
spule_trans_pos += 1;
|
||||||
|
if(spule_trans_pos >= 85000){
|
||||||
|
//TCCR1B &= ~(_BV(CS11));
|
||||||
|
//TIMSK5 |= 1<<TOIE5;
|
||||||
|
printf("end stop\n");
|
||||||
|
set_Output(MOTOR_TRANS_DIR, 1); // direction: front
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ISR(TIMER5_OVF_vect) {
|
ISR(TIMER5_OVF_vect) {
|
||||||
|
|||||||
Reference in New Issue
Block a user