Skip to content

Commit 2f8ba8b

Browse files
committed
Merge branch 'dmlambo-main'
2 parents 4c9e33f + 9ac7cb1 commit 2f8ba8b

297 files changed

Lines changed: 78391 additions & 936 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

boards.txt

Lines changed: 986 additions & 908 deletions
Large diffs are not rendered by default.

cores/arduino/USBCore.cpp

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,17 @@ void EPBuffer<L>::flush()
197197
// Only start the next transmission if the device hasn't been
198198
// reset.
199199
this->txWaiting = true;
200+
#ifdef GD32F10x
201+
if (this->ep == 0) {
202+
// TODO: This is super suspect. There is some state-machining happening in the
203+
// background in the usbd driver that we have to mimick here. Oof.
204+
if (USBCore().usbDev().control.req.wLength) {
205+
USBCore().usbDev().control.ctl_state = USBD_CTL_DATA_IN;
206+
} else {
207+
USBCore().usbDev().control.ctl_state = USBD_CTL_STATUS_IN;
208+
}
209+
}
210+
#endif
200211
USBCore().usbDev().drv_handler->ep_write((uint8_t*)this->buf, this->ep, this->len());
201212
}
202213
this->reset();
@@ -503,11 +514,32 @@ void handleReset(usb_dev *usbd)
503514

504515
USBCore_::USBCore_()
505516
{
517+
/*
518+
* This is here to ensure we're in a closed state in the event the
519+
* bootloader did not close the application. This is because when
520+
* the application is open the alt function is active on the pin;
521+
* if there is no external pullup, we temporarily use the D+ pin
522+
* to signal to the host we've connected, which we can't do if the
523+
* USB application is active.
524+
*/
525+
USBD_CTL |= CTL_CLOSE;
526+
506527
/*
507528
* Use global ‘usbd’ here, instead of wrapped version, to avoid
508529
* initialization loop.
509530
*/
510531
usb_init(&desc, ClassCore::structPtr());
532+
533+
/*
534+
* After init the application may take some time to stabilize.
535+
* This is the case if the bootloader didn't reset the application
536+
* state before jumping to user code. If we service the interrupts
537+
* too quickly after reset the application loses state and becomes
538+
* unresponsive.
539+
*/
540+
volatile int i = 0;
541+
for (; i<1000;) { i++; }
542+
511543
usbd.user_data = this;
512544

513545
oldResetHandler = usbd.drv_handler->ep_reset;
@@ -785,12 +817,21 @@ void USBCore_::transcSetup(usb_dev* usbd, uint8_t ep)
785817
if (reqstat == REQ_SUPP) {
786818
if (usbd->control.req.wLength == 0) {
787819
/* USB control transfer status in stage */
820+
#ifdef GD32F10x
821+
usbd->control.ctl_state = USBD_CTL_STATUS_IN;
822+
#endif
788823
this->sendZLP(usbd, 0);
789824
} else {
790825
if (usbd->control.req.bmRequestType & USB_TRX_IN) {
826+
#ifdef GD32F10x
827+
usbd->control.ctl_state = USBD_CTL_DATA_IN;
828+
#endif
791829
usbd_ep_send(usbd, 0, usbd->transc_in[0].xfer_buf, usbd->transc_in[0].xfer_len);
792830
} else {
793831
/* USB control transfer data out stage */
832+
#ifdef GD32F10x
833+
usbd->control.ctl_state = USBD_CTL_DATA_OUT;
834+
#endif
794835
this->sendZLP(usbd, 0);
795836
// TODO: this is a vestige of the copy from GD’s
796837
//source. Unfortunately, it runs afoul of pluggable

cores/arduino/analog.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ OF SUCH DAMAGE.
5454
#define ADC_NUMS 1
5555
#elif defined(GD32E23x)
5656
#define ADC_NUMS 1
57+
#elif defined(GD32F10x)
58+
#define ADC_NUMS 3
5759
#elif defined(GD32E50X)
5860
#ifdef ADC2
5961
#define ADC_NUMS 3
@@ -113,9 +115,9 @@ void set_dac_value(PinName pinname, uint16_t value)
113115
DAC_[index].isactive = true;
114116
} else {
115117
//set dac value
116-
#if defined(GD32F30x) || (defined(GD32F1x0) && defined(GD32F170_190)) || defined(GD32E50X)
118+
#if defined(GD32F30x) || (defined(GD32F1x0) && defined(GD32F170_190)) || defined(GD32E50X) || defined(GD32F10x)
117119
dac_data_set(dac_periph, DAC_ALIGN_12B_R, value);
118-
#elif defined(GD32F10x) && !defined(GD32F170_190)
120+
#elif defined(GD32F1x0) && !defined(GD32F170_190)
119121
dac0_data_set(DAC_ALIGN_12B_R, value);
120122
#elif defined(GD32F3x0)
121123
dac_data_set(DAC_ALIGN_12B_R, value);

cores/arduino/gd32/PinNames.h

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@
2424
extern "C" {
2525
#endif
2626

27+
#define ALT1 0x1000
28+
#define ALT2 0x2000
29+
#define ALT3 0x3000
30+
#define ALT4 0x4000
31+
#define ALT5 0x5000
32+
#define ALT6 0x6000
33+
#define ALT7 0x7000
34+
#define ALTMASK 0x7000
35+
2736
typedef enum {
2837
#if defined GPIOA
2938
PORTA_0 = 0x00,
@@ -200,6 +209,11 @@ typedef enum {
200209
ADC_TEMP = 0xF0,
201210
ADC_VREF = 0xF1,
202211

212+
// pin names specific to the variant
213+
#if __has_include("PinNamesVar.h")
214+
#include "PinNamesVar.h"
215+
#endif
216+
203217
NC = (int)0xFFFFFFFF
204218
} PinName;
205219

@@ -219,46 +233,46 @@ struct gpio_function {
219233
configure the speed, mode, pull, speed, af and remap function of pins
220234
the parameter function contains the configuration information,show as below
221235
bit 0:2 gpio mode input / output / af / analog
222-
bit 3:8 remap
223-
bit 9:10 gpio speed
224-
bit 11 output push-pull / open drain
225-
bit 12:13 no pull, pull-up, pull-down
226-
bit 14:17 channel af function
227-
bit 18:22 channel of adc/timer/dac
228-
bit 23 PWM channel-ON
229-
bit 24:31 reserved
236+
bit 3:9 remap
237+
bit 10:11 gpio speed
238+
bit 12 output push-pull / open drain
239+
bit 13:14 no pull, pull-up, pull-down
240+
bit 15:18 channel af function
241+
bit 19:23 channel of adc/timer/dac
242+
bit 24 PWM channel-ON
243+
bit 25:31 reserved
230244
*/
231245
typedef enum {
232246
/* pin mode */
233247
PIN_MODE_SHIFT = 0,
234248
PIN_MODE_MASK = 0x07,
235249

236250
/* pin seed */
237-
PIN_SPEED_SHIFT = 9,
251+
PIN_SPEED_SHIFT = 10,
238252
PIN_SPEED_MASK = 0x03,
239253

240-
/* pin remap */
254+
/* pin remap, including disable bit */
241255
PIN_REMAP_SHIFT = 3,
242-
PIN_REMAP_MASK = 0x3F,
256+
PIN_REMAP_MASK = 0x7F,
243257

244258
/* pin output mode */
245-
PIN_OUTPUT_MODE_SHIFT = 11,
259+
PIN_OUTPUT_MODE_SHIFT = 12,
246260
PIN_OUTPUT_MODE_MASK = 0x01,
247261

248262
/* pin pull_up_down */
249-
PIN_PULL_STATE_SHIFT = 12,
263+
PIN_PULL_STATE_SHIFT = 13,
250264
PIN_PULL_STATE_MASK = 0x03,
251265

252266
/* pin af */
253-
PIN_AF_SHIFT = 14,
267+
PIN_AF_SHIFT = 15,
254268
PIN_AF_MASK = 0xFF,
255269

256270
/* pin channel */
257-
PIN_CHANNEL_SHIFT = 18,
271+
PIN_CHANNEL_SHIFT = 19,
258272
PIN_CHANNEL_MASK = 0x1F,
259273

260274
/* pin PWM channel-ON state */
261-
PIN_CHON_SHIFT = 23,
275+
PIN_CHON_SHIFT = 24,
262276
PIN_CHON_MASK = 0x01,
263277
} PinFunctionDivide;
264278

@@ -277,16 +291,13 @@ typedef enum {
277291
#define GD_PIN_CHANNEL_GET(X) ((X >> PIN_CHANNEL_SHIFT) & PIN_CHANNEL_MASK)
278292
#define GD_PIN_CHON_GET(X) ((X >> PIN_CHON_SHIFT) & PIN_CHON_MASK)
279293

280-
281-
282294
// This typedef is used to extend the PinMode typedef enum
283295
// in the ArduinoAPI, since they don't have contants
284296
typedef enum {
285297
INPUT_ANALOG = 99, // We assume that the Arduino core will never have 99 PinModes
286298
OUTPUT_OPEN_DRAIN // It'd be cleaner to be able to count the size of that enum
287299
} PinModeExtension;
288300

289-
290301
typedef enum {
291302
PIN_MODE_INPUT = 0,
292303
PIN_MODE_AIN = 0,
@@ -328,6 +339,7 @@ enum {
328339
((CHN & PIN_CHANNEL_MASK) << PIN_CHANNEL_SHIFT) | ((CHON & PIN_CHON_MASK) << PIN_CHON_SHIFT))
329340
#define GD_PIN_FUNCTION3(MODE, ODPP, AFN) ((int)(MODE & PIN_MODE_MASK) | ((ODPP & PIN_OUTPUT_MODE_MASK) << PIN_OUTPUT_MODE_SHIFT) | ((AFN & PIN_AF_MASK) << PIN_AF_SHIFT))
330341
#define GD_PIN_FUNCTION4(MODE, ODPP, PUPD, AFN) ((int)(MODE & PIN_MODE_MASK) | ((ODPP & PIN_OUTPUT_MODE_MASK) << PIN_OUTPUT_MODE_SHIFT) | ((PUPD & PIN_PULL_STATE_MASK) << PIN_PULL_STATE_SHIFT ) | ((AFN & PIN_AF_MASK) << PIN_AF_SHIFT))
342+
#define GD_PIN_FUNCTION5(MODE, ODPP, PUPD, REMAP) ((int)(MODE & PIN_MODE_MASK) | ((ODPP & PIN_OUTPUT_MODE_MASK) << PIN_OUTPUT_MODE_SHIFT) | ((PUPD & PIN_PULL_STATE_MASK) << PIN_PULL_STATE_SHIFT ) | ((REMAP & PIN_REMAP_MASK) << PIN_REMAP_SHIFT))
331343
#define GD_PIN_FUNC_ANALOG_CH(CHN) ((int)(PIN_MODE_ANALOG & PIN_MODE_MASK) |\
332344
((CHN & PIN_CHANNEL_MASK) << PIN_CHANNEL_SHIFT) |\
333345
(((int)PIN_PUPD_NONE & PIN_PULL_STATE_MASK) << PIN_PULL_STATE_SHIFT))

cores/arduino/gd32/Source/gd32xxyy_src.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,30 @@
7777
#include "gd32f1x0_ivref.c"
7878
#include "gd32f1x0_can.c"
7979
#endif /* GD32F170_190 */
80+
#elif defined(GD32F10x)
81+
#include "gd32f10x_adc.c"
82+
#include "gd32f10x_bkp.c"
83+
#include "gd32f10x_can.c"
84+
#include "gd32f10x_crc.c"
85+
#include "gd32f10x_dac.c"
86+
#include "gd32f10x_dbg.c"
87+
#include "gd32f10x_dma.c"
88+
#include "gd32f10x_enet.c"
89+
#include "gd32f10x_exmc.c"
90+
#include "gd32f10x_exti.c"
91+
#include "gd32f10x_fmc.c"
92+
#include "gd32f10x_fwdgt.c"
93+
#include "gd32f10x_gpio.c"
94+
#include "gd32f10x_i2c.c"
95+
#include "gd32f10x_misc.c"
96+
#include "gd32f10x_pmu.c"
97+
#include "gd32f10x_rcu.c"
98+
#include "gd32f10x_rtc.c"
99+
#include "gd32f10x_sdio.c"
100+
#include "gd32f10x_spi.c"
101+
#include "gd32f10x_timer.c"
102+
#include "gd32f10x_usart.c"
103+
#include "gd32f10x_wwdgt.c"
80104
#elif defined(GD32E23x)
81105
#include "gd32e23x_adc.c"
82106
#include "gd32e23x_cmp.c"
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*!
2+
\file gd32f10x_libopt.h
3+
\brief library optional for gd32f10x
4+
5+
\version 2014-12-26, V1.0.0, firmware for GD32F10x
6+
\version 2017-06-20, V2.0.0, firmware for GD32F10x
7+
\version 2018-07-31, V2.1.0, firmware for GD32F10x
8+
*/
9+
10+
/*
11+
Copyright (c) 2018, GigaDevice Semiconductor Inc.
12+
13+
All rights reserved.
14+
15+
Redistribution and use in source and binary forms, with or without modification,
16+
are permitted provided that the following conditions are met:
17+
18+
1. Redistributions of source code must retain the above copyright notice, this
19+
list of conditions and the following disclaimer.
20+
2. Redistributions in binary form must reproduce the above copyright notice,
21+
this list of conditions and the following disclaimer in the documentation
22+
and/or other materials provided with the distribution.
23+
3. Neither the name of the copyright holder nor the names of its contributors
24+
may be used to endorse or promote products derived from this software without
25+
specific prior written permission.
26+
27+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
29+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
30+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
31+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
32+
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
34+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
36+
OF SUCH DAMAGE.
37+
*/
38+
39+
#ifndef GD32F10X_LIBOPT_H
40+
#define GD32F10X_LIBOPT_H
41+
42+
#include "gd32f10x_adc.h"
43+
#include "gd32f10x_bkp.h"
44+
#include "gd32f10x_can.h"
45+
#include "gd32f10x_crc.h"
46+
#include "gd32f10x_dac.h"
47+
#include "gd32f10x_dma.h"
48+
#include "gd32f10x_enet.h"
49+
#include "gd32f10x_exmc.h"
50+
#include "gd32f10x_exti.h"
51+
#include "gd32f10x_fmc.h"
52+
#include "gd32f10x_gpio.h"
53+
#include "gd32f10x_i2c.h"
54+
#include "gd32f10x_fwdgt.h"
55+
#include "gd32f10x_dbg.h"
56+
#include "gd32f10x_misc.h"
57+
#include "gd32f10x_pmu.h"
58+
#include "gd32f10x_rcu.h"
59+
#include "gd32f10x_rtc.h"
60+
#include "gd32f10x_sdio.h"
61+
#include "gd32f10x_spi.h"
62+
#include "gd32f10x_timer.h"
63+
#include "gd32f10x_usart.h"
64+
#include "gd32f10x_wwdgt.h"
65+
66+
#endif /* GD32F10X_LIBOPT_H */
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
__REMAP_NAME__(SPI0_REMAP) /*!< SPI0 remapping */
2+
__REMAP_NAME__(I2C0_REMAP) /*!< I2C0 remapping */
3+
__REMAP_NAME__(USART0_REMAP) /*!< USART0 remapping */
4+
__REMAP_NAME__(USART1_REMAP) /*!< USART1 remapping */
5+
__REMAP_NAME__(USART2_PARTIAL_REMAP) /*!< USART2 partial remapping */
6+
__REMAP_NAME__(USART2_FULL_REMAP) /*!< USART2 full remapping */
7+
__REMAP_NAME__(TIMER0_PARTIAL_REMAP) /*!< TIMER0 partial remapping */
8+
__REMAP_NAME__(TIMER0_FULL_REMAP) /*!< TIMER0 full remapping */
9+
__REMAP_NAME__(TIMER1_PARTIAL_REMAP0) /*!< TIMER1 partial remapping */
10+
__REMAP_NAME__(TIMER1_PARTIAL_REMAP1) /*!< TIMER1 partial remapping */
11+
__REMAP_NAME__(TIMER1_FULL_REMAP) /*!< TIMER1 full remapping */
12+
__REMAP_NAME__(TIMER2_PARTIAL_REMAP) /*!< TIMER2 partial remapping */
13+
__REMAP_NAME__(TIMER2_FULL_REMAP) /*!< TIMER2 full remapping */
14+
__REMAP_NAME__(TIMER3_REMAP) /*!< TIMER3 remapping */
15+
__REMAP_NAME__(PD01_REMAP) /*!< PD01 remapping */
16+
#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD))
17+
__REMAP_NAME__(CAN_PARTIAL_REMAP) /*!< CAN partial remapping(only for GD32F10X_MD devices), GD32F10X_HD devices and GD32F10X_XD devices) */
18+
__REMAP_NAME__(CAN_FULL_REMAP) /*!< CAN full remapping(only for GD32F10X_MD devices), GD32F10X_HD devices and GD32F10X_XD devices) */
19+
#endif /* GD32F10X_MD||GD32F10X_HD||GD32F10X_XD */
20+
#if (defined(GD32F10X_CL) || defined(GD32F10X_HD) || defined(GD32F10X_XD))
21+
__REMAP_NAME__(SPI2_REMAP) /*!< SPI2 remapping(only for GD32F10X_CL devices) */
22+
#endif /* GD32F10X_CL||GD32F10X_HD */
23+
#if (defined(GD32F10X_CL) || defined(GD32F10X_HD))
24+
__REMAP_NAME__(TIMER4CH3_IREMAP) /*!< TIMER4 channel3 internal remapping(only for GD32F10X_CL devices and GD32F10X_HD devices) */
25+
#endif /* GD32F10X_CL||GD32F10X_HD */
26+
#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD))
27+
__REMAP_NAME__(ADC0_ETRGRT_REMAP) /*!< ADC0 external trigger routine conversion remapping(only for GD32F10X_MD devices), GD32F10X_HD devices and GD32F10X_XD devices) */
28+
__REMAP_NAME__(ADC1_ETRGRT_REMAP) /*!< ADC1 external trigger routine conversion remapping(only for GD32F10X_MD devices), GD32F10X_HD devices and GD32F10X_XD devices) */
29+
#endif /* GD32F10X_MD||GD32F10X_HD||GD32F10X_XD */
30+
__REMAP_NAME__(SWJ_NONJTRST_REMAP) /*!< full SWJ(JTAG-DP + SW-DP)),but without NJTRST */
31+
__REMAP_NAME__(SWJ_SWDPENABLE_REMAP) /*!< JTAG-DP disabled and SW-DP enabled */
32+
__REMAP_NAME__(SWJ_DISABLE_REMAP) /*!< JTAG-DP disabled and SW-DP disabled */
33+
#ifdef GD32F10X_CL
34+
__REMAP_NAME__(CAN0_PARTIAL_REMAP) /*!< CAN0 partial remapping(only for GD32F10X_CL devices) */
35+
__REMAP_NAME__(CAN0_FULL_REMAP) /*!< CAN0 full remapping(only for GD32F10X_CL devices) */
36+
__REMAP_NAME__(ENET_REMAP) /*!< ENET remapping(only for GD32F10X_CL devices) */
37+
__REMAP_NAME__(CAN1_REMAP) /*!< CAN1 remapping(only for GD32F10X_CL devices) */
38+
__REMAP_NAME__(TIMER1ITI1_REMAP) /*!< TIMER1 internal trigger 1 remapping(only for GD32F10X_CL devices) */
39+
__REMAP_NAME__(PTP_PPS_REMAP) /*!< ethernet PTP PPS remapping(only for GD32F10X_CL devices) */
40+
#endif /* GD32F10X_CL */
41+
#ifdef GD32F10X_XD
42+
__REMAP_NAME__(TIMER8_REMAP) /*!< TIMER8 remapping */
43+
__REMAP_NAME__(TIMER9_REMAP) /*!< TIMER9 remapping */
44+
__REMAP_NAME__(TIMER10_REMAP) /*!< TIMER10 remapping */
45+
__REMAP_NAME__(TIMER12_REMAP) /*!< TIMER12 remapping */
46+
__REMAP_NAME__(TIMER13_REMAP) /*!< TIMER13 remapping */
47+
__REMAP_NAME__(EXMC_NADV_REMAP) /*!< EXMC_NADV connect/disconnect */
48+
#endif /* GD32F10X_XD */

cores/arduino/gd32/pinmap.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,11 @@ void pin_function(PinName pin, int function)
7070
#if defined(GD32F30x) || defined(GD32F10x)|| defined(GD32E50X)
7171
gpio_init(gpio, GD_GPIO_MODE[mode], GD_GPIO_SPEED[speed], gd_pin);
7272
if (remap != 0) {
73+
// MSB is disable
74+
bool disable = remap & ~(PIN_REMAP_MASK >> 1);
75+
remap &= PIN_REMAP_MASK >> 1;
7376
rcu_periph_clock_enable(RCU_AF);
74-
gpio_pin_remap_config(GD_GPIO_REMAP[remap], ENABLE);
77+
gpio_pin_remap_config(GD_GPIO_REMAP[remap], disable ? DISABLE : ENABLE);
7578
}
7679
#elif defined(GD32F3x0) || defined(GD32F1x0) || defined(GD32F4xx) || defined(GD32E23x)
7780
uint32_t af = GD_PIN_AF_GET(function);

cores/arduino/gd32/pins_arduino.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ extern "C" {
2525
uint32_t PinName_to_digital(PinName p)
2626
{
2727
uint32_t i = DIGITAL_PINS_NUM;
28+
p &= ~ALTMASK;
2829
if (GD_PORT_GET(p) <= (PORTEND - 1)) {
2930
for (i = 0; i < DIGITAL_PINS_NUM; i++) {
3031
if (digital_pins[i] == p) {
@@ -62,6 +63,7 @@ bool pin_in_analog_pins(uint32_t pin)
6263
bool ret = false;
6364
#if ANALOG_PINS_NUM > 0
6465
#ifndef ANALOG_PINS_LAST
66+
pin &= ~ALTMASK;
6567
ret = (pin >= A0) && (pin < (A0 + ANALOG_PINS_NUM));
6668
#else
6769
for (uint32_t i = 0; i < ANALOG_PINS_NUM; i++) {
@@ -80,6 +82,7 @@ uint32_t digital_pin_to_analog(uint32_t pin)
8082
uint32_t ret = ANALOG_PINS_NUM;
8183
#if ANALOG_PINS_NUM > 0
8284
#ifndef ANALOG_PINS_LAST
85+
pin &= ~ALTMASK;
8386
ret = pin - A0;
8487
#else
8588
for (uint32_t i = 0; i < ANALOG_PINS_NUM; i++) {

0 commit comments

Comments
 (0)