File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -34,4 +34,8 @@ config ARDUINO_ENTRY
3434 bool "Provide arduino setup and loop entry points"
3535 default y
3636
37+ config ARDUINO_MAX_TONES
38+ int "Specify the number of sounds that can be played simultaneously with tone()"
39+ default -1
40+
3741endif
Original file line number Diff line number Diff line change @@ -212,8 +212,8 @@ PinStatus digitalRead(pin_size_t pinNumber) {
212212 return (gpio_pin_get_dt (&arduino_pins[pinNumber]) == 1 ) ? HIGH : LOW;
213213}
214214
215- #ifndef MAX_TONE_PINS
216- #define MAX_TONE_PINS DT_PROP_LEN (DT_PATH(zephyr_user), digital_pin_gpios)
215+ #if CONFIG_MAX_TONES == -1
216+ #define CONFIG_MAX_TONES DT_PROP_LEN (DT_PATH(zephyr_user), digital_pin_gpios)
217217#endif
218218
219219#define TOGGLES_PER_CYCLE 2ULL
@@ -223,7 +223,7 @@ static struct pin_timer {
223223 uint32_t count;
224224 pin_size_t pin{pin_size_t (-1 )};
225225 bool infinity;
226- } arduino_pin_timers[MAX_TONE_PINS ];
226+ } arduino_pin_timers[CONFIG_MAX_TONES ];
227227
228228void tone_expiry_cb (struct k_timer *timer) {
229229 struct pin_timer *pt = CONTAINER_OF (timer, struct pin_timer , timer);
You can’t perform that action at this time.
0 commit comments