main.c 868 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <unistd.h>
  4. #include "freertos/FreeRTOS.h"
  5. #include "freertos/task.h"
  6. #include "esp_wifi.h"
  7. #include "esp_event.h"
  8. #include "esp_log.h"
  9. #include "nvs_flash.h"
  10. #include "lwip/sockets.h"
  11. #include <stdbool.h>
  12. #include "esp_rom_md5.h"
  13. #include "sip/sip.h"
  14. #include "bsp_board.h"
  15. static const char *TAG = "APP";
  16. void app_main(void)
  17. {
  18. ESP_LOGI(TAG, "Starting SIP client...");
  19. esp_err_t ret;
  20. ret = esp_board_init(16000, 2, 32);
  21. if(ret != ESP_OK)
  22. {
  23. ESP_LOGE(TAG,
  24. "Audio board init failed: %s",
  25. esp_err_to_name(ret));
  26. return;
  27. }
  28. wifi_init();
  29. while (!wifi_ready) {
  30. vTaskDelay(pdMS_TO_TICKS(500));
  31. }
  32. xTaskCreate(
  33. sip_register_task,
  34. "sip_register",
  35. 24576,
  36. NULL,
  37. 5,
  38. NULL);
  39. }