Hi Vasile,

I tried that and tried several other things. Thanks for the suggestion.

It must be a compiler issue since I have a working sample program for the 
ina3221 library and if I remove everything from this working program after the 
init (so remove the  main program), the assert happens.

Normally I would reduce the program to the minium to reproduce the issue but 
since I need to include the ina3221 library that is not that easy.

I leave it for now but if somebody runs into this issue let me know.

And for Bill. I did some small corrections in the ina3221 library but it the 
impact is minimal. For negative values that uses two complement, you just apply 
the same two complement for the reverse action. I did it a bit differently (and 
with some overhead). Will upload it to Jallib today including an updated sample 
program that shows the use of alerts.

Kind regards,

Rob

________________________________
Van: [email protected] <[email protected]> namens vsurducan 
<[email protected]>
Verzonden: vrijdag 5 september 2025 20:31
Aan: [email protected] <[email protected]>
Onderwerp: Re: [jallib] Unexplainable compiler issue

Hi Rob, if you remove the library I presume the error will dissapear.
Can you isolate the initalisation in the library, take it out from the library 
and move it in the sample? Then without any library include see if the error 
still appears?

On Fri, Sep 5, 2025, 18:28 [email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>> wrote:
Hi all,

I have a very strange problem. I made sample programs for the ina3221 library 
and they all work well.

Now I want to make a special test program for a video so I re-used some code 
from the sample program but now the compiler generates an assert. It happens 
when I call the init routine of the ina3221 library but there is not much code 
in there. Even if I almost completely remove all code from the sample program I 
get this compiler error.

jal jalv25r9 (compiled Jan 12 2025)
generating p-code
3364 tokens, 192031 chars; 4350 lines; 5 files
generating PIC code pass 1
Assertion failed!
Program: c:\jallib\compiler\jalv2_64.exe
File: pic_op.c, Line 4470
Expression: !pic_value_is_w(dst)

And the program is only this:
-- Define the IIC pins and initiaize the pin direction.
alias i2c_scl is pin_C0 -- Pin 10 for 14 pin DIP
-- alias pin_scl_direction is pin_C0_direction. Note: Not needed for this PIC.
alias i2c_sda is pin_C1 -- Pin 9 for 14 pin DIP.
-- alias pin_sda_direction is pin_C1_direction. Note: Not needed for this PIC.
const word _i2c_bus_speed = 4 -- 400 kHz.
const bit  _i2c_level = TRUE  -- i2c levels (not SMB)
const word I2C_HARDWARE_TIMEOUT = 10_000 -- At least 10 ms to prevent hang-up.
include i2c_hardware
i2c_initialize()

-- Now include the ina3221 library and initialize.
-- Remove the comment below if you want to use floats instead of word/dword.
--const INA3221_USE_FLOAT = TRUE
include ina3221
ina3221_init()



Any suggestions?

Thanks.

Kind regards,

Rob


--
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion visit 
https://groups.google.com/d/msgid/jallib/629164e4-307c-4def-a2fc-42fd894b2fe9n%40googlegroups.com<https://groups.google.com/d/msgid/jallib/629164e4-307c-4def-a2fc-42fd894b2fe9n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion visit 
https://groups.google.com/d/msgid/jallib/CAM%2Bj4quDMkCJz7Pc%3DJCEg9o5N9Y7wMQAneoqEeXP6LUS9FB-hA%40mail.gmail.com<https://groups.google.com/d/msgid/jallib/CAM%2Bj4quDMkCJz7Pc%3DJCEg9o5N9Y7wMQAneoqEeXP6LUS9FB-hA%40mail.gmail.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/jallib/AM7PR02MB6098823AE0D5E360C64C6F71E602A%40AM7PR02MB6098.eurprd02.prod.outlook.com.

Reply via email to