C keil
Naprstek Jiri-R54332
Jiri.Naprstek
Středa Březen 17 14:28:16 CET 2004
V define se nepise "="
SYNCbyte pak odpovida retezci "= 0x54", coz dosazeno do toho if-u nedava jaxi smysl.
Jiri N.
> -----Original Message-----
> From: Ing. Locker Martin [mailto:locker@vosrk.cz]
> Sent: Monday, February 25, 2002 10:50 AM
> To: hw-news@list.gin.cz
> Subject: C keil
>
>
> Zdravim,
>
> zacinam v Cecku, a narazil jsem na problem. Nevite nekdo, kde je
> chyba. Problem je v logickych vyrazech, kompilator hlasi chybu:
> - oznaceno v kodu !!!!
>
> Diky
>
> char BufferRS232[36];
> char CounterRS232;
>
> #define SYNCbyte = 0x54;
>
> void IntRS232(void) interrupt 5
> {
>
> // prijem znaku na RS232
>
> if (RI)
> {
> RI = 0;
> if (RxFlagRS232)
> {
> CounterRS232++;
> BufferRS232[CounterRS232] = SBUF;
> if (CounterRS232 == BufferRS232[1])
> {
> RxFlagRS232 = 0;
> RcvRdyRS232 = 1;
> }
> }
> else
> {
> if (SBUF == SYNCbyte)
> !!!! syntax error near '='
>
> {
> CounterRS232 = 0;
> RxFlagRS232 = 1;
> RcvRdyRS232 = 0;
> }
> }
> }
> if (TI)
> {
> TI=0;
>
> if (CounterRS232 == BufferRS232[1])
> !!!! "==": bad operand type
>
> TxFlagRS232 = 0;
> else
> {
> SBUF = BufferRS232[CounterRS232];
> CounterRS232++;
> }
> }
> }
> Martin Locker
> VOS a SPS Rychnov nad Kneznou
> e-mail: locker@vosrk.cz
>
Další informace o konferenci Hw-list