refactor(adc_calib): Simplify 2nd step coefficient calculation

- remove unnecessary variables and calculations
- improve readability of code
This commit is contained in:
laokaiyao
2023-06-26 11:52:25 +08:00
parent 5354759735
commit edc1abc8ea
9 changed files with 82 additions and 51 deletions
@@ -12,13 +12,10 @@
extern "C" {
#endif
#define COEFF_GROUP_NUM 4
#define TERM_MAX 5
typedef struct {
uint8_t term_num; ///< Term number of the algorithm formula
const uint64_t (*coeff)[COEFF_GROUP_NUM][TERM_MAX][2]; ///< Coeff of each term. See `adc_error_coef_atten` for details (and the magic number 2)
const int32_t (*sign)[COEFF_GROUP_NUM][TERM_MAX]; ///< Sign of each term
const uint64_t (*coeff)[2]; ///< Coeff of each term. See `adc_error_coef_atten` for details (and the magic number 2)
const int32_t (*sign); ///< Sign of each term
} cali_chars_second_step_t;
/**