Skip to content

Commit a650798

Browse files
committed
x
1 parent 5abce4e commit a650798

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cores/arduino/zephyrCommon.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ constexpr inline pin_size_t local_gpio_pin(pin_size_t gpin)
6969

7070
constexpr inline pin_size_t global_gpio_pin_(size_t port_idx, pin_size_t lpin)
7171
{
72-
return port_idx == size_t(-1) ? size_t(-1) : pins[port_idx] + lpin;
72+
return port_idx == size_t(-1) ? size_t(-1) : end_accum(port_idx) + lpin;
7373
}
7474

7575
constexpr inline pin_size_t global_gpio_pin(const struct device *lport, pin_size_t lpin)
@@ -257,7 +257,11 @@ struct pin_timer {
257257
uint32_t count;
258258
};
259259

260-
struct pin_timer arduino_pin_timers[20];
260+
#ifndef MAX_TONE_PINS
261+
#define MAX_TONE_PINS DT_PROP_LEN(DT_PATH(zephyr_user), digital_pin_gpios);
262+
#endif
263+
264+
struct pin_timer arduino_pin_timers[MAX_TONE_PINS];
261265

262266
void tone_expiry_cb(struct k_timer *timer)
263267
{

0 commit comments

Comments
 (0)