Nextion send command and data to UC32

Hello, everyone! Relatively recently I received a task to work with a nextion display on a UC32 controller.
When I send a command to just arduino uno it works, but on uc32 the port monitor just doesn't see the command.

By testing it was found that all ruins the string
if (((uint32_t)(rxBuf + rxPtr - 4) & 0xFFFFFFFFFF00) == 0xFFFFFFFFFF00) {
please tell me what I can do with this
code:

      #define NEX_RXBUF_SIZE 256
      #define NEX_RXPTR_WARN (NEX_RXBUF_SIZE-3)
      uint8_t MainByteTT;
      uint8_t x6Byte;
      uint8_t rxByte;
      uint8_t rxPtr = 0;
      uint8_t rxBuf[NEX_RXBUF_SIZE] = {0};
      int32_t rxVal;
      char* rxTxt;
      int32_t test = 0;

void setup() {
  Serial.begin(9600);
  while (!Serial);
}

void loop() {
  String rxValShow = String(rxVal);
  
if (Serial.available()) {
   rxByte = Serial.read();
   
   if ((*(uint32_t*)(rxBuf + rxPtr - 4) & 0xFFFFFF00) == 0xFFFFFF00) {  // its not worked!   
    if (rxByte == 0xFF || rxPtr < NEX_RXPTR_WARN) {
      rxBuf[rxPtr++] = rxByte; // 
    }   
       
      if (rxBuf[0] == 0x71) {
        rxVal = (int32_t)(((int32_t)rxBuf[4] * 256 + rxBuf[3]) * 256 + rxBuf[2]) * 256 + rxBuf[1];        
         Serial.println(rxVal);
         Serial.print("\xFF\xFF\xFF");       
        
      } 
    
    if (rxBuf[0] == 02) { 
        x6Byte = (int32_t)(((int32_t)rxBuf[4] * 256 + rxBuf[3]) * 256 + rxBuf[2]) * 256 + rxBuf[1];   
         rxVal = rxVal*6;
         Serial.print("t0.txt=\"" + rxValShow + "\"");
         Serial.print("\xFF\xFF\xFF");
            

        }
        rxPtr = 0;
}
}
}

if a commend this string thats send me 0
when i send 5

This code works in my esp32 project and on my arduino UNO project, but nothing works on this chipkit uc32 controller :_(

In response to your PM:
Sorry, I can't help with your code as it is written in a style very different to how I write or understand C/C++.
There are other, more experienced people here who might be able to help.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.