as1_RecvBlock not receiving block

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

as1_RecvBlock not receiving block

跳至解决方案
1,978 次查看
GMVS
Contributor III

oks

 

i have to MC9S08DZ128MLL connected by RS232 interface, but one of them has an LCd display attached where all messages send by rs232 are displayed

both have the exact same code

i'm using processor expert libraries

 

i called SendChar at the main and it works

i called RecvChar from the OnRxChar interrupt and works

i called SendBlock at the main and it works

but i called RecvBlock from the OnRxChar interrupt and doesnt work

i assume it doesn't work because the interrupt is just for one char and i'm getting a lot of them

but if i cant use OnRxChar, then which other interrupt should i use?

 

(or maybe i'm messing up pointers?)

 

i'll send you my code

thank you

Original Attachment has been moved to: myINT-code.txt.zip

Original Attachment has been moved to: myLCD-code.txt.zip

Original Attachment has been moved to: PE-code.txt.zip

1 解答
938 次查看
Petr_H
NXP Employee
NXP Employee

Hi,

The problem is that the RecvBlock method of the AsynchroSerial component is not intended to be called within OnRxChar event, which is called after reception of every character.

If you'd like to use RecvBlock method, use it from the main routine or from the OnFullRxbuf event.

Example of the OnFullRxBuf event code from the 'Typical usage' page of the component help. You can access this page using the pop-up menu command 'Help on component' :

  void AS1_OnFullRxBuf(void)

  {

    word Received;

    byte err;

    err = AS1_RecvBlock((byte*)&message, sizeof(message), &Received);

    ....

  }

best regards

Petr Hradsky

Processor Expert Support Team

在原帖中查看解决方案

1 回复
939 次查看
Petr_H
NXP Employee
NXP Employee

Hi,

The problem is that the RecvBlock method of the AsynchroSerial component is not intended to be called within OnRxChar event, which is called after reception of every character.

If you'd like to use RecvBlock method, use it from the main routine or from the OnFullRxbuf event.

Example of the OnFullRxBuf event code from the 'Typical usage' page of the component help. You can access this page using the pop-up menu command 'Help on component' :

  void AS1_OnFullRxBuf(void)

  {

    word Received;

    byte err;

    err = AS1_RecvBlock((byte*)&message, sizeof(message), &Received);

    ....

  }

best regards

Petr Hradsky

Processor Expert Support Team