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 > Hi Torsten, > > You are right, it's a nice game. > > Why are the wrong results still there? I am afraid you forgot Irq_GetCount in ICT3IrqCapture! > (It cost me quite some time to find this out since I can't test the program. I have no application > board only a ProBot128.) > > About your comments: > > Really exactly. > > Therefore the change over. > > We have two data records. For every function one. > > One to read and one to write. > Though it is not important any more because you removed this functionality, you really should > have a look at this again. In ICT3GetCapture you do calculations with the inactive ms counter. > But what if during ICT3GetCapture ICT3IrqCapture gets called? Then the inactive counter will > be set active and set to zero. If then ICT3GetCapture continues, the ms counter it uses will > read zero. > > > > Also I noticed that you multiply with 0x0000FFFFl where it should be 65536 (2^16). > > > > The data type "dword" is required, to be able to carry that multiplication. > > The little wobbly type transformation of Compact-C > > converts according to the first operand. > What I meant is that 0000FFFF = 65535, not 65536. > > > > Secondly, ICT3IrqCapture must be as fast as possible in order not to block the interrupt handling of > > > the slow timer. It would therefore pay off to get rid of all the float calculations in it. This can be > > > realized as follows. > > > > I do not see any floot operation in this function. > Not in the old version (0.03) but in the version I was explaining to you and which is now 0.04. > > > What is an "integer division"? > That is like floor but with an integer result, not a float. Like 7/3=2. > > Well, I am curious to know whether still wrong result occur. > Gruß Pepe