ESP32 panic when calling a function from another function

Thanks @Danois90 . I will follow your suggestions.