bugfix in windsensor handling related to misusing power supply state

pull/7/head
Mateusz Lubecki 2022-04-05 21:21:28 +02:00
rodzic 4e634a4ad8
commit 590d5795a2
5 zmienionych plików z 22 dodań i 3 usunięć

Wyświetl plik

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="ilg.gnumcueclipse.debug.gdbjtag.openocd.launchConfigurationType">
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.PERIPHERALS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;peripherals&gt;&#10; &lt;peripheral name=&quot;GPIOB&quot;/&gt;&#10; &lt;peripheral name=&quot;GPIOC&quot;/&gt;&#10; &lt;peripheral name=&quot;GPIOA&quot;/&gt;&#10;&lt;/peripherals&gt;&#10;"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.PERIPHERALS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;peripherals&gt;&#10; &lt;peripheral name=&quot;GPIOB&quot;/&gt;&#10; &lt;peripheral name=&quot;GPIOC&quot;/&gt;&#10; &lt;peripheral name=&quot;GPIOA&quot;/&gt;&#10; &lt;peripheral name=&quot;TIM3&quot;/&gt;&#10;&lt;/peripherals&gt;&#10;"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doContinue" value="true"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doDebugInRam" value="false"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doFirstReset" value="true"/>

Wyświetl plik

@ -104,4 +104,15 @@ inline void io___cntrl_vbat_r_disable(void) {
}
inline uint8_t io_get_cntrl_vbat_c(void) {
uint8_t out = 0;
if ((GPIOA->ODR & GPIO_ODR_ODR_1) != 0) {
out = 1;
}
return out;
}
#endif /* IO_H_ */

Wyświetl plik

@ -6,7 +6,7 @@
#include "config_data.h"
#define SW_VER "EA05"
#define SW_DATE "26032022"
#define SW_DATE "05042022"
#define SYSTICK_TICKS_PER_SECONDS 100
#define SYSTICK_TICKS_PERIOD 10

Wyświetl plik

@ -178,7 +178,11 @@ void wx_pool_anemometer(const config_data_wx_sources_t * const config_sources, c
int32_t modbus_retval;
uint16_t scaled_windspeed = 0;
#ifdef STM32L471xx
if (io_get_cntrl_vbat_c() == 0) {
#else
if (io_get_5v_isol_sw___cntrl_vbat_s() == 0) {
#endif
// inhibit any measurement when power is not applied to sensors
return;
}

Wyświetl plik

@ -566,11 +566,15 @@ int16_t analog_anemometer_direction_handler(void) {
uint16_t downscaled_angle = 0;
#ifdef STM32F10X_MD_VL
if (io_get_5v_isol_sw___cntrl_vbat_s() == 0) {
#else
if (io_get_cntrl_vbat_c() == 0) {
#endif
return rte_wx_winddirection_last;
}
#ifdef STM32F10X_MD_VL
TIM_Cmd(TIM3, DISABLE);