From b44f55a704b692bc993bec6442eeef01b2e4d708 Mon Sep 17 00:00:00 2001 From: karthikmurakonda Date: Thu, 27 Oct 2022 15:44:12 +0530 Subject: [PATCH] PMU:Bugfix: incorrect data sent when frequency set to floating point --- PMUSimulator/ServerFunction.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PMUSimulator/ServerFunction.c b/PMUSimulator/ServerFunction.c index ecf943a..078fb32 100755 --- a/PMUSimulator/ServerFunction.c +++ b/PMUSimulator/ServerFunction.c @@ -646,13 +646,14 @@ void generate_data_frame() else /* Insert Floating point Frequency & DFrequency values in data frame */ { /* For rendom values of FREQ & DFREQ */ - freq_f = (rand() % 5 + 1)*100; - li2c(freq_f, df_temp_1); + freqF = (rand() % 5 + 1)*100; + f2c(freqF, df_temp_1); B_copy(data_frm, df_temp_1, indx, 4); indx = indx + 4; - dfreq_f = (rand() % 5 + 1)*0.00639; - i2c(dfreq_f, df_temp_1); + float dfreqF = 0; + dfreqF = (rand() % 5 + 1)*0.00639; + i2c(dfreqF, df_temp_1); B_copy(data_frm, df_temp_1, indx, 4); indx = indx + 4; }