Is there anything wrong with passing “this” as an argument to ISR registration?
No.
Is there anything inherently wrong with it?
No.
If not, what should one be aware of when doing it?
Object lifetime. Compiler optimization. Resource sharing. Locking. Atomic access. Specific hardware semantics. Additionally, esp32 is a two core platform. The list could go on and there are many books about programming on esp32, about programming in parallel environments and sharing resources between main part of code and interrupt routines. One should be aware of all such programming related topics and also about good code conventions, naming and C++ language.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…