Horus internal GPS: cmake changes, more CLI options, ability to send commands to the module
This commit is contained in:
@@ -60,9 +60,23 @@ void gpsInit(uint32_t baudrate)
|
||||
NVIC_Init(&NVIC_InitStructure);
|
||||
}
|
||||
|
||||
#if defined(DEBUG)
|
||||
uint8_t gpsTraceEnabled = false;
|
||||
Fifo<uint8_t, 64> gpsTxFifo;
|
||||
|
||||
void gpsSendByte(uint8_t byte)
|
||||
{
|
||||
while (gpsTxFifo.isFull());
|
||||
gpsTxFifo.push(byte);
|
||||
USART_ITConfig(GPS_USART, USART_IT_TXE, ENABLE);
|
||||
}
|
||||
|
||||
#endif // #if defined(DEBUG)
|
||||
|
||||
|
||||
extern "C" void GPS_USART_IRQHandler(void)
|
||||
{
|
||||
#if 0
|
||||
#if defined(DEBUG)
|
||||
// Send
|
||||
if (USART_GetITStatus(GPS_USART, USART_IT_TXE) != RESET) {
|
||||
uint8_t txchar;
|
||||
@@ -89,5 +103,11 @@ extern "C" void GPS_USART_IRQHandler(void)
|
||||
|
||||
uint8_t gpsGetByte(uint8_t * byte)
|
||||
{
|
||||
return gpsRxFifo.pop(*byte);
|
||||
uint8_t result = gpsRxFifo.pop(*byte);
|
||||
#if defined(DEBUG)
|
||||
if (gpsTraceEnabled) {
|
||||
serialPutc(*byte);
|
||||
}
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user