summaryrefslogtreecommitdiff
path: root/libloragw
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 /libloragw
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 'libloragw')
-rw-r--r--libloragw/inc/loragw_fpga.h2
-rw-r--r--libloragw/src/loragw_fpga.c2
-rw-r--r--libloragw/src/loragw_hal.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/libloragw/inc/loragw_fpga.h b/libloragw/inc/loragw_fpga.h
index d5b6f9d..722438c 100644
--- a/libloragw/inc/loragw_fpga.h
+++ b/libloragw/inc/loragw_fpga.h
@@ -135,6 +135,6 @@ int lgw_fpga_reg_wb(uint16_t register_id, uint8_t *data, uint16_t size);
*/
int lgw_fpga_reg_rb(uint16_t register_id, uint8_t *data, uint16_t size);
-int lgw_set_attenuation(float *attn);
+int lgw_set_attenuation(uint8_t *attn);
#endif
/* --- EOF ------------------------------------------------------------------ */
diff --git a/libloragw/src/loragw_fpga.c b/libloragw/src/loragw_fpga.c
index 368fe37..906f4b5 100644
--- a/libloragw/src/loragw_fpga.c
+++ b/libloragw/src/loragw_fpga.c
@@ -366,7 +366,7 @@ int lgw_fpga_reg_rb(uint16_t register_id, uint8_t *data, uint16_t size) {
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-int lgw_set_attenuation(float *attn) {
+int lgw_set_attenuation(uint8_t *attn) {
if (*attn < 0) {
return LGW_HAL_ERROR;
}
diff --git a/libloragw/src/loragw_hal.c b/libloragw/src/loragw_hal.c
index 386bd6d..9355cb8 100644
--- a/libloragw/src/loragw_hal.c
+++ b/libloragw/src/loragw_hal.c
@@ -1423,7 +1423,7 @@ int lgw_send(struct lgw_pkt_tx_s pkt_data) {
/* Power is set to max and the attenuator brings down the level to match the packet's request */
target_mix_gain = 15; /* Mixer gain is not used for setting power*/
lgw_reg_w(LGW_TX_GAIN, 0); /* Dig gain is not used for setting power */
- float attn = (float)(max_tx_power - pkt_data.rf_power);
+ uint8_t attn = (uint8_t)(max_tx_power - pkt_data.rf_power);
x = lgw_set_attenuation(&attn);
if (x != LGW_HAL_SUCCESS) {
DEBUG_MSG("ERROR: Failed to set attenuation value\n");