Re: Re: Another gotcha- @ and ! can break interrupts
Alex Holden <[email protected]> Mon, 15 Nov 2004 00:27:07 +0000
| Newsgroups | gmane.comp.lang.forth.picforth |
|---|---|
| Message-ID | <[email protected]> |
Samuel Tardieu wrote: > Could you try the following picisr.fs version and tell me whether this > fixes your problem? It allows you to nest as many as 256 > suspend-interrupts/restore-interrupts. The drawback are: Great, that fixed it :) > - the code is a little longer (not much) than before for initial > (non-nested) calls (and faster for nested calls) > - it takes one more byte in memory I understand. Personally I think it's worth it to be able to put suspend/restore-interrupts around critical sections without worrying that any of the words you use within the section might also suspend interrupts and in doing so kill interrupts entirely. I suppose if one was particularly short on RAM it wouldn't be too difficult to get rid of the extra variable at the expense of a few extra instructions by storing the previous gie state in the msb of the depth counter. -- ------------ Alex Holden - http://www.linuxhacker.org ------------ If it doesn't work, you're not hitting it with a big enough hammer