Skip to content
Snippets Groups Projects
shepherd_sniff.c 918 B
Newer Older
Dorababu A's avatar
Dorababu A committed
#include "shepherd_sniff.h"

#include "esp_chip_info.h"
#include "esp_freertos_hooks.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "sdkconfig.h"
#include "spi_flash_mmap.h"

// Shepehrd task to print metrics 
static void shepherd_task(void *args) {
  while (1) {
    printf("\n---------Shepherd Chibby-----------\n");
    // get chip info
    esp_chip_info_t chip_info;
    esp_chip_info(&chip_info);
    printf("ESP32, %d CPU cores, WiFi%s%s, ",
            chip_info.cores,
            (chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "",
            (chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : "");

    printf("silicon revision %d, ", chip_info.revision);
    vTaskDelay(15000 / portTICK_PERIOD_MS);
  }
  vTaskDelete(NULL);
}

esp_err_t shepherd_sniff() {
  // TODO calculate optimal stack size
  xTaskCreate(shepherd_task, "shepherd_task", 2048, NULL, 1, NULL);
  return ESP_OK;
}