diff --git a/main/lorcomm.c b/main/lorcomm.c index ec7de2a..e8ee41e 100644 --- a/main/lorcomm.c +++ b/main/lorcomm.c @@ -68,7 +68,7 @@ void lorcomm_handle_receive(uint8_t size) { // if the msg doesnt end in NULL it's probably already corrupt // just go ahead and terminate it if(msg->msg[msg->length] != '\0') - msg->msg[msg->length] == '\0'; + msg->msg[msg->length] = '\0'; ESP_LOGI(TAG, "msg (len: %d): %s", msg->length, msg->msg); diff --git a/main/main.c b/main/main.c index 57981c4..155243e 100644 --- a/main/main.c +++ b/main/main.c @@ -48,8 +48,6 @@ void app_main(void) { err = nvs_open("config", NVS_READWRITE, &nvs_handle); if (err != ESP_OK) { printf("Error (%s) opening NVS handle!\n", esp_err_to_name(err)); - - //lorcomm_cfg.nvs_handle = NULL; } else { lorcomm_cfg.nvs_handle = nvs_handle; ESP_LOGI(TAG, "nvs_handle: %d", nvs_handle); @@ -78,8 +76,8 @@ void app_main(void) { lora32_init(&lora); lora32_set_spreadfactor(&lora, lora.spreadingFactor); - //double dr = lora32_calc_datarate(&lora); - //ESP_LOGI(TAG, "data rate: %fbps", dr); + double dr = lora32_calc_datarate(&lora); + ESP_LOGI(TAG, "data rate: %fbps", dr); lora32_dump_regs(&lora); @@ -87,8 +85,6 @@ void app_main(void) { xTaskCreate(console_task, "console", 4048, &lorcomm_cfg, tskIDLE_PRIORITY + 3, NULL); - //lora32_send(&lora, (uint8_t*)"hi\0", 3); - //ble_init(); lora32_enable_continuous_rx(&lora);