From: Ramakrishnan Muthukrishnan Date: Mon, 7 Nov 2022 04:11:59 +0000 (+0530) Subject: comment out debug prints X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/file/$top_link?a=commitdiff_plain;h=f1980d47a38ca9a33fd2ac507f2ad502cc97ddb4;p=pihpsdr.git comment out debug prints --- diff --git a/old_protocol.c b/old_protocol.c index 2658e41..c986de6 100644 --- a/old_protocol.c +++ b/old_protocol.c @@ -1720,10 +1720,11 @@ void ozy_send_buffer() { #endif } -//if(last_power!=power) { -// g_print("power=%d\n",power); -// last_power=power; -//} + /* if(last_power!=power) { */ + /* int computed_gain = (power >> 5) + ((power + 4) >> 3); */ + /* g_print("power=%d, computed gain = %d\n",power, computed_gain); */ + /* last_power=power; */ + /* } */ output_buffer[C0]=0x12; /* addr[6:1] = 001001b */ output_buffer[C1]=power & 0xFF; diff --git a/radio.c b/radio.c index 528554f..49412b0 100644 --- a/radio.c +++ b/radio.c @@ -1615,18 +1615,22 @@ double getDrive(void) { } static int calcLevel(double d) { - fprintf(stderr, "calcLevel: input d = %f..", d); int level = 0; int v = get_tx_vfo(); BAND *band = band_get_band(vfo[v].band); - double target_dbm = 10.0 * log10(d * 1000.0); + double target_dbm_orig = 10.0 * log10(d * 1000.0); double gbb = band->pa_calibration; - target_dbm -= gbb; + double target_dbm = target_dbm_orig - gbb; double target_volts = sqrt(pow(10, target_dbm * 0.1) * 0.05); double volts = min((target_volts / 0.8), 1.0); double actual_volts = volts * (1.0 / 0.98); + /* printf("calcLevel: d = %f\n", d); */ + /* printf("calcLevel: target_dbm_orig = %f\n", target_dbm_orig); */ + /* printf("calcLevel: gbb = %f\n", gbb); */ + /* printf("calcLevel: target_dbm = %f\n", target_dbm); */ + if (actual_volts < 0.0) { actual_volts = 0.0; } else if (actual_volts > 1.0) {