GPS frame using P-nucleo LRWAN1
#define U1RxBufSize 256
#define U1TxBufSize 2048
int16_t U1RxBufferPtrIN, U1RxBufferPtrOUT, U1TxBufferPtrIN, U1TxBufferPtrOUT=0;
char readableU1(void) {
U1RxBufferPtrIN = U1RxBufSize - __HAL_DMA_GET_COUNTER(huart4.hdmarx);
return U1RxBufferPtrIN - U1RxBufferPtrOUT;
}
int check_GPSBufferSize(void) {
int currentBufferLength = readableU1();
if (currentBufferLength > 0)
PRINTF("Have Buffer Length %d \n", currentBufferLength);
return currentBufferLength ;
}
int main
{
Buffer[0] = 'P';
Buffer[1] = 'I';
Buffer[2] = 'N';
int buffLength = check_GPSBufferSize();
if (!buffLength)
{
Buffer[3] = 'G';
}
else
Buffer[3] = buffLength & 0xff;
}
Part of the source. I want to set up uart port and get gps frame in PingPong ex.I want to check that the number of 'currentBufferLength' changes at the terminal. But the numbers keep the same number. Can you help me?
I can provide more source if you want.