@@ -34,42 +34,42 @@ static inline void rtapi_timespec_add(timespec &result, const timespec &ta, cons
3434}
3535
3636static inline bool rtapi_timespec_less (const struct timespec &ta, const struct timespec &tb) {
37- if (ta.tv_sec < tb.tv_sec )
38- return 1 ;
39- if (ta.tv_sec > tb.tv_sec )
40- return 0 ;
37+ if (ta.tv_sec < tb.tv_sec ) return 1 ;
38+ if (ta.tv_sec > tb.tv_sec ) return 0 ;
4139 return ta.tv_nsec < tb.tv_nsec ;
4240}
4341
4442void rtapi_timespec_advance (struct timespec &result, const struct timespec &src, unsigned long nsec);
4543
46- struct WithRoot {
44+ struct WithRoot
45+ {
4746 WithRoot ();
4847 ~WithRoot ();
4948 static std::atomic_int level;
5049};
5150
5251struct rtapi_task {
53- rtapi_task ();
52+ rtapi_task ();
5453
55- int magic; /* to check for valid handle */
56- int id;
57- int owner;
58- int uses_fp;
59- size_t stacksize;
60- int prio;
61- long period;
62- struct timespec nextstart;
63- long pll_correction;
64- long pll_correction_limit;
65- void *arg;
66- void (*taskcode)(void *); /* pointer to task function */
54+ int magic; /* to check for valid handle */
55+ int id;
56+ int owner;
57+ int uses_fp;
58+ size_t stacksize;
59+ int prio;
60+ long period;
61+ struct timespec nextstart;
62+ unsigned ratio;
63+ long pll_correction;
64+ long pll_correction_limit;
65+ void *arg;
66+ void (*taskcode) (void *); /* pointer to task function */
6767};
6868
69- struct RtapiApp {
69+ struct RtapiApp
70+ {
7071
71- RtapiApp (int policy = SCHED_OTHER) : policy(policy), period(0 ) {
72- }
72+ RtapiApp (int policy = SCHED_OTHER) : policy(policy), period(0 ) {}
7373
7474 virtual int prio_highest () const ;
7575 virtual int prio_lowest () const ;
@@ -79,11 +79,12 @@ struct RtapiApp {
7979 int prio_next_higher (int prio) const ;
8080 int prio_next_lower (int prio) const ;
8181 long clock_set_period (long int period_nsec);
82- int task_new (void (*taskcode)(void *), void *arg, int prio, int owner, unsigned long int stacksize, int uses_fp);
82+ int task_new (void (*taskcode)(void *), void *arg,
83+ int prio, int owner, unsigned long int stacksize, int uses_fp);
8384 virtual rtapi_task *do_task_new () = 0;
8485 static int allocate_task_id ();
8586 static struct rtapi_task *get_task (int task_id);
86- void unexpected_realtime_delay (rtapi_task *task, int nperiod = 1 );
87+ void unexpected_realtime_delay (rtapi_task *task, int nperiod= 1 );
8788 virtual int task_delete (int id) = 0;
8889 virtual int task_start (int task_id, unsigned long period_nsec) = 0;
8990 virtual int task_pause (int task_id) = 0;
@@ -101,20 +102,18 @@ struct RtapiApp {
101102 long period;
102103};
103104
104- template <class T = rtapi_task> T *rtapi_get_task (int task_id) {
105- return static_cast <T *>(RtapiApp::get_task (task_id));
105+ template <class T =rtapi_task>
106+ T *rtapi_get_task (int task_id) {
107+ return static_cast <T*>(RtapiApp::get_task (task_id));
106108}
107109
108110int find_rt_cpu_number ();
109- void set_namef (const char *fmt, ...);
110111
111- #define MAX_TASKS 64
112- #define TASK_MAGIC 21979 /* random numbers used as signatures */
113- #define TASK_MAGIC_INIT ((rtapi_task *)(-1 ))
112+ #define MAX_TASKS 64
113+ #define TASK_MAGIC 21979 /* random numbers used as signatures */
114+ #define TASK_MAGIC_INIT ((rtapi_task*)(-1 ))
114115
115116extern struct rtapi_task *task_array[MAX_TASKS];
116117
117- extern uid_t euid, ruid; // ToDo: Improve
118-
119118#define WITH_ROOT WithRoot root
120119#endif
0 commit comments