IDF component --- espressif__esp_hosted

 

static void __attribute__((constructor)) esp_hosted_host_init(void)
{
    ESP_LOGI(TAG, "ESP Hosted : Host chip_ip[%d]", CONFIG_IDF_FIRMWARE_CHIP_ID);
    ESP_ERROR_CHECK(esp_hosted_init());
}

static void __attribute__((destructor)) esp_hosted_host_deinit(void)
{
    ESP_LOGI(TAG, "ESP Hosted deinit");
    esp_hosted_deinit();
}

通过 __attribute__((constructor)) 把函数指针放入某个代码段

 

posted @ 2025-05-27 13:49  流水灯  阅读(34)  评论(0)    收藏  举报