>
> >  - serial_hardware consumes some stack levels, I can't see why
>> Noticed that too.
>
>
> And I noticed other very bizarre things... I'll post some more.
>

When compiling 16f88_serial_hw_echo.jal, it gives "2 of 8" stack usage: init
call + calculate procedure. So far so good. Now, take this sample, derived
from echo one:


procedure isr() is
   pragma interrupt

    if serial_hw_read(char)
    then
        serial_hw_write(char)   -- that's the echo...
    end if
end procedure

forever loop
end loop

(see attachment, dummy_isr.jal)

I just put the echo logic in an ISR. This is not a functional code, just to
test compilation. Now compile it, and it gives "5 of 8" stack usage ! Where
it should give "3 of 8" (+1 for ISR) right ?

More, the serial_hw_write looks like this:


procedure serial_hw_write(byte in data) is
   -- wait until TXREG is empty
   while ! PIR1_TXIF loop end loop
   -- then put new byte in TXREG (prepare for transmission)
   TXREG = data
end procedure


Now, comment "TXREG = data" in the lib (or the "while" line), and compile
the contrived ISR echo sample... Core dumped !!! And it does not core dumps
on original sample. serial_hw_read is ok, you can comment all the body's
function, it just compiles ok.

Bizarre, very bizarre. Maybe some ninja or guru could help. I know all those
aren't real tests, this is not functional code, but I think you'll agree
there's something nasty behind this, behind serial_hw_write...


Cheers,
Seb
-- 
Sébastien Lelong
http://www.sirloon.net
http://sirbot.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Attachment: dummy_isr.jal
Description: Binary data

Reply via email to