diff --git a/components/sx127x_driver/sx127x_driver.c b/components/sx127x_driver/sx127x_driver.c index 48c8bd7..b299ea8 100644 --- a/components/sx127x_driver/sx127x_driver.c +++ b/components/sx127x_driver/sx127x_driver.c @@ -146,7 +146,7 @@ esp_err_t sx127x_free(sx127x_t *handle) { void IRAM_ATTR sx127x_isr(void *arg) { sx127x_t *handle = (sx127x_t *)arg; - ESP_LOGV(SX127X_TAG, "sx127x_isr"); + ESP_LOGI(SX127X_TAG, "sx127x_isr"); BaseType_t hpTaskWoken; xSemaphoreGiveFromISR(handle->intr_semaphore, &hpTaskWoken); if (hpTaskWoken) { diff --git a/components/sx127x_driver/sx127x_registers.c b/components/sx127x_driver/sx127x_registers.c index 5b02fa5..ce2d057 100644 --- a/components/sx127x_driver/sx127x_registers.c +++ b/components/sx127x_driver/sx127x_registers.c @@ -204,14 +204,16 @@ esp_err_t sx127x_set_crc(sx127x_t *handle, sx127x_crc_t crc) { return ESP_OK; } -esp_err_t sx127x_write_fifo(sx127x_t *handle, char *data, size_t data_len) { +esp_err_t sx127x_write_fifo(sx127x_t *handle, const char *data, + size_t data_len) { spi_transaction_t trans; memset(&trans, 0, sizeof(trans)); - trans.flags = SPI_TRANS_USE_RXDATA; + trans.flags = 0; trans.addr = REG_FIFO; trans.length = 8 * data_len; - trans.rxlength = 0; trans.tx_buffer = data; + trans.rxlength = 0; + trans.rx_buffer = NULL; esp_err_t ret = spi_device_transmit(handle->device_handle, &trans); SX127X_ERROR_CHECK2(ret, spi_device_transmit); diff --git a/components/sx127x_driver/sx127x_registers.h b/components/sx127x_driver/sx127x_registers.h index c9a3959..996879b 100644 --- a/components/sx127x_driver/sx127x_registers.h +++ b/components/sx127x_driver/sx127x_registers.h @@ -26,6 +26,6 @@ esp_err_t sx127x_set_sync_word(sx127x_t *handle, uint8_t sync_word); esp_err_t sx127x_set_crc(sx127x_t *handle, sx127x_crc_t crc); -esp_err_t sx127x_write_fifo(sx127x_t *handle, char *data, size_t data_len); +esp_err_t sx127x_write_fifo(sx127x_t *handle, const char *data, size_t data_len); esp_err_t sx127x_read_fifo(sx127x_t *handle, char *data_out, size_t *data_len_out);