bosko lekovic
/
IO_board_K22
K22 processor
temp/thread_class.h
- Committer:
- bosko001
- Date:
- 2021-05-16
- Revision:
- 18:6196688e2a94
- Parent:
- 7:4aa3dac73b66
File content as of revision 18:6196688e2a94:
#ifndef THREAD_CLASS_H #define THREAD_CLASS_H #include "mbed.h" class C_fun { Thread *t; virtual void thread_fun( void ) { while( true) {} } public: C_fun();// { t.start( [this]() { thread_fun(); } ); } C_fun( void(*pfun)(void) );// { t.start(pfun); } } ; C_fun::C_fun() { Thread *t = new Thread( osPriorityNormal, 1000); t->start( [this]() { thread_fun(); } ); } C_fun::C_fun( void(*pfun)(void) ) { Thread *t = new Thread( osPriorityNormal, 1000); t->start(pfun); } // class C_fun1: C_fun // { // void thread_fun( void ) override // { while( true) {led3 = 0; wait_us(5000); led3 = 1; ThisThread::sleep_for(4s);} } // public: // C_fun1( void ){} // C_fun1( pfv fun): C_fun( fun){} // } c_f1(t1fun), c_f2; #endif