10 years, 2 months ago.

Interrupt Service Routine in RTOS

Hi,

i'm using the RTOS with different Threads/Tasks. Now i want to use a ISR (a Counter should increase, if there's a falling edge on PIN PTA1 (FRDM KLZ-25)).

So I realized the ISR with "InterruptIn isr(PIN_IN)" and "isr.fall(isr_function);" Nothing works with the ISR implementation. Without, everything is working...

Someone could me help with this?

What is your isr_function? Does it happen to contain anything with printf or otherwise related to serial?

posted by Erik - 12 Feb 2014

As Erik asked, please share with us your routine, what do you mean nothing works? Does your ISR routine get invoked? Does it fail to complete?

posted by Martin Kojtal 12 Feb 2014

in thread_cam() .. . the camera is taking pictures... and in thread_servo().. the servo gets its new input in these threads i'm using printf - but i also already set these lines as comment.

code

int speedCounter=0;

void speedSensorRight(){
    speedCounter=1;
}

#define SpeedRight PTA1
InterruptIn speed_right(SpeedRight);


int main()
{  
    PC.baud(9600);
    TFC_TickerObj.attach_us(&TFC_TickerUpdate,2000);

    Thread thread_cam(TakePicture_Thread);
    Thread thread_servo(Servo_Thread);

    TFC_Init();

    while(true){
        speed_right.fall(speedSensorRight);
    }    
}

with nothing works, i mean... the servo/camera isn't reacting. if i doesnt use the isr, the servo reacts as normal.

posted by Andre Se 14 Feb 2014
Be the first to answer this question.