Add timeout to ADC to stop infinite loop

This commit is contained in:
BlackMark 2020-07-03 21:50:29 +02:00
parent bc75971fc8
commit 7868d2f7b7

View File

@ -36,7 +36,7 @@ class LightSensors {
util::for_constexpr( util::for_constexpr(
[](const auto& idx) { [](const auto& idx) {
constexpr auto i = idx.value; constexpr auto i = idx.value;
HAL_ADC_PollForConversion(&hadc, HAL_MAX_DELAY); HAL_ADC_PollForConversion(&hadc, 1000);
m_adcValues[i] = HAL_ADC_GetValue(&hadc); m_adcValues[i] = HAL_ADC_GetValue(&hadc);
}, },
std::make_index_sequence<m_adcValues.size()>{}); std::make_index_sequence<m_adcValues.size()>{});