Das sind Teile, die ich im nachhinein eingefügt habe // vibration_ready = appMessage->data[0]; vibration_ready = 1; //gleichwertig wie das Empfangen von Schnrachsignalen if(vibration_ready == 1) { ConfigPwm(); // init PWM // SetPWMoff(); // set PWM = 255 // VibrationMode(); asm("NOP"); automatic(); // SetDutyCycle(); HAL_StartAppTimer(&fiveSecTimer); } else SetPWMoff(); Das ist der Taster, den ich eigentlich testen will, aber wenn ich es drücke passiert nichts, obwohl ich nur 2 Variablen eingefügt habe, die vom ursprünglichen Programm abweichen. static void IrqHandler_7(void) { // HAL_StartAppTimer(&oneSecTimer); uint32_t test = 1; geschnarcht = 1; APS_DataIndication(test); vibration_ready = 1; HAL_UnregisterIrq(IRQ_7); //strengthCounter++; // VibrationMode(); HAL_StartAppTimer(&debounce_7); } und das ist mein Algorithmus static void differenz(void) { get_zeit[i++] = minute[j]; if(i>0) { if((get_zeit[i]-get_zeit[i-1])<= 1) { schnarchanzahl_1++; // geschnarcht = 0; } if(level2_war_aktiv == 1) schnarchanzahl_1 = 0; if((get_zeit[i]-get_zeit[i-1])<=2) { schnarchanzahl_2++; // geschnarcht = 0; } if(level3_war_aktiv == 1) schnarchanzahl_2 = 0; if((get_zeit[i]-get_zeit[i-1])<=3) { schnarchanzahl_3++; // geschnarcht = 0; } if(level4_war_aktiv == 1) schnarchanzahl_3 = 0; } else { schnarchanzahl_1 = 0; schnarchanzahl_2 = 0; schnarchanzahl_3 = 0; } } /******************************************************************** Description: automatic Parameters: none Returns: none *******************************************************************/ static void automatic(void) { speicher = interrupt; differenz(); if(geschnarcht == 1) { GPIO_3_set(); duty = 150; vibration_ready = 1; SetDutyCycle(); HAL_StartAppTimer(&tenSecTimer); geschnarcht = 0; } if((schnarchanzahl_1 >= 2)&&(geschnarcht == 0)) { GPIO_4_set(); duty = 100; vibration_ready = 1; SetDutyCycle(); HAL_StartAppTimer(&tenSecTimer); level2_war_aktiv = 1; } if((schnarchanzahl_2 >= 3) &&(level2_war_aktiv == 1)) { GPIO_5_set(); duty = 50; vibration_ready = 1; SetDutyCycle(); HAL_StartAppTimer(&tenSecTimer); level3_war_aktiv = 1; } if((schnarchanzahl_3 >= 5) &&(level3_war_aktiv == 1)) { GPIO_6_set(); duty = 0; vibration_ready = 1; SetDutyCycle(); HAL_StartAppTimer(&tenSecTimer); level2_war_aktiv = 0; level3_war_aktiv = 0; level4_war_aktiv = 1; } else { GPIO_3_clr(); GPIO_4_clr(); GPIO_5_clr(); GPIO_6_clr(); } }