1 #pragma once 2 3 #if defined(SWIGJAVA) || defined(JAVACALLBACK) 4 class IsrCallback 5 { 6 public: ~IsrCallback()7 virtual ~IsrCallback() 8 { 9 } run()10 virtual void run() 11 { /* empty, overloaded in Java*/ 12 } 13 14 private: 15 }; 16 17 generic_callback_isr(void * data)18static void generic_callback_isr (void* data) 19 { 20 IsrCallback* callback = (IsrCallback*) data; 21 if (callback == NULL) 22 return; 23 callback->run(); 24 } 25 #endif 26