Change some defines to static constexpr values

This commit is contained in:
Paul Guenette
2020-12-10 15:21:00 -05:00
parent 6a18eed26f
commit adadef86aa
+2 -2
View File
@@ -6,8 +6,8 @@
#include <algorithm>
#define CURRENT_ADC_LOWER_BOUND (uint32_t)((float)(1 << 12) * CURRENT_SENSE_MIN_VOLT / 3.3f)
#define CURRENT_ADC_UPPER_BOUND (uint32_t)((float)(1 << 12) * CURRENT_SENSE_MAX_VOLT / 3.3f)
static constexpr auto CURRENT_ADC_LOWER_BOUND = (uint32_t)((float)(1 << 12) * CURRENT_SENSE_MIN_VOLT / 3.3f);
static constexpr auto CURRENT_ADC_UPPER_BOUND = (uint32_t)((float)(1 << 12) * CURRENT_SENSE_MAX_VOLT / 3.3f);
/**
* @brief This control law adjusts the output voltage such that a predefined