avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Handling interrupts in assembler - how?


From: Artur Lipowski
Subject: Re: [avr-gcc-list] Handling interrupts in assembler - how?
Date: Wed, 17 Sep 2003 12:47:23 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030914 Thunderbird/0.3a

Michal Vanka wrote:

...
and the DoSomething() is rather complicaed function, then
avr-gcc pushes all registers used in DoSomething()
in the caller SIGNAL() and we are loosing the MCU cycles.

Can it be somehow optimized?
If you want use C for DoSomething it is rather problematic because compiler assumes some freedom to use registers (see links posted by Julius). The easiest solution can be to use global register variables to pass parameters to DoSomething. The basic question is: is it really needed to perform all actions covered by DoSomething during ISR? Maybe only part of them have to be done in "hard" time and rest can be deffered. It is common technique to handle interrupt as fast as possible doing only neccessary things (like hardware interaction) and set some flag(s) to inform rest of the program that some event(s) had happened.

Regards,
--
Artur Lipowski



reply via email to

[Prev in Thread] Current Thread [Next in Thread]