Horus internal GPS: cmake changes, more CLI options, ability to send commands to the module

This commit is contained in:
Damjan Adamic
2016-08-30 21:23:20 +02:00
parent 1ef91597ca
commit ff37274e64
7 changed files with 75 additions and 13 deletions
+22 -2
View File
@@ -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;
}