parameteo specific: added NVIC_SystemReset in all fault handlers

pull/7/head EA01
Mateusz Lubecki 2021-10-01 11:35:14 +02:00
rodzic 5639618ddb
commit a2117f53ee
5 zmienionych plików z 24 dodań i 3 usunięć

Wyświetl plik

@ -6,7 +6,7 @@
#include "config_data.h"
#define SW_VER "EA01"
#define SW_DATE "28092021"
#define SW_DATE "01102021"
#define SYSTICK_TICKS_PER_SECONDS 100
#define SYSTICK_TICKS_PERIOD 10

Wyświetl plik

@ -107,7 +107,7 @@
#define _LATNS 'N'
#define _LON 01912.11
#define _LONWE 'E'
#define _COMMENT "WX only = TXPower 2W = Klub Zeglarski Halny, plywajaca keja manewrowa na J. Zywieckim = sp8ebc@interia.pl"
#define _COMMENT "WX only = TXPower 1W = Klub Zeglarski Halny, plywajaca keja manewrowa na J. Zywieckim = sp8ebc@interia.pl"
// You can use only one of these below defines to choose symbol. Meteo data are are always transmitted with blue WX symbol
//#define _SYMBOL_DIGI // uncomment if you want digi symbol(green star with D inside)

Wyświetl plik

@ -11,7 +11,7 @@
//#define PARATNC_HWREV_A
//#define PARATNC_HWREV_B
//#define PARATNC_HWREV_C
//#define PARAMETEO
#define PARAMETEO
#ifdef PARAMETEO
// those defines and an undef are only required for shitty Eclipse indexer to see anything from STM32L471xx target

Wyświetl plik

@ -75,6 +75,7 @@ void NMI_Handler(void)
/* USER CODE BEGIN NonMaskableInt_IRQn 1 */
while (1)
{
NVIC_SystemReset();
}
/* USER CODE END NonMaskableInt_IRQn 1 */
}
@ -91,6 +92,7 @@ void HardFault_Handler(void)
{
/* USER CODE BEGIN W1_HardFault_IRQn 0 */
/* USER CODE END W1_HardFault_IRQn 0 */
NVIC_SystemReset();
}
}
@ -106,6 +108,7 @@ void MemManage_Handler(void)
{
/* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
/* USER CODE END W1_MemoryManagement_IRQn 0 */
NVIC_SystemReset();
}
}
@ -121,6 +124,7 @@ void BusFault_Handler(void)
{
/* USER CODE BEGIN W1_BusFault_IRQn 0 */
/* USER CODE END W1_BusFault_IRQn 0 */
NVIC_SystemReset();
}
}
@ -136,6 +140,7 @@ void UsageFault_Handler(void)
{
/* USER CODE BEGIN W1_UsageFault_IRQn 0 */
/* USER CODE END W1_UsageFault_IRQn 0 */
NVIC_SystemReset();
}
}

Wyświetl plik

@ -329,22 +329,38 @@ void analog_anemometer_init(uint16_t pulses_per_meter_second, uint8_t anemometer
return;
}
/**
* This function denitialize everything related to analog anemometr to eliminate transient glitches
* in windspeed
*/
void analog_anemometer_deinit(void) {
#ifdef STM32L471xx
// disable interrupt generated by DMA channel used for windspeed
LL_DMA_DisableIT_TC(DMA1, LL_DMA_CHANNEL_5);
// disable DMA channel used for windspeed measurement
LL_DMA_DisableChannel(DMA1, LL_DMA_CHANNEL_5);
// disable DMA request for fourth channel which is used for windspeed
LL_TIM_DisableDMAReq_CC3(TIM4);
// disable timer itself (windspeed)
LL_TIM_DisableCounter(TIM4);
LL_TIM_DisableCounter(TIM3);
#endif
}
/**
* windspeed
*/
void analog_anemometer_timer_irq(void) {
analog_anemometer_timer_has_been_fired = 1;
}
/**
* windspeed
*/
void analog_anemometer_dma_irq(void) {
int i = 0;
uint16_t pulse_ln = 0;