Hallo Leute,
ich habe ein Problem mit dem C18-Compiler von Microchip.
In einer For-Schleife for(index=0; index<6;index++) wird index==0 
zweimal ausgeführt.
Code läuft auf PIC18F67J60 mit TCPIP-Stack 5.31...
| 1 | void HTTPPrint_debug(void)
 | 
| 2 | {
 | 
| 3 |   BYTE index = 0;
 | 
| 4 |   for(index = 0; index < 6; index++)
 | 
| 5 |   {  
 | 
| 6 |     TCPPutROMString(sktHTTP, (ROM BYTE*)"<tr><td><b>");    
 | 
| 7 |     Print2Digits((WORD)index);
 | 
| 8 |     switch(index)
 | 
| 9 |     {
 | 
| 10 |       case 0: TCPPutROMString(sktHTTP, (ROM BYTE*)"Stack Version"); break;
 | 
| 11 |       case 1: TCPPutROMString(sktHTTP, (ROM BYTE*)"Build Date"); break;
 | 
| 12 |       case 2: TCPPutROMString(sktHTTP, (ROM BYTE*)"Date"); break;
 | 
| 13 |       case 3: TCPPutROMString(sktHTTP, (ROM BYTE*)"Time"); break;
 | 
| 14 |       case 4: TCPPutROMString(sktHTTP, (ROM BYTE*)"Socket"); break;
 | 
| 15 |       case 5: TCPPutROMString(sktHTTP, (ROM BYTE*)"MPFS Reserve"); break;
 | 
| 16 |     }
 | 
| 17 |     TCPPutROMString(sktHTTP, (ROM BYTE*)":</b></td><td></td><td>");
 | 
| 18 | 
 | 
| 19 |     switch(index)
 | 
| 20 |     {
 | 
| 21 |       case 0: HTTPPrint_version(); break;
 | 
| 22 |       case 1: HTTPPrint_builddate(); break;
 | 
| 23 |       case 2: HTTPPrint_date(); break;  
 | 
| 24 |       case 3: HTTPPrint_time(); break;
 | 
| 25 |       case 4: Print2Digits(sktHTTP); break;
 | 
| 26 |       case 5: Print4Digits(MPFS_RESERVE_BLOCK); break;
 | 
| 27 |     }
 | 
| 28 |     TCPPutROMString(sktHTTP, (ROM BYTE*)"</td></tr>");
 | 
| 29 |   }
 | 
| 30 | }
 | 
Als Ausgabe erhalte ich aber:
| 1 | 00Stack Version:    v5.31
 | 
| 2 | 00Stack Version:    v5.31
 | 
| 3 | 01Build Date:    Mar 27 2013 13:23:45
 | 
| 4 | 02Date:    01.01.1970
 | 
| 5 | 03Time:    01:00:18
 | 
| 6 | 04Socket:    04
 | 
| 7 | 05MPFS Reserve:    10281
 | 
Sieht so aus als wenn index == 0 zweimal ausgeführt wird.
Hat jemand eine Idee... Ich bin echt ratlos...