Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Neil

  • Rank
  1. Hi I complained too soon!! It seems my code does not fit into the ROM!!! Sorry for the false alarm. May be a more informative message from the IDE? Just a thought. Thanks Neil Hi I have just upgraded to 6.97 from 6.96 While re-building my project, the IDE is failing. It seems the linker is running out of memory when linking my project. There are many object files and the float lib. I am bulding for a PIC18F8722 running at 40Mhz I do not know if this is a new bug, but it has just started after my upgrade to 6.97 I am close to a product re
  2. Hi PeterK Its been a while since I have be on the boards, so sorry for the late reply. While developing my own code, I had a need for float math. I soon found, as may had that BoostC++ does not provide any. So, as a service, I freely gave away my source code. No license, do with as you see fit. Kindly, some have helped to improve it. I am no compiler writer, so excude me for a poor implementaton. I will look into Henry Pade, may be I can write a better lib. While I apreciate your comments, and your clear knowledge on this point, I do not see any source code to help the rest o
  3. Hi Dave Thanks for the update Neil
  4. Hi I think I have bumped into a compiler bug. I am using 6.96 pro on XP. I have code that allocates an array of structs, similar to the following struct foo { unsigned char a; unsigned char b; unsigned char c; unsigned char d; } foo myFoo[256]; If I go above 256 then i get a comiler warning to use a switch that will be in 7.0. This makes sence to me. Cant do this yet. If I stick to 256 It compiles, runs and has all sorts of run time errors, which apear to be memory coruption. If I go down to 64, all is well.! I thought that the bigest size array w
  5. Hi All Is the source code for the float lib avalible? I need to implement a 16bit floating point value, and the src would give me a head start. Thanks Neil
  6. Hi Dave and Reynard Thanks for the interest. Im more than happy for the code to go into BoostC. From the tests I have doen, all the paths functions work correctly. The could be faster, but Reynard seems to be on the case. I feel they really need some testing by others to shake out any other bugs. Feel free to include my code into BoostC. I dont know when I will next get time to work on this code. It just depends on what project Im working on. Best regards Neil PS I do think sprintf32 is now working!!
  7. Hi Reynard Thanks for the bug fix. I have not tested the functions to distruction, so I expect some bugs. As I use a function I test it more!! I first wrote these under gcc/linux and compared the resulst over many values. Porting to PIC float lib was not as simple as I expected, mainly due to rounding etc. If there is a better place for this code Im happy to donate it. Also, I just put a bug fix into sprintf32f. Id would print 1.002 as 001.2 !!! Fixed now!!!! Neil
  8. Neil

    Float Lib Bug

    Hi Reynard It seems you are the only one who ever replys to me!! I dod not use the simulator, I used a real PIC18. May be that accounts for the difference? Neil
  9. Hi I found that both sprintf and sprintf32 contain the code fragment // Next character if valid digit indicates field width unsigned char fieldWidth = 0; while( c > '0' && c <= '9' ) { fieldWidth *= 10; fieldWidth += c; fieldWidth -= '0'; c = format[fi++]; // read next string format character if ( !c ) goto end; // end of format string reached } Which I think should be // Next character if valid digit indicates field width unsigned char fieldWidth = 0; while( c >= '0' && c <= '9' ) { fieldWidth *=
  10. Neil

    Float Lib Bug

    Hi It seems that code like: float foo; float bar[2]; foo = bar[1]; does not correctly copy values. You can work round this using memcpy((void*)&foo, (void*)&bar[1], 4) Neil OS XPpro, BoostC++ 6.90 PIC18f8722
  11. Hi Dave Thanks for the note. I know it is difficult to say, but when do you expect to have this feature? I may well delay my development of the bit of my code. Thanks Neil
  12. Hi all I dont know if this is where I should do this, so sorry if Im in error. I have seen some posts regarding float maths functions. Here is some code that I have writen to provide some functions. I dont clame it to be fast or even bug free, but it works for me. If you find it usfull all well and good. Ive added an sprintf32 function. The code is derived from BoostC stdio.c. e.g. sprintf32f(myStr, "%8.2f", myFloat); The format string is:- "%[optional '-'][optional ' ' or '+'][optional width][optional .precision]f" were '-' gives left justification were '+' always s
  13. Hi With reference to my post in the C++ section. Would it be possible to add a #PRAGMA type command to force a function to be located at a defined start location in memory? Somthing lic ORG in asm. I can bodge this using the linker. I can also use this be converting a function to hex and encoding it as a #pragma data command, but these are far from ideal. Thanks to Reynard for these comments and sugestions void func(int par) org 0x200 { // Function will start at address 0x200 nop; } OR #pragma funcorg <func_name> <starting_address>
  14. Hi All I think this shows a lib / compiler bug. If you run this code in the debuger (and on a real PIC18F) then the 32 bit function produces an error. sprintf32 gives 999 sprintf gives 9999 So, sprintf32 misses out one digit. It only seems to do this for numbers over 99. I have not looked at negative numbers Can this be confirmed as a bug? If so can it be fixed? Thanks Neil OS XPpro, BoostC++ 6.90 PIC18f8722 char buf[64]; char* bufP = buf; unsigned long tl = 9999; sprintf32(bufP, "%d", tl); unsigned int ti = 9999; sprintf(bufP, "%d", ti); I kn
  15. Hi All Well, I thought Id open up my last question in a hope that I get even more help. If I have a function void foobar() { nop(); } For example, how do I force it to be at FLASH ROM address 0x8000? Im thinking of the asm org 0x8000 command but in BoostC++. Can this be done? Is it a linker thing? I need to put a function in a safe block of FLASH so it is NOT erased as I do an on the fly re-program of the firmware. All thoughts welcome Neil
  • Create New...