Implement sampling ADC and printing over VSP
This commit is contained in:
1 parent
f678273def
commit
e6205458c5
2 files changed
+62
-9
No files matched your search
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
namespace util {
|
||||
|
||||
template<typename Fn, size_t... Ints>
|
||||
auto for_constexpr(Fn&& func, std::index_sequence<Ints...>)
|
||||
{
|
||||
if constexpr(std::is_void_v<std::invoke_result_t<Fn, std::integral_constant<size_t, 0>>>) {
|
||||
(func(std::integral_constant<size_t, Ints>{}), ...);
|
||||
}
|
||||
else {
|
||||
if((func(std::integral_constant<size_t, Ints>{}) && ...))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
Reference in new issue
Block a user