From d8c132319fc13da4a9df9f70ac355753f62f9b3b Mon Sep 17 00:00:00 2001 From: Alex Mikhalev Date: Wed, 2 Jan 2019 18:05:42 -0700 Subject: [PATCH] fix writing fifo --- components/sx127x_driver/sx127x_registers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/sx127x_driver/sx127x_registers.c b/components/sx127x_driver/sx127x_registers.c index 06dd0b1..1193f77 100644 --- a/components/sx127x_driver/sx127x_registers.c +++ b/components/sx127x_driver/sx127x_registers.c @@ -256,7 +256,7 @@ esp_err_t sx127x_write_fifo(sx127x_t *hndl, const char *data, size_t data_len) { spi_transaction_t trans; memset(&trans, 0, sizeof(trans)); trans.flags = 0; - trans.addr = SX127X_REG_FIFO; + trans.addr = SX127X_REG_FIFO | 0x80; trans.length = 8 * data_len; trans.tx_buffer = data; trans.rxlength = 0; @@ -281,7 +281,7 @@ esp_err_t sx127x_read_fifo(sx127x_t *hndl, char *data_out, size_t data_len) { trans.addr = SX127X_REG_FIFO; trans.length = 8 * data_len; trans.tx_buffer = NULL; - trans.rxlength = 0; // match length + trans.rxlength = 8 * data_len; trans.rx_buffer = data_out; BaseType_t pdRet = xSemaphoreTake(hndl->spi_mutex, SX127X_MUTEX_TIMOUT);