C++ input

dessault

Üye
Katılım
18 May 2007
Mesajlar
10
Puanları
1
Yaş
40
arkadaşlar ben C++ veya visual studio C++ ile harici bir cihazdan RS232 bağlantı ile seri haberleşme yapmayı planlıyorum fakat komut sıkıntısı çekiyotum bana bu konuda yardımcı olursanız sevinirim şimdiden teşekkürler iyi çalışmalar
 
(This page was last updated on Thursday, October 15, 1998)

Important!!!!!

A small bug in the library was discovered by Elias Gil in my sendByte function. If you try to send more than one byte of data at the same time, data loss could happen. To fix the problem replace the sendByte function (in rs232.c) with the code below.



//////////////////////////////////////////////////////////////

//

//

//

//////////////////////////////////////////////////////////////

void sendByte(char *port, byte databyte)

{

//if the global uart is the same port ... (this will be

// for opening more than 1 port in future releases)

if( strncmp(port, (*globalUart).port, strlen(port)))

{

//wait until transmitting holding register empty.

// We can do nothing while waiting so NULL.

// was 0x04 (bit 2) which should have been !0x20 (bit 5)

// this was suggested by Elias Gil on 16 Aug 98

//***********************************

//Elias Gil

//Zapex Research (Israel) Ltd

//Tel: (972) 9 8658624

//Fax: (972) 9 8851112

//e-mail: [email protected]

//***********************************

while( !(0x20 & INPORT((*globalUart).portid+LSR)) )

NULL;



//send the byte ...

OUTPORT((*globalUart).portid+TX, databyte);

}

else

{

printf("ERROR: %s: line %i:", __FILE__, __LINE__);

printf("ports must be equal\n");

exit(EXIT_FAILURE);

}

}
 
dostum teşekkürler sağolasın
 

Forum istatistikleri

Konular
129,557
Mesajlar
927,926
Kullanıcılar
452,177
Son üye
m-u-s-t-a-f-a

Yeni konular

Geri
Üst