Hello everyone,
I am trying to implement the button /timer interrupt handler function
Running Functionalities,
-
button(1) is pressed for 3 sec and button handler interrupt executes the Timer 3sec_handler fucntion where inside the timer handler am calling the PWM_init(); so pwm pulses are getting generated
-
button(1) is pressed for 5 sec and then button handler interrupt executes the Timer 5sec_handler fucntion where inside the timer 5sec handler am calling the PWM_uinit(); so pwm pulses are getting stopped
function (1) is executing very well but the real problem is when i pressing the button for 5 sec then the timer _3sec handler function also getting executed and reinitialize pwm_init () while timer crossing the 3sec PWM pulses are again generated and sooner timer reaches the 5sec stops the PWM
i wanted to make pwm pulses when i press the button for 3 sec and stops the pwm pulses pressing the buton for 5sec without regenerating pwm pulses so could anyone suggest me how to overcome this issue and suggest me what are best possible logics to implement the proper button and timer handler interrupt to start and stop pwm pulses
Note. same button is used for both functionalities but if i use two buttons then they are worjing very well but trying to use only one button for both functions any ideas or suggestions would be really helpful for me
Thank you