PIC18 libraries replacements - package updated to v 1.12

General discussion on mikroPascal PRO for PIC.
Author
Message
janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

#17 Post by janni » 14 Dec 2009 00:55

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).

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: PIC18 libraries replacements

#18 Post by Dany » 04 Nov 2010 17:27

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!

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: PIC18 libraries replacements

#19 Post by janni » 04 Nov 2010 20:33

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.

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

Re: PIC18 libraries replacements

#20 Post by zristic » 05 Nov 2010 08:38

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/

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: PIC18 libraries replacements

#21 Post by Dany » 05 Nov 2010 11:32

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

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: PIC18 libraries replacements

#22 Post by Dany » 05 Nov 2010 11:35

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

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: PIC18 libraries replacements

#23 Post by janni » 05 Nov 2010 12:36

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 :( .

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

Re: PIC18 libraries replacements

#24 Post by zristic » 05 Nov 2010 14:15

As a feature it can be requested.
I added it to the wish list...

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: PIC18 libraries replacements

#25 Post by Dany » 06 Nov 2010 20:52

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

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: PIC18 libraries replacements

#26 Post by janni » 07 Nov 2010 15:03

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.

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: PIC18 libraries replacements

#27 Post by janni » 08 Nov 2010 14:35

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.

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: PIC18 libraries replacements

#28 Post by Dany » 08 Nov 2010 17:36

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!

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: PIC18 libraries replacements

#29 Post by Dany » 12 Nov 2010 10:56

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
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: PIC18 libraries replacements

#30 Post by janni » 12 Nov 2010 13:22

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...

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: PIC18 libraries replacements

#31 Post by Dany » 12 Nov 2010 15:18

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
Last edited by Dany on 12 Nov 2010 15:39, edited 1 time in total.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Post Reply

Return to “mikroPascal PRO for PIC General”