Poprawione nadawanie APRS - wyłączanie UARTu na czas nadawania ramki

aprs_test
Łukasz Nidecki 2017-01-22 01:23:18 +01:00
rodzic 5ec1244516
commit 02509e7823
4 zmienionych plików z 16 dodań i 7 usunięć

Wyświetl plik

@ -12,7 +12,7 @@
QAPRSBase qaprs;
void aprs_init(){
qaprs.init(0, 0, (const char *) APRS_CALLSIGN, (const uint8_t) APRS_SSID, (char *) "APZQAP", '0', (char *) "WIDE1-1,WIDE2-1");
qaprs.init(0, 0, (char *) APRS_CALLSIGN, (const uint8_t) APRS_SSID, (char *) "APZQAP", '0', (char *) "WIDE1-1,WIDE2-1");
}
@ -44,8 +44,8 @@ void aprs_send_position(GPSEntry gpsData) {
int8_t la_degrees, lo_degrees;
uint8_t la_minutes, la_h_minutes, lo_minutes, lo_h_minutes;
calcDMH(gpsData.lat_raw, &la_degrees, &la_minutes, &la_h_minutes);
calcDMH(gpsData.lon_raw, &lo_degrees, &lo_minutes, &lo_h_minutes);
calcDMH(gpsData.lat_raw/10, &la_degrees, &la_minutes, &la_h_minutes);
calcDMH(gpsData.lon_raw/10, &lo_degrees, &lo_minutes, &lo_h_minutes);
static uint16_t aprs_packet_counter = 0;
aprs_packet_counter ++;

7
init.c
Wyświetl plik

@ -39,6 +39,13 @@ void init_usart_gps(const uint32_t speed, const uint8_t enable_irq) {
USART_InitStructure.USART_Mode = USART_Mode_Tx | USART_Mode_Rx;
USART_Init(USART1, &USART_InitStructure);
NVIC_InitTypeDef NVIC_InitStructure; //create NVIC structure
NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 15;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 2;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
USART_Cmd(USART1, ENABLE);
if (enable_irq){
USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);

2
main.c
Wyświetl plik

@ -167,7 +167,9 @@ int main(void) {
radio_enable_tx();
GPSEntry gpsData;
ublox_get_last_data(&gpsData);
USART_Cmd(USART1, DISABLE);
aprs_send_position(gpsData);
USART_Cmd(USART1, ENABLE);
radio_disable_tx();
}

Wyświetl plik

@ -86,8 +86,8 @@
<File name="cmsis_boot" path="" type="2"/>
<File name="delay.h" path="delay.h" type="1"/>
<File name="init.h" path="init.h" type="1"/>
<File name="stm_lib/inc/stm32f10x_pwr.h" path="stm_lib/inc/stm32f10x_pwr.h" type="1"/>
<File name="stm_lib/src/stm32f10x_tim.c" path="stm_lib/src/stm32f10x_tim.c" type="1"/>
<File name="stm_lib/inc/stm32f10x_pwr.h" path="stm_lib/inc/stm32f10x_pwr.h" type="1"/>
<File name="cmsis_boot/startup" path="" type="2"/>
<File name="cmsis/core_cmFunc.h" path="cmsis/core_cmFunc.h" type="1"/>
<File name="stm_lib/src/misc.c" path="stm_lib/src/misc.c" type="1"/>
@ -100,8 +100,8 @@
<File name="syscalls/syscalls.c" path="syscalls/syscalls.c" type="1"/>
<File name="stm_lib/inc/stm32f10x_spi.h" path="stm_lib/inc/stm32f10x_spi.h" type="1"/>
<File name="init.c" path="init.c" type="1"/>
<File name="stm_lib/src/stm32f10x_adc.c" path="stm_lib/src/stm32f10x_adc.c" type="1"/>
<File name="stm_lib/inc/stm32f10x_dma.h" path="stm_lib/inc/stm32f10x_dma.h" type="1"/>
<File name="stm_lib/src/stm32f10x_adc.c" path="stm_lib/src/stm32f10x_adc.c" type="1"/>
<File name="radio.c" path="radio.c" type="1"/>
<File name="ublox.h" path="ublox.h" type="1"/>
<File name="stm_lib/src/stm32f10x_usart.c" path="stm_lib/src/stm32f10x_usart.c" type="1"/>
@ -113,14 +113,14 @@
<File name="cmsis_boot/system_stm32f10x.c" path="cmsis_boot/system_stm32f10x.c" type="1"/>
<File name="stm_lib/inc/misc.h" path="stm_lib/inc/misc.h" type="1"/>
<File name="cmsis/core_cmInstr.h" path="cmsis/core_cmInstr.h" type="1"/>
<File name="cmsis/core_cm3.h" path="cmsis/core_cm3.h" type="1"/>
<File name="QAPRSCommon.h" path="QAPRSCommon.h" type="1"/>
<File name="cmsis/core_cm3.h" path="cmsis/core_cm3.h" type="1"/>
<File name="stm_lib/src/stm32f10x_rcc.c" path="stm_lib/src/stm32f10x_rcc.c" type="1"/>
<File name="fun.c" path="fun.c" type="1"/>
<File name="aprs.cpp" path="aprs.cpp" type="1"/>
<File name="radio.h" path="radio.h" type="1"/>
<File name="stm_lib/src/stm32f10x_dma.c" path="stm_lib/src/stm32f10x_dma.c" type="1"/>
<File name="f_rtty.h" path="f_rtty.h" type="1"/>
<File name="stm_lib/src/stm32f10x_dma.c" path="stm_lib/src/stm32f10x_dma.c" type="1"/>
<File name="stm_lib/src" path="" type="2"/>
<File name="cmsis" path="" type="2"/>
<File name="stm_lib" path="" type="2"/>