Browse Source

Use the struct pdb_config for the int_n thread

Clara Hobbs 7 years ago
parent
commit
31269f4252
3 changed files with 9 additions and 8 deletions
  1. 5
    6
      lib/src/int_n.c
  2. 3
    1
      lib/src/int_n.h
  3. 1
    1
      lib/src/pdb.c

+ 5
- 6
lib/src/int_n.c View File

32
 /*
32
 /*
33
  * INT_N polling thread
33
  * INT_N polling thread
34
  */
34
  */
35
-static THD_WORKING_AREA(waIntNPoll, 128);
36
-static THD_FUNCTION(IntNPoll, arg) {
37
-    (void) arg;
35
+static THD_FUNCTION(IntNPoll, cfg) {
36
+    (void) cfg;
38
 
37
 
39
     union fusb_status status;
38
     union fusb_status status;
40
     eventmask_t events;
39
     eventmask_t events;
84
     }
83
     }
85
 }
84
 }
86
 
85
 
87
-void pdb_int_n_run(void)
86
+void pdb_int_n_run(struct pdb_config *cfg)
88
 {
87
 {
89
-    chThdCreateStatic(waIntNPoll, sizeof(waIntNPoll), PDB_PRIO_PRL_INT_N,
90
-            IntNPoll, NULL);
88
+    cfg->int_n.thread = chThdCreateStatic(cfg->int_n._wa,
89
+            sizeof(cfg->int_n._wa), PDB_PRIO_PRL_INT_N, IntNPoll, cfg);
91
 }
90
 }

+ 3
- 1
lib/src/int_n.h View File

19
 #ifndef PDB_INT_N_OLD_H
19
 #ifndef PDB_INT_N_OLD_H
20
 #define PDB_INT_N_OLD_H
20
 #define PDB_INT_N_OLD_H
21
 
21
 
22
+#include <pdb.h>
23
+
22
 
24
 
23
 /*
25
 /*
24
  * Start the INT_N polling thread
26
  * Start the INT_N polling thread
25
  */
27
  */
26
-void pdb_int_n_run(void);
28
+void pdb_int_n_run(struct pdb_config *cfg);
27
 
29
 
28
 
30
 
29
 #endif /* PDB_INT_N_OLD_H */
31
 #endif /* PDB_INT_N_OLD_H */

+ 1
- 1
lib/src/pdb.c View File

39
     pdb_hardrst_run(/*cfg*/);
39
     pdb_hardrst_run(/*cfg*/);
40
 
40
 
41
     /* Create the INT_N thread. */
41
     /* Create the INT_N thread. */
42
-    pdb_int_n_run(/*cfg*/);
42
+    pdb_int_n_run(cfg);
43
 }
43
 }

Loading…
Cancel
Save