Compilation fix
This commit is contained in:
+2
-4
@@ -713,18 +713,16 @@ int cliGps(const char ** argv)
|
|||||||
{
|
{
|
||||||
int baudrate = 0;
|
int baudrate = 0;
|
||||||
|
|
||||||
#if defined(DEBUG)
|
|
||||||
if (argv[1][0] == '$') {
|
if (argv[1][0] == '$') {
|
||||||
// send command to GPS
|
// send command to GPS
|
||||||
gpsSendFrame(argv[1]);
|
gpsSendFrame(argv[1]);
|
||||||
}
|
}
|
||||||
|
#if defined(DEBUG)
|
||||||
else if (!strcmp(argv[1], "trace")) {
|
else if (!strcmp(argv[1], "trace")) {
|
||||||
gpsTraceEnabled = !gpsTraceEnabled;
|
gpsTraceEnabled = !gpsTraceEnabled;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
#endif
|
#endif
|
||||||
|
else if (toInt(argv, 1, &baudrate) > 0 && baudrate > 0) {
|
||||||
if (toInt(argv, 1, &baudrate) > 0 && baudrate > 0) {
|
|
||||||
gpsInit(baudrate);
|
gpsInit(baudrate);
|
||||||
serialPrint("GPS baudrate set to %d", baudrate);
|
serialPrint("GPS baudrate set to %d", baudrate);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -322,7 +322,6 @@ void gpsWakeup()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(DEBUG)
|
|
||||||
char hex(uint8_t b) {
|
char hex(uint8_t b) {
|
||||||
return b > 9 ? b + 'A' - 10 : b + '0';
|
return b > 9 ? b + 'A' - 10 : b + '0';
|
||||||
}
|
}
|
||||||
@@ -344,5 +343,3 @@ void gpsSendFrame(const char * frame)
|
|||||||
gpsSendByte('\n');
|
gpsSendByte('\n');
|
||||||
TRACE("*%02x", parity);
|
TRACE("*%02x", parity);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // #if defined(DEBUG)
|
|
||||||
|
|||||||
@@ -40,8 +40,6 @@ struct gpsdata_t
|
|||||||
extern gpsdata_t gpsData;
|
extern gpsdata_t gpsData;
|
||||||
void gpsWakeup();
|
void gpsWakeup();
|
||||||
|
|
||||||
#if defined(DEBUG)
|
|
||||||
void gpsSendFrame(const char * frame);
|
void gpsSendFrame(const char * frame);
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // _GPS_H_
|
#endif // _GPS_H_
|
||||||
|
|||||||
@@ -403,9 +403,9 @@ void hapticOn(uint32_t pwmPercent);
|
|||||||
void gpsInit(uint32_t baudrate);
|
void gpsInit(uint32_t baudrate);
|
||||||
uint8_t gpsGetByte(uint8_t * byte);
|
uint8_t gpsGetByte(uint8_t * byte);
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
extern uint8_t gpsTraceEnabled;
|
extern uint8_t gpsTraceEnabled;
|
||||||
void gpsSendByte(uint8_t byte);
|
|
||||||
#endif
|
#endif
|
||||||
|
void gpsSendByte(uint8_t byte);
|
||||||
|
|
||||||
// Second serial port driver
|
// Second serial port driver
|
||||||
#define SERIAL2
|
#define SERIAL2
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ void gpsInit(uint32_t baudrate)
|
|||||||
|
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
uint8_t gpsTraceEnabled = false;
|
uint8_t gpsTraceEnabled = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
Fifo<uint8_t, 64> gpsTxFifo;
|
Fifo<uint8_t, 64> gpsTxFifo;
|
||||||
|
|
||||||
void gpsSendByte(uint8_t byte)
|
void gpsSendByte(uint8_t byte)
|
||||||
@@ -71,12 +73,8 @@ void gpsSendByte(uint8_t byte)
|
|||||||
USART_ITConfig(GPS_USART, USART_IT_TXE, ENABLE);
|
USART_ITConfig(GPS_USART, USART_IT_TXE, ENABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // #if defined(DEBUG)
|
|
||||||
|
|
||||||
|
|
||||||
extern "C" void GPS_USART_IRQHandler(void)
|
extern "C" void GPS_USART_IRQHandler(void)
|
||||||
{
|
{
|
||||||
#if defined(DEBUG)
|
|
||||||
// Send
|
// Send
|
||||||
if (USART_GetITStatus(GPS_USART, USART_IT_TXE) != RESET) {
|
if (USART_GetITStatus(GPS_USART, USART_IT_TXE) != RESET) {
|
||||||
uint8_t txchar;
|
uint8_t txchar;
|
||||||
@@ -88,7 +86,6 @@ extern "C" void GPS_USART_IRQHandler(void)
|
|||||||
USART_ITConfig(GPS_USART, USART_IT_TXE, DISABLE);
|
USART_ITConfig(GPS_USART, USART_IT_TXE, DISABLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// Receive
|
// Receive
|
||||||
uint32_t status = GPS_USART->SR;
|
uint32_t status = GPS_USART->SR;
|
||||||
|
|||||||
Reference in New Issue
Block a user