jcaridadhdez / RAK811-tracker

Example code for RAK811 nodes with GPS on board, transmitting their coordinates in the payload of the LoRaWAN packet in a format that is compatible with TTN Mapper.
MIT License
14 stars 13 forks source link

Function UartMcuPutBuffer missing #1

Open SloMusti opened 6 years ago

SloMusti commented 6 years ago

UartMcuPutBuffer function is missing from the code, it is defined in uart_board.h but is not present in the .c file, thus some things can not be done, like writing to GPS

Code should be here: https://github.com/jcaridadhdez/RAK811-tracker/blob/fe20239e4aa517b8d420e8739d666079ee524749/src/RAK811BreakBoard/uart-board.c#L199

I have tried adding the missing function, however I mange to hang the board by doing so:

uint8_t UartMcuPutBuffer( Uart_t *obj, uint8_t *buffer, uint16_t size )
{
    if( IsFifoFull( &obj->FifoTx ) == false )
    {
                BoardDisableIrq( );
        for(uint8_t i=0;i<size;i++){
            FifoPush( &obj->FifoTx, buffer[i]);
        }
                BoardEnableIrq( );
        // Trig UART Tx interrupt to start sending the FIFO contents.
        __HAL_UART_ENABLE_IT( &UartContext[UART_1].UartHandle, USART_IT_TXE );
        return 0; // OK
    }

    return 1; // Busy
}
jcaridadhdez commented 6 years ago

I can't implement this code as "UartContext is not declared" but it would be useful to communicate with gps.

I'll try to perform the code

SloMusti commented 6 years ago

I have tried to see if UART TX is working at all and even using the function UartMcuPutChar that is implemented will hang the processor.