summaryrefslogtreecommitdiff
path: root/libloragw/src/loragw_reg.c
diff options
context:
space:
mode:
authorMatthieu Leurent <mleurent@semtech.com>2015-03-11 20:15:40 +0100
committerMatthieu Leurent <mleurent@semtech.com>2015-03-11 20:15:40 +0100
commit45be5ff473ad1f39829bfcebc641201ae46c1c80 (patch)
tree5d0720fb06e9bb35ce2c8c2f0749b41a7b42c41a /libloragw/src/loragw_reg.c
parentbe5c8ac770bc5b142e2c6a47702d9ac653141371 (diff)
downloadlora_gateway-45be5ff473ad1f39829bfcebc641201ae46c1c80.tar.gz
lora_gateway-45be5ff473ad1f39829bfcebc641201ae46c1c80.tar.bz2
lora_gateway-45be5ff473ad1f39829bfcebc641201ae46c1c80.zip
- Added support for Kerlink 868 27dBm gateway - Updated global_conf.eu868.json (in packet logger) to new LoRaWAN frequency plan - Added version numbers to AGC, arbiter and calibration firmware (those versions are checked at startup) - Added test_loragw_cal to test radio calibrations - Fixed minor bug in error coverage in register read/write functions /!\ warning: Kerlink 868 27dBm gateway includes a FPGA that MUST be programmed before running any application
Diffstat (limited to 'libloragw/src/loragw_reg.c')
-rw-r--r--libloragw/src/loragw_reg.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libloragw/src/loragw_reg.c b/libloragw/src/loragw_reg.c
index 7f9ec40..9381e0a 100644
--- a/libloragw/src/loragw_reg.c
+++ b/libloragw/src/loragw_reg.c
@@ -680,7 +680,7 @@ int lgw_reg_r(uint16_t register_id, int32_t *reg_value) {
/* Point to a register by name and do a burst write */
int lgw_reg_wb(uint16_t register_id, uint8_t *data, uint16_t size) {
- int spi_stat;
+ int spi_stat = LGW_SPI_SUCCESS;
struct lgw_reg_s r;
/* check input parameters */
@@ -715,7 +715,7 @@ int lgw_reg_wb(uint16_t register_id, uint8_t *data, uint16_t size) {
}
/* do the burst write */
- spi_stat = lgw_spi_wb(lgw_spi_target, r.addr, data, size);
+ spi_stat += lgw_spi_wb(lgw_spi_target, r.addr, data, size);
if (spi_stat != LGW_SPI_SUCCESS) {
DEBUG_MSG("ERROR: SPI ERROR DURING REGISTER BURST WRITE\n");
@@ -729,7 +729,7 @@ int lgw_reg_wb(uint16_t register_id, uint8_t *data, uint16_t size) {
/* Point to a register by name and do a burst read */
int lgw_reg_rb(uint16_t register_id, uint8_t *data, uint16_t size) {
- int spi_stat;
+ int spi_stat = LGW_SPI_SUCCESS;
struct lgw_reg_s r;
/* check input parameters */
@@ -758,7 +758,7 @@ int lgw_reg_rb(uint16_t register_id, uint8_t *data, uint16_t size) {
}
/* do the burst read */
- spi_stat = lgw_spi_rb(lgw_spi_target, r.addr, data, size);
+ spi_stat += lgw_spi_rb(lgw_spi_target, r.addr, data, size);
if (spi_stat != LGW_SPI_SUCCESS) {
DEBUG_MSG("ERROR: SPI ERROR DURING REGISTER BURST READ\n");