if(err!=ESP_OK) { //Error. Could not fetch the expiry time return0; } //Convert microseconds to ticks npl_freertos_time_ms_to_ticks((uint32_t)(expiry/1000),&exp); #else //esp_timer_get_expiry_time() is only available from IDF 5.0 onwards ...