Skip to content

Commit a8239ea

Browse files
committed
sep
1 parent b264e2b commit a8239ea

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

cores/arduino/zephyrCommon.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -185,18 +185,18 @@ void handleGpioCallback(const struct device *port, struct gpio_callback *cb, uin
185185

186186
#ifdef CONFIG_PWM
187187

188-
#define PWM_DT_SPEC(n,p,i) PWM_DT_SPEC_GET_BY_IDX(n, i),
188+
#define PWM_DT_SPEC(n,p,i) PWM_DT_SPEC_GET_BY_IDX(n, i)
189189
#define PWM_PINS(n, p, i) \
190190
DIGITAL_PIN_GPIOS_FIND_PIN( \
191191
DT_REG_ADDR(DT_PHANDLE_BY_IDX(DT_PATH(zephyr_user), p, i)), \
192-
DT_PHA_BY_IDX(DT_PATH(zephyr_user), p, i, pin)),
192+
DT_PHA_BY_IDX(DT_PATH(zephyr_user), p, i, pin))
193193

194194
const struct pwm_dt_spec arduino_pwm[] =
195-
{ DT_FOREACH_PROP_ELEM(DT_PATH(zephyr_user), pwms, PWM_DT_SPEC) };
195+
{ DT_FOREACH_PROP_ELEM_SEP(DT_PATH(zephyr_user), pwms, PWM_DT_SPEC, (,)) };
196196

197197
/* pwm-pins node provides a mapping digital pin numbers to pwm channels */
198198
const pin_size_t arduino_pwm_pins[] =
199-
{ DT_FOREACH_PROP_ELEM(DT_PATH(zephyr_user), pwm_pin_gpios, PWM_PINS) };
199+
{ DT_FOREACH_PROP_ELEM_SEP(DT_PATH(zephyr_user), pwm_pin_gpios, ZARD_GLOBAL_GPIO_NUM, (,)) };
200200

201201
size_t pwm_pin_index(pin_size_t pinNumber) {
202202
for(size_t i=0; i<ARRAY_SIZE(arduino_pwm_pins); i++) {
@@ -211,22 +211,22 @@ size_t pwm_pin_index(pin_size_t pinNumber) {
211211

212212
#ifdef CONFIG_ADC
213213

214-
#define ADC_DT_SPEC(n,p,i) ADC_DT_SPEC_GET_BY_IDX(n, i),
214+
#define ADC_DT_SPEC(n,p,i) ADC_DT_SPEC_GET_BY_IDX(n, i)
215215
#define ADC_PINS(n, p, i) \
216216
DIGITAL_PIN_GPIOS_FIND_PIN( \
217217
DT_REG_ADDR(DT_PHANDLE_BY_IDX(DT_PATH(zephyr_user), p, i)), \
218-
DT_PHA_BY_IDX(DT_PATH(zephyr_user), p, i, pin)),
219-
#define ADC_CH_CFG(n,p,i) arduino_adc[i].channel_cfg,
218+
DT_PHA_BY_IDX(DT_PATH(zephyr_user), p, i, pin))
219+
#define ADC_CH_CFG(n,p,i) arduino_adc[i].channel_cfg
220220

221221
const struct adc_dt_spec arduino_adc[] =
222-
{ DT_FOREACH_PROP_ELEM(DT_PATH(zephyr_user), io_channels, ADC_DT_SPEC) };
222+
{ DT_FOREACH_PROP_ELEM_SEP(DT_PATH(zephyr_user), io_channels, ADC_DT_SPEC, (,)) };
223223

224224
/* io-channel-pins node provides a mapping digital pin numbers to adc channels */
225225
const pin_size_t arduino_analog_pins[] =
226-
{ DT_FOREACH_PROP_ELEM(DT_PATH(zephyr_user), adc_pin_gpios, ADC_PINS) };
226+
{ DT_FOREACH_PROP_ELEM_SEP(DT_PATH(zephyr_user), adc_pin_gpios, ZARD_GLOBAL_GPIO_NUM, (,)) };
227227

228-
struct adc_channel_cfg channel_cfg[ARRAY_SIZE(arduino_analog_pins)] =
229-
{ DT_FOREACH_PROP_ELEM(DT_PATH(zephyr_user), io_channels, ADC_CH_CFG) };
228+
struct adc_channel_cfg channel_cfg[] =
229+
{ DT_FOREACH_PROP_ELEM_SEP(DT_PATH(zephyr_user), io_channels, ADC_CH_CFG, (,)) };
230230

231231
size_t analog_pin_index(pin_size_t pinNumber) {
232232
for(size_t i=0; i<ARRAY_SIZE(arduino_analog_pins); i++) {

0 commit comments

Comments
 (0)