This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] RM48L540:sciReceive 不起作用

Guru**** 2527230 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1218831/rm48l540-scireceive-does-not-work

器件型号:RM48L540

您好!

我有一个我无法解决的问题。 我已经将 HAL 配置为通过 SCILIN 接口获取中断。

每次我按下键盘上的任意键时、中断效果都很好。 但是、"sciReceive (scilinREG、1、(unsigned char *)&rxKey);"不会将键值存储在 rxKey 中。

我附加了一些配置和 sciNotification 例程的图片。

提前感谢您。

此致、

Leandro

/*********************************
 * SCI interrupt service routine *
 *********************************/
void sciNotification(sciBASE_t *sci, unsigned flags)
{
    uint8_t rxKey = 1;
    //bool done = false;

    //sciSend(scilinREG, 26, (unsigned char *)"\r\nSystem > sciNotification");

    sciReceive(scilinREG, 1, (unsigned char *)&rxKey);

    //sciDisplayText(scilinREG, &rxKey,1);
    sciDisplayData(scilinREG, &rxKey, 1);
    //sciSend(scilinREG, 1, &rxKey);


    //done = command_selector(&rxKey);
}

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    1.将 rxKey 声明为全局变量  

    2.初始化 SCI,并将 SCI 配置为在 main()中接收1个字节的数据

      sciInit()

      sciReceive (sciREG1、1、retkey);

    3.在 SCI 通知中显示 rxKey

      sciDisplayData (scilinREG、&rxKey、1);

    4.在 SCI 注释中再次调用 scireceive()    

      sciReceive (scilinREG、1、(unsigned char *)&rxKey);

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    谢谢! 这些代码行解决了我的问题。

    此致、

    Leandro