Browse Source

update

master
zhaohe 1 year ago
parent
commit
2b13245af0
  1. 4
      src/xsync_v2.cpp

4
src/xsync_v2.cpp

@ -1007,9 +1007,9 @@ xs_error_code_t Xsync::readfreq(uint32_t reg, float &freqfloat) {
}
if (freq_cnt != 0) {
uint32_t freq_1000x = ((1.0 / (freq_cnt * 1.0 / (10 * 1000 * 1000))) * 1000 + 0.5); //+0.5是因为c++ 小数强转成整数时是取整,而非四舍五入
uint32_t freq_100x = ((1.0 / (freq_cnt * 1.0 / (10 * 1000 * 1000))) * 100 + 0.5); //+0.5是因为c++ 小数强转成整数时是取整,而非四舍五入
// ZLOGI(TAG, "freq_10x %f", freq_10x);
freqfloat = freq_1000x / 1000.0;
freqfloat = freq_100x / 100.0;
} else {
freqfloat = 0;
}

Loading…
Cancel
Save