Hi Rob, Thank you for your reactivity! I will check your solution this week-end, but it seems to be OK.
(Btw: I hope you did not think I was blaming anyone.... my first message may sound harsh, but it was not my intent.... my apologies if you felt hurt....) Enjoy your week-end, Kind regards, David Le vendredi 29 mars 2024 à 07:22:10 UTC+1, Rob CJ a écrit : > Hi David, > > Found a workaround for the library without breaking anything. Should work > and will upload it this weekend. > > Solution is as follows: > > if defined(i2c_scl_direction) then > -- User defined i2c pins. > i2c_scl_direction = input > i2c_sda_direction = input > else > -- Default i2c pins from device file. > pin_SCL_direction = input > pin_SDA_direction = input > end if > > Kind regards, > > Rob > > ------------------------------ > *Van:* [email protected] <[email protected]> namens Rob CJ < > [email protected]> > *Verzonden:* donderdag 28 maart 2024 18:51 > *Aan:* [email protected] <[email protected]> > *Onderwerp:* Re: [jallib] i2c_hardware.jal incompatible with pic16f1778 > family ? > > Hi David, > > I had never noticed it but you are right. I am not sure if PPS existed > when that library was created. > > There is another thing and that is that library violates with the style > guide rules. The style guide states that the user should set the pin > direction, not the library (I did not know this when I started with JAL so > some of my first libraries are not compliant with the style guide too). > > When the change that you mentioned would be implemented, sample files will > break and the main program should define the aliases. But when taking the > style guide into account then pin_SCL_direction and pin_SDA_direction > should be removed completely from the library since the main program would > set the correct pins to input and so your program would work since you > define which pins should be set to input. > > So I could make the change and update all sample files accordingly but it > will result in compile errors for JAL users that use this updated library. > > And since this library can be 'swapped' with the i2c_software libarary, > that one also needs the change. > > So I am interested in the opinion of the JAL users about this > modification. To do or not to do, that is the question. > > Thanks. > > Kind regards, > > Rob > > > > > > ------------------------------ > *Van:* [email protected] <[email protected]> namens David VB < > [email protected]> > *Verzonden:* woensdag 27 maart 2024 22:57 > *Aan:* jallib <[email protected]> > *Onderwerp:* [jallib] i2c_hardware.jal incompatible with pic16f1778 > family ? > > Hi, > > Just found something.... (Jallib 1.8 - Official release, no bees) > > In the header of i2c_hardware, it is mentionned that: > -- Define i2c pins like: > -- alias i2c_scl is pin_c3 -- optional > *-- alias i2c_scl_direction is pin_c3_direction* > -- alias i2c_sda is pin_c4 -- optional > *-- alias i2c_sda_direction is pin_c4_direction* > > Later, in the code, procedure i2c_initialize, we use, instead: > > * pin_SCL_direction = input pin_SDA_direction = input* > > The problem is that, in the device file we have, only for SCL the > following definition > *alias pin_SCL_direction is pin_C3_direction* > > In my application, I use the PPS to reassign SCL to RB6 > > So, I cannot re-assign pin_SCL_direction to pin_B6_direction. > > No big deal: I copied a local version of the library in my project and > changed the i2c_initialize procedure with: > > * i2c_SCL_direction = input i2c_SDA_direction = input* > > I do not know if this has already be changed for 1.9, but I suggest > something be made..... > > (Just my 2 cents) > > Kind regards, > > David > > -- > 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 on the web visit > https://groups.google.com/d/msgid/jallib/f465c30e-73ec-4ada-81f2-f8b41db093c4n%40googlegroups.com > > <https://groups.google.com/d/msgid/jallib/f465c30e-73ec-4ada-81f2-f8b41db093c4n%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 on the web visit > https://groups.google.com/d/msgid/jallib/GVXP195MB1637EEBB7BED481F975B2E91E63B2%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM > > <https://groups.google.com/d/msgid/jallib/GVXP195MB1637EEBB7BED481F975B2E91E63B2%40GVXP195MB1637.EURP195.PROD.OUTLOOK.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 on the web visit https://groups.google.com/d/msgid/jallib/ab25f644-a032-4d91-bfc8-50139695905dn%40googlegroups.com.
