Index: ADuCM360_demo_cn0359/src/hal/drivers/adc.cpp =================================================================== diff -u -rb39d7f18a4f5f23a76b7fb484c13bffd225ef466 -re5e6c6f79e38c2f82de516ea81069dfe0fc558b5 --- ADuCM360_demo_cn0359/src/hal/drivers/adc.cpp (.../adc.cpp) (revision b39d7f18a4f5f23a76b7fb484c13bffd225ef466) +++ ADuCM360_demo_cn0359/src/hal/drivers/adc.cpp (.../adc.cpp) (revision e5e6c6f79e38c2f82de516ea81069dfe0fc558b5) @@ -74,6 +74,8 @@ static int position = 0; +static float raw_temp_res; // Raw Temperature Resistance + ssize_t adc_read(void *buf, size_t count) { if ((position + count) > sizeof(adc_file)) { @@ -512,10 +514,14 @@ if (adc1_result >= 0x09d54f53) { //PT1000 result.temp = res2temp(6.e3f * adc1_result / (1074547130368ll - (3ll * adc1_result))); //normalized to 1 at 0°C + raw_temp_res = (6.e3f * adc1_result / (1074547130368ll - + (3ll * adc1_result))); result.rtd_type = 1000; } else { //PT100 result.temp = res2temp(6.e4f * adc1_result / (1074547130368ll - (3ll * adc1_result))); //normalized to 1 at 0°C + raw_temp_res = (6.e4f * adc1_result / (1074547130368ll - + (3ll * adc1_result))); result.rtd_type = 100; } @@ -545,6 +551,11 @@ return 0; } +float get_raw_temperature_resistance(void) +{ + return raw_temp_res; +} + #ifdef __cplusplus extern "C" {