From: Patrick G. <I. <I. <I. <I> - 2001-08-30 13:55:05
|
Dear SDCC-Team! There seems to be problem when not using an intermediate variable with SFRs: Example of waiting for a space character with UART receive buffer. This won't work with SDCC 2.2.2 (again, no compiler warning, just crash of target): // ... do { while (!RI); // Wait until char is received. RI= 0; // Reset receive flag. } while (SBUF!=' '); // Reading char from UART receive buffer and // check if received char is space. // Continue here, when first space was received. This works fine with SDCC 2.2.2, but it uses an intermediate variable: char my_char; // ... do { while (!RI); // Wait until char is received. RI= 0; // Reset receive flag. my_char= SBUF; // Reading char from UART receive buffer. } while (my_char!=' '); // Check if received char is space. // Continue here, when first space was received. Best regards, Patrick -- * * * Patrick GEHRIGER Elektronik und Software Karlstr. 95 DE-64285 DARMSTADT Tel, Fax: +49 6151 22093 mailto:p.g...@ma... |