From 5a85471ca567ad46f08fcd5a3cd78396d68cf86a Mon Sep 17 00:00:00 2001 From: Eggert Jung Date: Mon, 4 Apr 2022 15:22:33 +0200 Subject: [PATCH] dont start moving if already homed --- taenzer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/taenzer.c b/taenzer.c index a404f12..65b7909 100644 --- a/taenzer.c +++ b/taenzer.c @@ -22,15 +22,15 @@ void send_info(void); void do_taenzer(){ /* Homing */ - if(!taenzer_state.homed){ - set_Output(MOTOR_TAENZER_DIR, 1); // direction: up - TCCR4B |= _BV(CS41); //TURN ON - } if(read_Input(IN_TAENZER_HOME, LEVEL)){ TCCR4B &= ~_BV(CS41); //TURN OFF taenzer_state.homed = 1; taenzer_state.pos = 0; } + if(!taenzer_state.homed && notaus_state == POWER_ON){ + set_Output(MOTOR_TAENZER_DIR, 1); // direction: up + TCCR4B |= _BV(CS41); //TURN ON + } if (read_Input(BTN_KRAFT_PLUS, RISING)) { taenzer_state.force_setpoint += 1000;