Commit ee08a03
committed
Use single dataReady() method, instead of accelDataReady/gyroDataReady
This method is a bit more flexible. There is a version with no
parameters, which will return true if all enabled sensors have new
data. There is one overload, that takes a single 'flags' parameter,
which returns true if all enabled *and* selected sensors have new data.
Sensors are selectable through bit flags. For example;
CurieIMU.dataReady() : this will return true if both the accel and gyro
are enabled, and both have new data ready.
CurieIMU.dataReady(ACCEL | GYRO) : this will return true if both the
accel and gyro are enabled, and both have new data ready.
CurieIMU.dataReady(GYRO) : this will return true if the gyro is
enabled and has new data ready.
CurieIMU.dataReady(ACCEL) : this will return true if the accel is
enabled and has new data ready.
This also involved changing the 'begin' method to allow selective
enabling of sensors, e.g.
CurieIMU.begin() : same as it always has, initializes IMU, enabling
both accel and gyro
CurieIMU.begin(ACCEL | GYRO) : initializes IMU, enabling both accel
and gyro
CurieIMU.begin(ACCEL) : initializes IMU, enabling accel only1 parent fb57800 commit ee08a03
File tree
5 files changed
+138
-55
lines changed- libraries/CurieIMU
- src
5 files changed
+138
-55
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
81 | 86 | | |
82 | 87 | | |
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
88 | | - | |
| 93 | + | |
89 | 94 | | |
| 95 | + | |
| 96 | + | |
90 | 97 | | |
91 | 98 | | |
92 | 99 | | |
| |||
95 | 102 | | |
96 | 103 | | |
97 | 104 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
103 | 112 | | |
104 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
105 | 122 | | |
106 | 123 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
| 124 | + | |
| 125 | + | |
112 | 126 | | |
113 | 127 | | |
114 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
115 | 132 | | |
116 | | - | |
117 | | - | |
| 133 | + | |
| 134 | + | |
118 | 135 | | |
119 | 136 | | |
120 | 137 | | |
| |||
131 | 148 | | |
132 | 149 | | |
133 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
134 | 162 | | |
135 | 163 | | |
136 | 164 | | |
| |||
330 | 358 | | |
331 | 359 | | |
332 | 360 | | |
333 | | - | |
| 361 | + | |
334 | 362 | | |
335 | 363 | | |
336 | 364 | | |
| 365 | + | |
337 | 366 | | |
338 | 367 | | |
339 | 368 | | |
| |||
362 | 391 | | |
363 | 392 | | |
364 | 393 | | |
365 | | - | |
| 394 | + | |
366 | 395 | | |
367 | 396 | | |
368 | 397 | | |
| 398 | + | |
369 | 399 | | |
370 | 400 | | |
371 | 401 | | |
| |||
2386 | 2416 | | |
2387 | 2417 | | |
2388 | 2418 | | |
2389 | | - | |
2390 | | - | |
2391 | | - | |
2392 | | - | |
2393 | | - | |
2394 | | - | |
2395 | | - | |
2396 | | - | |
2397 | | - | |
2398 | | - | |
2399 | | - | |
2400 | | - | |
2401 | | - | |
2402 | | - | |
2403 | | - | |
2404 | | - | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
270 | 276 | | |
271 | 277 | | |
272 | 278 | | |
| |||
471 | 477 | | |
472 | 478 | | |
473 | 479 | | |
474 | | - | |
| 480 | + | |
475 | 481 | | |
476 | 482 | | |
| 483 | + | |
477 | 484 | | |
478 | 485 | | |
479 | 486 | | |
| |||
487 | 494 | | |
488 | 495 | | |
489 | 496 | | |
490 | | - | |
| 497 | + | |
491 | 498 | | |
492 | | - | |
| 499 | + | |
493 | 500 | | |
494 | 501 | | |
495 | 502 | | |
| |||
640 | 647 | | |
641 | 648 | | |
642 | 649 | | |
| 650 | + | |
643 | 651 | | |
644 | 652 | | |
645 | 653 | | |
| |||
653 | 661 | | |
654 | 662 | | |
655 | 663 | | |
656 | | - | |
657 | | - | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
658 | 668 | | |
659 | 669 | | |
660 | 670 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | | - | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | | - | |
54 | | - | |
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
58 | 67 | | |
59 | 68 | | |
60 | 69 | | |
61 | 70 | | |
62 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
63 | 114 | | |
64 | 115 | | |
65 | 116 | | |
| |||
227 | 278 | | |
228 | 279 | | |
229 | 280 | | |
| 281 | + | |
230 | 282 | | |
231 | 283 | | |
232 | 284 | | |
233 | | - | |
| 285 | + | |
234 | 286 | | |
235 | 287 | | |
236 | | - | |
| 288 | + | |
237 | 289 | | |
238 | 290 | | |
239 | | - | |
| 291 | + | |
240 | 292 | | |
241 | 293 | | |
242 | | - | |
| 294 | + | |
243 | 295 | | |
244 | 296 | | |
245 | | - | |
| 297 | + | |
246 | 298 | | |
247 | 299 | | |
248 | | - | |
| 300 | + | |
249 | 301 | | |
250 | 302 | | |
251 | 303 | | |
| |||
277 | 329 | | |
278 | 330 | | |
279 | 331 | | |
| 332 | + | |
280 | 333 | | |
281 | 334 | | |
282 | 335 | | |
283 | | - | |
| 336 | + | |
284 | 337 | | |
285 | 338 | | |
286 | | - | |
| 339 | + | |
287 | 340 | | |
288 | 341 | | |
289 | | - | |
| 342 | + | |
290 | 343 | | |
291 | 344 | | |
292 | | - | |
| 345 | + | |
293 | 346 | | |
294 | 347 | | |
295 | | - | |
| 348 | + | |
296 | 349 | | |
297 | 350 | | |
298 | 351 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
100 | 104 | | |
101 | 105 | | |
102 | 106 | | |
| |||
207 | 211 | | |
208 | 212 | | |
209 | 213 | | |
| 214 | + | |
210 | 215 | | |
211 | 216 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | 217 | | |
216 | 218 | | |
217 | 219 | | |
| |||
0 commit comments