Page 2 of 6

Posted: 14 Dec 2009 00:55
by janni
New version of almost all libs is available. I've changed all instances of FSR loading to assembly, so the compiler should notice they're in use and add them to context saving in ISR (it doesn't do that if FSRs are used only in Pascal :( ). In other words, one may now use the replacement libs both in main code and ISR (not the same routines, though - reentrancy is not allowed) without worrying about context saving.

If one uses FSRs in Pascal in ISR, it's necessary to add own context saving of used FSRs, or use a procedures that would force the compiler to do so (like Florin's saveAll, or mine FSRcontext - added now to System lib replacement).

Re: PIC18 libraries replacements

Posted: 04 Nov 2010 17:27
by Dany
Hi Janni,

ref: http://www.mikroe.com/forum/viewtopic.p ... ib#p134278

Is there a new version of the Conversions replacement library planned with the routines named as in the original PRO (4.10) one?

If I am not mistaken, then the replacement library uses other names for (or sometimes lacks):
- IntToStrWithZeros
- LongWordToStrWithZeros
- LongIntToStrWithZeros
- ByteToHex
- ShortToHex
- WordToHex
- IntToHex
- LongWordToHex
- LongIntToHex

It would be very nice if your conversions library would continue to be a real (extended) "replacement" library. :D :D

Thanks in advance!

Re: PIC18 libraries replacements

Posted: 04 Nov 2010 20:33
by janni
Hi Dany,

There are indeed new replacement libs (they're constantly being updated) and the conversions lib contains all you've listed and more :) . There's also new Delays lib replacement with optimised and more precise VDelay_ms & VDelay_Advanced_ms.
Unfortunately, not all lib descriptions are up to date as I didn't have much free time lately. I'll try to find time to update them and make the new versions (for mP PRO v 4.15) available. Hopefully this weekend.

Re: PIC18 libraries replacements

Posted: 05 Nov 2010 08:38
by zristic
Dany, Janni,
Have you considered using the package manager for distributing your libraries to end users?

http://www.mikroe.com/eng/products/view ... e-manager/

Re: PIC18 libraries replacements

Posted: 05 Nov 2010 11:32
by Dany
janni wrote:Hi Dany,

There are indeed new replacement libs (they're constantly being updated) and the conversions lib contains all you've listed and more :) . There's also new Delays lib replacement with optimised and more precise VDelay_ms & VDelay_Advanced_ms.
Unfortunately, not all lib descriptions are up to date as I didn't have much free time lately. I'll try to find time to update them and make the new versions (for mP PRO v 4.15) available. Hopefully this weekend.
Thanks! :D :D

Re: PIC18 libraries replacements

Posted: 05 Nov 2010 11:35
by Dany
zristic wrote:Dany, Janni,
Have you considered using the package manager for distributing your libraries to end users?

http://www.mikroe.com/eng/products/view ... e-manager/
Thanks Zoran, i will look into the package manager possibilities, until now i had no time to do so. Looks a very nice/usefull tool. :D

Re: PIC18 libraries replacements

Posted: 05 Nov 2010 12:36
by janni
zristic wrote:Dany, Janni,
Have you considered using the package manager for distributing your libraries to end users?
Not for any replacement libs. Package Manager does not offer such possibility :( .

Re: PIC18 libraries replacements

Posted: 05 Nov 2010 14:15
by zristic
As a feature it can be requested.
I added it to the wish list...

Re: PIC18 libraries replacements

Posted: 06 Nov 2010 20:52
by Dany
Hi Janni,

Just discovered in the original "String" library that function "StrStr" does not return 0 if the substring is empty, it returns $FFFF in stead. The help says it should return 0 in this case.

In your "Pos" function the "spec" is the same as the StrStr spec (= the help, see above), with the difference that the Pos function does return zero when the substring is empty.

This is a discrepancy. I would like to suggest to do a change in the Pos function so that it also returns $FFFF when the substring is zero. (I assume that mE will change their helptext, and leave the StrStr function as it is). The zero return value is already a valid index, and an "empty" string can not be found.

What is your opinion?

Thanks in advance! :D :D

Re: PIC18 libraries replacements

Posted: 07 Nov 2010 15:03
by janni
Yes, you're right. I'll change both the StrStr and Pos in the replacement lib.

BTW, the help file requires one more change - result of Length is of type word, not byte.

Re: PIC18 libraries replacements

Posted: 08 Nov 2010 14:35
by janni
Confronting the help file with reality, I've found many more discrepancies - apparently the strings library has been reworked, but the help has been only partly updated.
I'll let the mE team know about all spotted differences separately, and will have to think about how the replacement lib should be adjusted. For example, it looks like some procedures will be identical (or almost so) now - the Delphi-like and C-like ones, and the question is - should all procedures be separate, or may some call others? Both solutions have advantages so maybe I'll have to make different decisions for different cases.

Re: PIC18 libraries replacements

Posted: 08 Nov 2010 17:36
by Dany
janni wrote:Confronting the help file with reality, I've found many more discrepancies - apparently the strings library has been reworked, but the help has been only partly updated.
I'll let the mE team know about all spotted differences separately, and will have to think about how the replacement lib should be adjusted. For example, it looks like some procedures will be identical (or almost so) now - the Delphi-like and C-like ones, and the question is - should all procedures be separate, or may some call others? Both solutions have advantages so maybe I'll have to make different decisions for different cases.
Thanks!

Re: PIC18 libraries replacements

Posted: 12 Nov 2010 10:56
by Dany
janni wrote:Hi Dany,
There are indeed new replacement libs (they're constantly being updated) and the conversions lib contains all you've listed and more :) . There's also new Delays lib replacement with optimised and more precise VDelay_ms & VDelay_Advanced_ms.
Hi Janni, are those new libraries already published? I can not find them.
Thanks in advance! :D

Re: PIC18 libraries replacements

Posted: 12 Nov 2010 13:22
by janni
Not yet, Dany. Had to make more changes in strings lib after checking what the routines in official lib really do :roll: .

I've noticed also how big the replacement lib became and how hard it may be to find desired procedure/function. Unfortunately, the way lib content is presented in Library Manager is a mirror of the order of routines in library unit (not, for example, the order of prototypes, which could easily be shuffled around :( ).
I'm still thinking how to solve this problem...

Re: PIC18 libraries replacements

Posted: 12 Nov 2010 15:18
by Dany
janni wrote:Not yet, Dany. Had to make more changes in strings lib after checking what the routines in official lib really do :roll: .
Ok. Thanks! :D