summaryrefslogtreecommitdiff
path: root/util_tx_continuous
diff options
context:
space:
mode:
authorHarsh Sharma <harsh.sharma@multitech.com>2019-11-15 14:02:18 -0600
committerHarsh Sharma <harsh.sharma@multitech.com>2019-11-15 14:02:18 -0600
commitf870877782ba8a279580f2df0ab7c244a4849ab0 (patch)
tree2ec9a30033436ebecd05cf2e2d3df1b477c0e57f /util_tx_continuous
parent408ecd322635e37c710006c95a22dddc455e7f08 (diff)
downloadlora_gateway_mtac_full-f870877782ba8a279580f2df0ab7c244a4849ab0.tar.gz
lora_gateway_mtac_full-f870877782ba8a279580f2df0ab7c244a4849ab0.tar.bz2
lora_gateway_mtac_full-f870877782ba8a279580f2df0ab7c244a4849ab0.zip
Changed attenuator power to be int instead of float
Diffstat (limited to 'util_tx_continuous')
-rw-r--r--util_tx_continuous/src/util_tx_continuous.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/util_tx_continuous/src/util_tx_continuous.c b/util_tx_continuous/src/util_tx_continuous.c
index 275c3eb..54d77f7 100644
--- a/util_tx_continuous/src/util_tx_continuous.c
+++ b/util_tx_continuous/src/util_tx_continuous.c
@@ -59,7 +59,7 @@ Maintainer: Matthieu Leurent
#define DEFAULT_FDEV_KHZ 25
#define DEFAULT_BT 2
#define DEFAULT_NOTCH_FREQ 129000U
-#define DEFAULT_ATTENUATION 0.0
+#define DEFAULT_ATTENUATION 0
/* -------------------------------------------------------------------------- */
/* --- GLOBAL VARIABLES ----------------------------------------------------- */
@@ -109,7 +109,7 @@ int main(int argc, char **argv)
uint8_t g_dac = DEFAULT_DAC_GAIN;
uint8_t g_mix = DEFAULT_MIXER_GAIN;
uint8_t g_pa = DEFAULT_PA_GAIN;
- float g_atten = DEFAULT_ATTENUATION;
+ uint8_t g_atten = DEFAULT_ATTENUATION;
char mod[64] = DEFAULT_MODULATION;
uint8_t sf = DEFAULT_SF;
unsigned int bw_khz = DEFAULT_BW_KHZ;
@@ -267,13 +267,13 @@ int main(int argc, char **argv)
}
}
else if (strcmp(long_options[option_index].name,"attn") == 0) {
- i = sscanf(optarg, "%f", &arg_f);
- if ((i != 1) || (arg_f < 0.0) ) {
+ i = sscanf(optarg, "%u", &arg_u);
+ if ((i != 1) || (arg_f > 127) ) {
printf("ERROR: argument parsing of --attn argument. Use -h to print help\n");
return EXIT_FAILURE;
}
else {
- g_atten = arg_f;
+ g_atten = arg_u;
}
}
else {
@@ -363,9 +363,9 @@ int main(int argc, char **argv)
txpkt.tx_mode = IMMEDIATE;
txpkt.rf_chain = TX_RF_CHAIN;
if (fpga_supports_attenuator()) {
- txpkt.rf_power = 32.0 - g_atten;
+ txpkt.rf_power = 32 - g_atten;
} else {
- txpkt.rf_power = 0.0;
+ txpkt.rf_power = 0;
}
if (strcmp(mod, "FSK") == 0) {