5 years, 2 months ago.

Data not transmitting after receive from Serialinterrupt in LoRa SX1272 library.Where is the problem

/media/uploads/rajsingh1581/main.cpp I inserted code with it/media/uploads/rajsingh1581/main.cpp

1 Answer

5 years, 2 months ago.

After 1 serial interrupt or after 101 serial interrupts?

   while(pc.readable())  // <---- won't have any effect but see comments below.
    {
        rxBuff[bufferWritingIndex++]=pc.getc();
        //rec_data=1;
        break;
        if(bufferWritingIndex>=size)
        bufferWritingIndex=0;    
    }

I'm not sure quite why that break command is in there but it does have the effect that you never check whether bufferWritingIndex is equal to size or not. Which means after the 101st serial interrupt you'll start causing random memory corruption as you write past the end of rxBuff.