Added GPS mode switching for higher altitudes, compiler flag to reduce binary size

develop
sq2ips 2025-03-07 10:08:33 +01:00
rodzic f3a20e45a0
commit 5f611cb4bd
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: C383A71588BA55F5
3 zmienionych plików z 20 dodań i 2 usunięć

Wyświetl plik

@ -52,7 +52,6 @@
// type 2
#define FrameLen 62 // Length of XM1110 frame
/*-------------------*/
#if GPS_TYPE == 1
#define GpsRxBuffer_SIZE 512
@ -60,5 +59,6 @@
#elif GPS_TYPE == 2
#define GpsRxBuffer_SIZE FrameLen * 2
#endif
/*-------------------*/
#endif /* INC_CONFIG_H_ */

Wyświetl plik

@ -50,6 +50,8 @@ bool GpsBufferReady = false;
#if GPS_TYPE == 1
NMEA NmeaData;
static uint8_t GPS_fix_ublox[19] = {0xB5, 0x62, 0x06, 0x8A, 0x09, 0x00, 0x01, 0x01, 0x00, 0x00, 0x11, 0x00, 0x11, 0x20, 0x02, 0xDF, 0x04,0x0D, 0x0A};
static uint8_t GPS_airborn[19] = {0xB5, 0x62, 0x06, 0x8A, 0x09, 0x00, 0x01, 0x01, 0x00, 0x00, 0x21, 0x00, 0x11, 0x20, 0x07, 0xF4, 0x59, 0x0D, 0x0A};
#elif GPS_TYPE == 2
XMDATA GpsData;
#endif
@ -289,6 +291,22 @@ int main(void)
LL_LPUART_EnableIT_RXNE(LPUART1);
LL_LPUART_Enable(LPUART1);
#if GPS_TYPE == 1
LL_mDelay(100);
for (uint8_t ig = 0; ig < 19; ig++){
while (!LL_LPUART_IsActiveFlag_TXE(LPUART1)){}
LL_LPUART_TransmitData8(LPUART1, GPS_airborn[ig]);
}
while (!LL_LPUART_IsActiveFlag_TC(LPUART1)){}
LL_mDelay(100);
for (uint8_t ig = 0; ig < 19; ig++){
while (!LL_LPUART_IsActiveFlag_TXE(LPUART1)){}
LL_LPUART_TransmitData8(LPUART1, GPS_fix_ublox[ig]);
}
while (!LL_LPUART_IsActiveFlag_TC(LPUART1)){}
#endif
LL_TIM_EnableCounter(TIM22);
LL_TIM_EnableIT_UPDATE(TIM22);
/* USER CODE END 2 */

Wyświetl plik

@ -137,7 +137,7 @@ C_INCLUDES = \
# compile gcc flags
ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
CFLAGS += $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections# -DNDEBUG -flto
CFLAGS += $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections -DNDEBUG -flto
ifeq ($(DEBUG), 1)
CFLAGS += -g -gdwarf-2