E
Eirik Midttun
I have seen quite a few times that C programs contain a file named
isr.c or files named a_isr.c, b_isr.c where a and b are hardware that
generate interrupts. Obviously these files contain code to be executed
on interrupts and is most common in embedded application.
My own preference is a different one. If I write a scheduler that uses
a timer, I would keep the timer interrupt code together with the code
that does the initialisation, adds tasks, and so on. I see no reason
for putting this function in one separate file or in file with all the
other ISRs.
Left a side the discussion of what is best practice, what is the idea
behind this? Why do some programmers organise the code in this way?
Regards,
Eirik
isr.c or files named a_isr.c, b_isr.c where a and b are hardware that
generate interrupts. Obviously these files contain code to be executed
on interrupts and is most common in embedded application.
My own preference is a different one. If I write a scheduler that uses
a timer, I would keep the timer interrupt code together with the code
that does the initialisation, adds tasks, and so on. I see no reason
for putting this function in one separate file or in file with all the
other ISRs.
Left a side the discussion of what is best practice, what is the idea
behind this? Why do some programmers organise the code in this way?
Regards,
Eirik