# HG changeset patch # User Ethan Zonca # Date 2016-10-11 21:21:51 # Node ID 779c7da65f385dd8cb111d1e2834dcf9cc0fab5c # Parent 9ba4d6855ba47acaf3cb4d9b17b260347b2400c6 Fix deinitting things that aren't initted diff --git a/src/gps.c b/src/gps.c --- a/src/gps.c +++ b/src/gps.c @@ -21,6 +21,13 @@ static uint8_t _gps_verify_checksum(uint // Poll for fix data from the GPS and update the internal structure void gps_update_data(void) { + // Error! + if(!gpson) + { + led_blink(5); + return; + } + // Construct the request to the GPS uint8_t request[8] = {0xB5, 0x62, 0x01, 0x07, 0x00, 0x00, 0xFF, 0xFF}; diff --git a/src/uart.c b/src/uart.c --- a/src/uart.c +++ b/src/uart.c @@ -90,8 +90,8 @@ void uart_deinit(void) { if(uart_initted == 1) { - HAL_DMA_DeInit(&hdma_usart1_rx); - HAL_DMA_DeInit(&hdma_usart1_tx); + //HAL_DMA_DeInit(&hdma_usart1_rx); + //HAL_DMA_DeInit(&hdma_usart1_tx); HAL_UART_DeInit(&huart1); uart_initted = 0; }