Jump to content

johnsuijk

Members
  • Content Count

    2
  • Joined

  • Last visited

Community Reputation

0 Neutral

About johnsuijk

  • Rank
    Newbrie
  1. Hi, function uitoa_dec seems to overwrites buffer. #include <system.h> #include <boostc.h> #include <stdlib.h> #pragma DATA _CONFIG, _CP_OFF & _WDT_OFF & _MCLRE_OFF & _INTOSCIO & _PWRTE_ON & _BOR_ON #pragma CLOCK_FREQ 8000000 void main() { char buf[4]; unsigned int a; unsigned int b; a=3; b=4; uitoa_dec( buf, b, 4 ); // BUG ???? a=0 but should be 3 } IDE version: SourceBoost IDE 6.60 Compiler: BoostC Target device: PIC16F690 OS: Windows XP
  2. Hi, I'm using Windows XP, BoostC 6.41 and PIC16F690 Problem: It looks as if multiple dimensional arrays don't work in combination with a function call. I tracked down the problem to the following piece of code. Which can be run in the simulator and gives wrong results. #include <system.h> #include <boostc.h> #pragma DATA _CONFIG, _CP_OFF & _WDT_OFF & _MCLRE_OFF & _EC_OSC #pragma CLOCK_FREQ 20000000 char measure[6][3]; char read_eeprom( char a ); void main() { char i; char tmp; char a,b; while( 1 ){ i=3; measure[i][1] = read_eeprom(i); // This does not work i=4; tmp = read_eeprom(i); measure[i][1] = tmp; a = measure[3][1]; // a should be 3 but is 9 b = measure[4][1]; // b is 4 that's ok };// endwhile mainloop } char read_eeprom( char a ) { return a; }
×
×
  • Create New...