00001 // g++ -g -Wall -I /home/f_plouff/ timer_test.cpp 00002 00003 00004 #ifndef TimerPulseTest_CPP 00005 #define TimerPulseTest_CPP 00006 00007 #include <j2k/Fred/Standard.hpp> 00008 #include <j2k/nto/timer.hpp> 00009 #include <j2k/Fred/Error/JErrorController.hpp> 00010 #include <j2k/nto/fixprio.hpp> 00011 00012 // 200 ms 00013 #define WAITING 200000000 00014 00015 class timer_test : public my_timer 00016 { 00017 public: 00018 00019 timer_test( ULONG clk = WAITING ) 00020 : my_timer( clk ) { } 00021 00022 virtual void tick() 00023 { 00024 printf( "#" ); 00025 fflush( stdout ); 00026 } 00027 00028 }; 00029 00030 00031 int main() { 00032 timer_test tt( WAITING ); 00033 00034 tt.start(); 00035 00036 tt.join(); 00037 00038 fixprio( 6 ); 00039 00040 for(;;) { // Infinite loop 00041 sched_yield(); 00042 } 00043 00044 return 0; 00045 } 00046 00047 #endif