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] <[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].
> 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].
To view this discussion visit 
https://groups.google.com/d/msgid/jallib/CAM%2Bj4quDMkCJz7Pc%3DJCEg9o5N9Y7wMQAneoqEeXP6LUS9FB-hA%40mail.gmail.com.

Reply via email to