[PicForth] Re: Another gotcha- @ and ! can break interrupts

Alex Holden alex at linuxhacker.org
Mon Nov 15 01:27:07 CET 2004


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


More information about the PicForth mailing list