Обновление
This commit is contained in:
parent
460ad6a3b0
commit
0e79aff0af
|
|
@ -183,7 +183,7 @@ void init_fast_lookup_table(eAlg use_alg) {
|
|||
}
|
||||
}
|
||||
|
||||
int16_t get_temperature_fast(uint16_t adc_value, adc_temp_lookup *fast_temp_lookup, uint16_t size_fast_temp_lookup) {
|
||||
int16_t get_temperature_fast(uint16_t adc_value, const adc_temp_lookup *fast_temp_lookup, uint16_t size_fast_temp_lookup) {
|
||||
// Простой поиск в таблице с линейной интерполяцией
|
||||
uint16_t index = adc_value /
|
||||
(uint8_t) roundf(ADC_MAX / ((float) size_fast_temp_lookup - 1)); // Делим на 16 для TABLE_SIZE_LOOKUP = 256
|
||||
|
|
|
|||
|
|
@ -41,6 +41,6 @@ typedef struct {
|
|||
|
||||
void init_fast_lookup_table(eAlg use_alg);
|
||||
float get_temperature_from_adc(uint16_t adc_value, eAlg alg);
|
||||
int16_t get_temperature_fast(uint16_t adc_value, adc_temp_lookup *fast_temp_lookup, uint16_t size_fast_temp_lookup);
|
||||
int16_t get_temperature_fast(uint16_t adc_value, const adc_temp_lookup *fast_temp_lookup, uint16_t size_fast_temp_lookup);
|
||||
|
||||
#endif //MDF_ADC_TEMP_KST45_14_2_H
|
||||
|
|
|
|||
Loading…
Reference in New Issue