Commit 5f1aa69
committed
cores: arduino: zephyrCommon: rework tone slot handling and timer lifecycle
Rework tone/noTone internals to better match Arduino behavior while making
concurrent tone usage configurable and safer.
- Add CONFIG_ARDUINO_MAX_TONES (default: -1).
- Negative values fall back to the digital pin count from devicetree.
- Replace per-pin tone timer arrays with slot-based pin_timer entries.
- Remove the timeout companion timer and finish finite tones by counting
remaining toggles in tone_expiry_cb().
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>1 parent 78bcf6a commit 5f1aa69
2 files changed
Lines changed: 47 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 20 | | |
25 | 21 | | |
26 | 22 | | |
| |||
39 | 35 | | |
40 | 36 | | |
41 | 37 | | |
42 | | - | |
43 | | - | |
| 38 | + | |
| 39 | + | |
44 | 40 | | |
45 | 41 | | |
46 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
| 227 | + | |
227 | 228 | | |
228 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
229 | 235 | | |
230 | 236 | | |
231 | 237 | | |
| |||
268 | 274 | | |
269 | 275 | | |
270 | 276 | | |
| 277 | + | |
| 278 | + | |
271 | 279 | | |
272 | 280 | | |
273 | 281 | | |
274 | 282 | | |
275 | 283 | | |
276 | | - | |
277 | 284 | | |
278 | 285 | | |
279 | 286 | | |
| |||
282 | 289 | | |
283 | 290 | | |
284 | 291 | | |
| 292 | + | |
285 | 293 | | |
286 | 294 | | |
287 | 295 | | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
288 | 302 | | |
289 | 303 | | |
290 | 304 | | |
| 305 | + | |
291 | 306 | | |
292 | 307 | | |
293 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
294 | 314 | | |
295 | 315 | | |
296 | 316 | | |
297 | | - | |
| 317 | + | |
| 318 | + | |
298 | 319 | | |
| 320 | + | |
| 321 | + | |
299 | 322 | | |
300 | 323 | | |
301 | 324 | | |
302 | 325 | | |
| 326 | + | |
| 327 | + | |
303 | 328 | | |
304 | 329 | | |
305 | 330 | | |
| |||
310 | 335 | | |
311 | 336 | | |
312 | 337 | | |
313 | | - | |
| 338 | + | |
314 | 339 | | |
315 | 340 | | |
316 | 341 | | |
317 | | - | |
318 | | - | |
319 | | - | |
| 342 | + | |
320 | 343 | | |
| 344 | + | |
| 345 | + | |
321 | 346 | | |
322 | 347 | | |
323 | 348 | | |
| 349 | + | |
| 350 | + | |
324 | 351 | | |
325 | 352 | | |
326 | 353 | | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
327 | 360 | | |
328 | 361 | | |
329 | 362 | | |
| 363 | + | |
330 | 364 | | |
331 | 365 | | |
332 | 366 | | |
333 | 367 | | |
334 | 368 | | |
| 369 | + | |
| 370 | + | |
335 | 371 | | |
336 | 372 | | |
337 | 373 | | |
338 | 374 | | |
| 375 | + | |
| 376 | + | |
339 | 377 | | |
340 | 378 | | |
341 | 379 | | |
| |||
0 commit comments