Browse Source

fix error msgs and a few things

ugv_io
Alex Mikhalev 6 years ago
parent
commit
3b07b53dee
  1. 2
      components/sx127x_driver/sx127x_driver.c
  2. 4
      main/ugv_main.c

2
components/sx127x_driver/sx127x_driver.c

@ -288,6 +288,6 @@ esp_err_t sx127x_send_packet(sx127x_t *handle, char *data, size_t data_len, Tick @@ -288,6 +288,6 @@ esp_err_t sx127x_send_packet(sx127x_t *handle, char *data, size_t data_len, Tick
SX127X_CHECK(packet.data != NULL, "malloc error", ESP_ERR_NO_MEM);
memcpy(packet.data, data, data_len);
BaseType_t pdRet = xQueueSend(handle->tx_packet_queue, &packet, ticks_to_wait);
SX127X_CHECK(pdRet == pdTRUE, "tx queue full", ESP_FAIL);
SX127X_CHECK(pdRet == pdTRUE, "tx queue full", ESP_ERR_TIMEOUT);
return ESP_OK;
}

4
main/ugv_main.c

@ -114,7 +114,7 @@ void loraTask(void *params) { @@ -114,7 +114,7 @@ void loraTask(void *params) {
char tx_buf[20];
const size_t tx_buf_len = (sizeof(tx_buf) / sizeof(tx_buf[0]));
int packet_len;
TickType_t send_period = pdMS_TO_TICKS(2000);
TickType_t send_period = pdMS_TO_TICKS(1000);
TickType_t current_time = xTaskGetTickCount();
TickType_t next_send = current_time + send_period;
struct Packet recvd_packet;
@ -144,7 +144,7 @@ void loraTask(void *params) { @@ -144,7 +144,7 @@ void loraTask(void *params) {
if (ret != ESP_OK) {
ESP_LOGE(TAG, "error sending packet: %d", ret);
} else {
ESP_LOGI(TAG, "lora wrote %d bytes\n", written_bytes);
ESP_LOGI(TAG, "lora wrote %d bytes", written_bytes);
}
current_time = xTaskGetTickCount();

Loading…
Cancel
Save