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.

[参考译文] MSP430FR2355:为什么0x0d 和#39;\0'不起作用????

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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1164180/msp430fr2355-why-does-0x0d-work-and-0-not

器件型号:MSP430FR2355

你好。。。

我在 UART RX ISR 中具有以下代码。  如果我用0x0d 替换'\0'、代码工作并且我捕获与缓冲区对齐的 NMEA GPS 消息、并且我唤醒并按我的意愿全部工作、但是如果我用'\0'替换0x0d、代码永远不会唤醒(定义为  ISR.GPS_NMEACharRcvdFlag = T)

gpsChar 是一个易失性 uint8_t

有人能解释一下我在这里俯瞰的是什么吗?

          gpsChar = gps.pSysCommsA->UCAxRXBUF;

          if (gpsChar == '$')
              captureMssg = T;
          else if (gpsChar == '\0')
              captureMssg = F;

          if (captureMssg)
              NMEAData[NMEASentenceSize++] = gpsChar;
          else
          {
              if (NMEASentenceSize != 0)
              {
                  NMEASentenceSize = 0;
                  ISR.GPS_NMEACharRcvdFlag = T;
              }
          }
          LPM3_EXIT;