Kommentar: Einfügen von HTML im Kommentar: Link einfügen: <a href="LINKURL" target="_blank">LINKTITEL</a> Bild einfügen: <img src="BILDURL"> Text formatieren: <b>fetter Text</b> <i>kursiver Text</i> <u>unterstrichener Text</u> Kombinationen sind auch möglich z.B.: <b><i>fetter & kursiver Text</i></b> C Quellcode formatieren: <code>Quellcode</code> BASIC Quellcode formatieren: <basic>Quellcode</basic> (Innerhalb eines Quellcodeabschnitts ist kein html möglich.) Wichtig: Bitte mache Zeilenumbrüche, bevor Du am rechten Rand des Eingabefeldes ankommst ! -> I > > > > > The file IntFunc_Lib.cc contains two errors: > > > > > > > > > > The blocks: > > > > > > > > > > #ifdef MEGA32 > > > > > #define PS0_1 1 > > > > > #define PS0_8 2 > > > > > #define PS0_64 3 > > > > > #define PS0_256 4 > > > > > #define PS0_1024 5 > > > > > #endif // MEGA32 > > > > > > > > > > and > > > > > > > > > > #ifdef MEGA128 > > > > > #define PS0_1 1 > > > > > #define PS0_8 2 > > > > > #define PS0_32 3 > > > > > #define PS0_64 4 > > > > > #define PS0_128 5 > > > > > #define PS0_256 6 > > > > > #define PS0_1024 7 > > > > > #endif // MEGA128 > > > > > > > > > > do not compile correctly because of the comments // MEGA32 resp. // MEGA128 in the last lines. > > > > > The result is that the MEGA128 uses the MEGA32 definitions which leads to unexpected results that > > > > > are very hard to debug as I noticed. > > > > > > > > That is not true. I tested it and it worked correctly. Should there be an exceptional case that > > > > leads to problems, please post it here or send it to ccpro@gmx.de. > > > > > > > > Regards > > > > > > > > Peter > > > > > > Hi Peter, > > > > > > Well, I don't know how you tested it but when I open the file IntFunc_Lib.cc in the IDE, the blocks > > > mentioned above are not marked with a line in the left margin as they should be. That is a clear > > > sign that that something is wrong I should say. > > > > That is a clear sign that the parser inside the editor is different than the preprocessor that > > is used for compiling. > > > > > Besides, I noticed that definitions with #define also are not compiled when the command is > > > followed by a comment (//) on the same line. > > > > Please show me, I get no error. The follwing example shows the correct results on a MEGA128: > > > > #define XYZZY "42\r" // that is a comment > > void main(void) > > { > > int i; > > > > i= PS0_1024; > > Msg_WriteText(XYZZY); > > Msg_WriteInt(i); > > } > > > > Regards > > > > Peter > > > > > > > > > > Regards, > > > Pepe > > Hi Peter, > > I am afraid I could not reproduce the error I thought I had found. I must have made a mistake and > apologize for the inconvenience. > A (poor) excuse for my mistake might be that I had terrible troubles getting an interrupt timer working > correctly. The extended search for the cause of this problem might have confused me. > It seems now that this problem is related to another error (but maybe I am wrong again). > > I discovered that Timer_T0Time(192,PS0_32) immediately starts generating interrupts while > Timer_T3Time(192,PS0_32) needs Timer_T3Start(PS0_32) to start (or maybe only to set the correct > prescaler value; that I could not determine). Is this illogic, an error or is there another explanation? > > Regards, > Pepe