GDA_Conv Library
GDA_Conv Library
Here is the conversion library what I wrote.
http://gambrose.esmartdesign.com/GDA_Conv%20Library.zip
It’s not finished but I hope it is useful to people who use P16 PICs as it’s faster than the standard one.
I hope to add support for P18 and other functions later.
Any comments or suggestions gratefully received.
If you find use for it then I would be happy to here off you
http://gambrose.esmartdesign.com/GDA_Conv%20Library.zip
It’s not finished but I hope it is useful to people who use P16 PICs as it’s faster than the standard one.
I hope to add support for P18 and other functions later.
Any comments or suggestions gratefully received.
If you find use for it then I would be happy to here off you
Graham Ambrose
What it should do is add number to string routines that are faster than the current built in ones
as well as number to BCD that are faster and actual convert to BCD.
most of the routines are also smaller in size and don't make out side calls saving call stack space.
they also return a pointer to the text so that whey can be used inside other routines. e.g.
they are a work in progress and hopefully most if not all the asm can be changed for c code as the compiler matures.
I would have included a .mcl for you to test but mE have made it too hard to install them by hand so it isn't really worth it.
as well as number to BCD that are faster and actual convert to BCD.
most of the routines are also smaller in size and don't make out side calls saving call stack space.
they also return a pointer to the text so that whey can be used inside other routines. e.g.
Code: Select all
print_string(byte2String(34));
I would have included a .mcl for you to test but mE have made it too hard to install them by hand so it isn't really worth it.
Graham Ambrose
This is an important thing for them to be working on. One of the real attractions to mE compilers is that we can all have our favorite languages, and still make contributions to (and withdrawls from) a free software bank. It is obvious to be that while we can only have open source in the original language, we should be able to bundle the libraries for use in any and all languages. There is tremendous potential here. We need a straightforward means to create binary libraries.gambrose wrote:I would have included a .mcl for you to test but mE have made it too hard to install them by hand so it isn't really worth it.
If you know what you're doing, you're not learning anything.
LGR
gambrose
You have the following code
and the prototype for this function is
now my question is a long can be more that one characters and you can only return one
I can be wrong. I use Pascal
Ok, i'll do that.Anton - since you're brave enough to test these C routines, I would appreciete it if you let me (us) know what this adds to Pascal, or if this is even usable with Pascal (the .mcl files are supposed to be portable).
gambrose
You have the following code
Code: Select all
Long2String(123456789); // 1,448 cycles
Code: Select all
char * Long2String(unsigned long num);
I can be wrong. I use Pascal
Another proud user of LV 24-33A Development System and mikroPascal PRO for dsPIC :)
PortA not working? Add CMCON := 7; PortD not working? Add ADCON1 := 6;
To paste code on the forum, please use the [b] Code [/b] button !! ;)
PortA not working? Add CMCON := 7; PortD not working? Add ADCON1 := 6;
To paste code on the forum, please use the [b] Code [/b] button !! ;)
Have added and optimised Byte2Str for P18
Word2Str works but there seems to be a problem with large numbers. it will work fine in a test project with just the one function but when i copy it into the main library file it goes a bit wobbly
Code: Select all
char * Word2Str(unsigned number, char * output);
Word2Str works but there seems to be a problem with large numbers. it will work fine in a test project with just the one function but when i copy it into the main library file it goes a bit wobbly
Graham Ambrose
Code: Select all
Word2Str works but there seems to be a problem with large numbers
That's why it is smaller and faster