diff --git a/boards.txt b/boards.txt index f1f78147..805a5895 100644 --- a/boards.txt +++ b/boards.txt @@ -229,10 +229,6 @@ Butterfly-L433CC.menu.usb.cdc_hid=Serial + Keyboard + Mouse Butterfly-L433CC.menu.usb.cdc_hid.build.usb_type=USB_TYPE_CDC_HID Butterfly-L433CC.menu.usb.cdc_msc_hid=Serial + Mass Storage + Keyboard + Mouse Butterfly-L433CC.menu.usb.cdc_msc_hid.build.usb_type=USB_TYPE_CDC_MSC_HID -Butterfly-L433CC.menu.usb.cdc_dap=Serial + CMSIS-DAP -Butterfly-L433CC.menu.usb.cdc_dap.build.usb_type=USB_TYPE_CDC_DAP -Butterfly-L433CC.menu.usb.cdc_msc_dap=Serial + Mass Storage + CMSIS-DAP -Butterfly-L433CC.menu.usb.cdc_msc_dap.build.usb_type=USB_TYPE_CDC_MSC_DAP Butterfly-L433CC.menu.usb.none=No USB Butterfly-L433CC.menu.usb.none.build.usb_type=USB_TYPE_NONE diff --git a/cores/stm32l4/CDC.cpp b/cores/stm32l4/CDC.cpp index aa5ee0bc..fbca22ee 100644 --- a/cores/stm32l4/CDC.cpp +++ b/cores/stm32l4/CDC.cpp @@ -72,10 +72,10 @@ CDC::CDC(struct _stm32l4_usbd_cdc_t *usbd_cdc, bool serialEvent) void CDC::begin(unsigned long baudrate) { - begin(baudrate, (uint8_t)SERIAL_8N1); + begin(baudrate, SERIAL_8N1); } -void CDC::begin(unsigned long baudrate, uint16_t config) +void CDC::begin(unsigned long baudrate, uint32_t config) { /* If USBD_CDC has already been enabled/initialized by STDIO, just add the notify. */ diff --git a/cores/stm32l4/HardwareSerial.h b/cores/stm32l4/HardwareSerial.h index 655bc84b..7f8d35f2 100644 --- a/cores/stm32l4/HardwareSerial.h +++ b/cores/stm32l4/HardwareSerial.h @@ -57,7 +57,7 @@ class HardwareSerial : public Stream { public: virtual void begin(unsigned long); - virtual void begin(unsigned long baudrate, uint16_t config); + virtual void begin(unsigned long baudrate, uint32_t config); virtual void end(); virtual int available(void) = 0; virtual int peek(void) = 0; diff --git a/cores/stm32l4/STM32.cpp b/cores/stm32l4/STM32.cpp index e943390b..27f914eb 100644 --- a/cores/stm32l4/STM32.cpp +++ b/cores/stm32l4/STM32.cpp @@ -67,8 +67,8 @@ float STM32Class::getVBAT() stm32l4_adc_enable(&stm32l4_adc, 0, NULL, NULL, 0); } - vref_data = stm32l4_adc_convert(&stm32l4_adc, ADC_CHANNEL_ADC1_VREFINT); - vbat_data = stm32l4_adc_convert(&stm32l4_adc, ADC_CHANNEL_ADC1_VBAT); + vref_data = stm32l4_adc_convert(&stm32l4_adc, ADC_CHANNEL_ADC1_VREFINT, ADC_VREFINT_PERIOD); + vbat_data = stm32l4_adc_convert(&stm32l4_adc, ADC_CHANNEL_ADC1_VBAT, ADC_VBAT_PERIOD); stm32l4_adc_disable(&stm32l4_adc); @@ -93,7 +93,7 @@ float STM32Class::getVREF() stm32l4_adc_enable(&stm32l4_adc, 0, NULL, NULL, 0); } - vref_data = stm32l4_adc_convert(&stm32l4_adc, ADC_CHANNEL_ADC1_VREFINT); + vref_data = stm32l4_adc_convert(&stm32l4_adc, ADC_CHANNEL_ADC1_VREFINT, ADC_VREFINT_PERIOD); stm32l4_adc_disable(&stm32l4_adc); @@ -118,8 +118,8 @@ float STM32Class::getTemperature() stm32l4_adc_enable(&stm32l4_adc, 0, NULL, NULL, 0); } - vref_data = stm32l4_adc_convert(&stm32l4_adc, ADC_CHANNEL_ADC1_VREFINT); - ts_data = stm32l4_adc_convert(&stm32l4_adc, ADC_CHANNEL_ADC1_TS); + vref_data = stm32l4_adc_convert(&stm32l4_adc, ADC_CHANNEL_ADC1_VREFINT, ADC_VREFINT_PERIOD); + ts_data = stm32l4_adc_convert(&stm32l4_adc, ADC_CHANNEL_ADC1_TS, ADC_TSENSE_PERIOD); stm32l4_adc_disable(&stm32l4_adc); diff --git a/cores/stm32l4/USBAPI.h b/cores/stm32l4/USBAPI.h index d4ccde73..479dc638 100644 --- a/cores/stm32l4/USBAPI.h +++ b/cores/stm32l4/USBAPI.h @@ -59,7 +59,7 @@ class CDC : public HardwareSerial public: CDC(struct _stm32l4_usbd_cdc_t *usbd_cdc, bool serialEvent); void begin(unsigned long baudRate); - void begin(unsigned long baudrate, uint16_t config); + void begin(unsigned long baudrate, uint32_t config); void end(void); int available(void); diff --git a/cores/stm32l4/Uart.cpp b/cores/stm32l4/Uart.cpp index 102caa69..c56c3284 100644 --- a/cores/stm32l4/Uart.cpp +++ b/cores/stm32l4/Uart.cpp @@ -61,7 +61,7 @@ void Uart::begin(unsigned long baudrate) begin(baudrate, SERIAL_8N1, &_rx_data[0], sizeof(_rx_data)); } -void Uart::begin(unsigned long baudrate, uint16_t config) +void Uart::begin(unsigned long baudrate, uint32_t config) { begin(baudrate, config, &_rx_data[0], sizeof(_rx_data)); } @@ -71,7 +71,7 @@ void Uart::begin(unsigned long baudrate, uint8_t *buffer, size_t size) begin(baudrate, SERIAL_8N1, buffer, size); } -void Uart::begin(unsigned long baudrate, uint16_t config, uint8_t *buffer, size_t size) +void Uart::begin(unsigned long baudrate, uint32_t config, uint8_t *buffer, size_t size) { if (_uart->state != UART_STATE_INIT) { flush(); diff --git a/cores/stm32l4/Uart.h b/cores/stm32l4/Uart.h index 3a3bf42e..20ed7de0 100644 --- a/cores/stm32l4/Uart.h +++ b/cores/stm32l4/Uart.h @@ -38,9 +38,9 @@ class Uart : public HardwareSerial public: Uart(struct _stm32l4_uart_t *uart, unsigned int instance, const struct _stm32l4_uart_pins_t *pins, unsigned int priority, unsigned int mode, bool serialEvent); void begin(unsigned long baudRate); - void begin(unsigned long baudrate, uint16_t config); + void begin(unsigned long baudrate, uint32_t config); void begin(unsigned long baudRate, uint8_t *buffer, size_t size); - void begin(unsigned long baudrate, uint16_t config, uint8_t *buffer, size_t size); + void begin(unsigned long baudrate, uint32_t config, uint8_t *buffer, size_t size); void end(); int available(); int availableForWrite(void); diff --git a/cores/stm32l4/stm32l4_wiring.h b/cores/stm32l4/stm32l4_wiring.h index a07761ed..5081c8fe 100644 --- a/cores/stm32l4/stm32l4_wiring.h +++ b/cores/stm32l4/stm32l4_wiring.h @@ -84,6 +84,7 @@ typedef enum _eAnalogReference { extern void analogReference(eAnalogReference reference); extern void analogReadResolution(int resolution); +extern void analogReadPeriod(int period); extern uint32_t analogRead(uint32_t pin); extern void analogWriteResolution(int resolution); extern void analogWriteFrequency(uint32_t pin, uint32_t frequency); diff --git a/cores/stm32l4/stm32l4_wiring_analog.c b/cores/stm32l4/stm32l4_wiring_analog.c index f7b3f635..ef6f7a2c 100644 --- a/cores/stm32l4/stm32l4_wiring_analog.c +++ b/cores/stm32l4/stm32l4_wiring_analog.c @@ -38,7 +38,10 @@ static stm32l4_dac_t stm32l4_dac; #endif /* defined(PIN_DAC0) || defined(PIN_DAC1) */ static stm32l4_timer_t stm32l4_pwm[PWM_INSTANCE_COUNT]; +static uint8_t _channels[PWM_INSTANCE_COUNT]; + static int _readResolution = 10; +static int _readPeriod = 2; static int _writeResolution = 8; static uint32_t _writeFrequency[PWM_INSTANCE_COUNT]; @@ -46,8 +49,11 @@ static uint32_t _writeRange[PWM_INSTANCE_COUNT]; static uint8_t _writeCalibrate = 3; +bool _analogReadFast = false; + void analogReference(eAnalogReference reference) { + (void)reference; } void analogReadResolution(int resolution) @@ -55,6 +61,11 @@ void analogReadResolution(int resolution) _readResolution = resolution; } +void analogReadPeriod(int period) +{ + _readPeriod = period; +} + static inline uint32_t mapResolution(uint32_t value, uint32_t from, uint32_t to) { if (from == to) @@ -106,16 +117,19 @@ uint32_t analogRead(uint32_t pin) stm32l4_adc_enable(&stm32l4_adc, 0, NULL, NULL, 0); stm32l4_adc_calibrate(&stm32l4_adc); } - else + else if (stm32l4_adc.state != ADC_STATE_READY) { stm32l4_adc_enable(&stm32l4_adc, 0, NULL, NULL, 0); } stm32l4_gpio_pin_configure(g_APinDescription[pin].pin, (GPIO_PUPD_NONE | GPIO_MODE_ANALOG | GPIO_ANALOG_SWITCH)); - input = stm32l4_adc_convert(&stm32l4_adc, g_APinDescription[pin].adc_input); + input = stm32l4_adc_convert(&stm32l4_adc, g_APinDescription[pin].adc_input, _readPeriod); - stm32l4_adc_disable(&stm32l4_adc); + if (!_analogReadFast) + { + stm32l4_adc_disable(&stm32l4_adc); + } return mapResolution(input, 12, _readResolution); } @@ -264,32 +278,6 @@ void analogWrite(uint32_t pin, uint32_t value) { instance = g_APinDescription[pin].pwm_instance; - if (stm32l4_pwm[instance].state == TIMER_STATE_NONE) - { - stm32l4_timer_create(&stm32l4_pwm[instance], g_PWMInstances[instance], STM32L4_PWM_IRQ_PRIORITY, 0); - - if (_writeFrequency[instance] && _writeRange[instance]) - { - carrier = _writeFrequency[instance] * _writeRange[instance]; - modulus = _writeRange[instance]; - } - else - { - carrier = 2000000; - modulus = 4095; - } - - divider = stm32l4_timer_clock(&stm32l4_pwm[instance]) / carrier; - - if (divider == 0) - { - divider = 1; - } - - stm32l4_timer_enable(&stm32l4_pwm[instance], divider -1, modulus -1, 0, NULL, NULL, 0); - stm32l4_timer_start(&stm32l4_pwm[instance], false); - } - if (_writeFrequency[instance] && _writeRange[instance]) { if (value > _writeRange[instance]) @@ -302,9 +290,44 @@ void analogWrite(uint32_t pin, uint32_t value) value = mapResolution(value, _writeResolution, 12); } - stm32l4_gpio_pin_configure(g_APinDescription[pin].pin, (GPIO_PUPD_NONE | GPIO_OSPEED_HIGH | GPIO_OTYPE_PUSHPULL | GPIO_MODE_ALTERNATE)); + if (_channels[instance] & (1u << g_APinDescription[pin].pwm_channel)) + { + stm32l4_timer_compare(&stm32l4_pwm[instance], g_APinDescription[pin].pwm_channel, value); + } + else + { + _channels[instance] |= (1u << g_APinDescription[pin].pwm_channel); - stm32l4_timer_channel(&stm32l4_pwm[instance], g_APinDescription[pin].pwm_channel, value, TIMER_CONTROL_PWM); + if (stm32l4_pwm[instance].state == TIMER_STATE_NONE) + { + stm32l4_timer_create(&stm32l4_pwm[instance], g_PWMInstances[instance], STM32L4_PWM_IRQ_PRIORITY, 0); + + if (_writeFrequency[instance] && _writeRange[instance]) + { + carrier = _writeFrequency[instance] * _writeRange[instance]; + modulus = _writeRange[instance]; + } + else + { + carrier = 2000000; + modulus = 4095; + } + + divider = stm32l4_timer_clock(&stm32l4_pwm[instance]) / carrier; + + if (divider == 0) + { + divider = 1; + } + + stm32l4_timer_enable(&stm32l4_pwm[instance], divider -1, modulus -1, 0, NULL, NULL, 0); + stm32l4_timer_start(&stm32l4_pwm[instance], false); + } + + stm32l4_gpio_pin_configure(g_APinDescription[pin].pin, (GPIO_PUPD_NONE | GPIO_OSPEED_HIGH | GPIO_OTYPE_PUSHPULL | GPIO_MODE_ALTERNATE)); + + stm32l4_timer_channel(&stm32l4_pwm[instance], g_APinDescription[pin].pwm_channel, value, TIMER_CONTROL_PWM); + } return; } diff --git a/libraries/Wire/src/Wire.cpp b/libraries/Wire/src/Wire.cpp index 35b43d8c..b5fb7fa9 100644 --- a/libraries/Wire/src/Wire.cpp +++ b/libraries/Wire/src/Wire.cpp @@ -404,10 +404,13 @@ void TwoWire::EventCallback(uint32_t events) if (events & I2C_EVENT_TRANSMIT_REQUEST) { _tx_write = 0; + _tx_active = true; if(_requestCallback) { (*_requestCallback)(); } + + _tx_active = false; stm32l4_i2c_service(_i2c, &_tx_data[0], _tx_write); } diff --git a/system/STM32L4xx/Include/stm32l4_adc.h b/system/STM32L4xx/Include/stm32l4_adc.h index d9d57f4e..744cdf2f 100644 --- a/system/STM32L4xx/Include/stm32l4_adc.h +++ b/system/STM32L4xx/Include/stm32l4_adc.h @@ -71,6 +71,10 @@ enum { typedef void (*stm32l4_adc_callback_t)(void *context, uint32_t events); +#define ADC_VREFINT_PERIOD 4 +#define ADC_VBAT_PERIOD 12 +#define ADC_TSENSE_PERIOD 5 + #define ADC_STATE_NONE 0 #define ADC_STATE_INIT 1 #define ADC_STATE_BUSY 2 @@ -93,7 +97,7 @@ extern bool stm32l4_adc_disable(stm32l4_adc_t *adc); extern bool stm32l4_adc_configure(stm32l4_adc_t *adc, uint32_t option); extern bool stm32l4_adc_calibrate(stm32l4_adc_t *adc); extern bool stm32l4_adc_notify(stm32l4_adc_t *adc, stm32l4_adc_callback_t callback, void *context, uint32_t events); -extern uint32_t stm32l4_adc_convert(stm32l4_adc_t *adc, unsigned int channel); +extern uint32_t stm32l4_adc_convert(stm32l4_adc_t *adc, unsigned int channel, unsigned int period); #ifdef __cplusplus } diff --git a/system/STM32L4xx/Lib/boot_stm32l432.o b/system/STM32L4xx/Lib/boot_stm32l432.o index 04047833..ef7e5781 100644 Binary files a/system/STM32L4xx/Lib/boot_stm32l432.o and b/system/STM32L4xx/Lib/boot_stm32l432.o differ diff --git a/system/STM32L4xx/Lib/boot_stm32l433.o b/system/STM32L4xx/Lib/boot_stm32l433.o index 2da51d7f..d47e2e5a 100644 Binary files a/system/STM32L4xx/Lib/boot_stm32l433.o and b/system/STM32L4xx/Lib/boot_stm32l433.o differ diff --git a/system/STM32L4xx/Lib/boot_stm32l476.o b/system/STM32L4xx/Lib/boot_stm32l476.o index 14d08e72..4f7ec2b6 100644 Binary files a/system/STM32L4xx/Lib/boot_stm32l476.o and b/system/STM32L4xx/Lib/boot_stm32l476.o differ diff --git a/system/STM32L4xx/Lib/boot_stm32l496.o b/system/STM32L4xx/Lib/boot_stm32l496.o index aabbe79d..d86df554 100644 Binary files a/system/STM32L4xx/Lib/boot_stm32l496.o and b/system/STM32L4xx/Lib/boot_stm32l496.o differ diff --git a/system/STM32L4xx/Lib/libstm32l432.a b/system/STM32L4xx/Lib/libstm32l432.a index 77057ec3..316c4cd8 100644 Binary files a/system/STM32L4xx/Lib/libstm32l432.a and b/system/STM32L4xx/Lib/libstm32l432.a differ diff --git a/system/STM32L4xx/Lib/libstm32l433.a b/system/STM32L4xx/Lib/libstm32l433.a index 9a3eb630..0bf071a9 100644 Binary files a/system/STM32L4xx/Lib/libstm32l433.a and b/system/STM32L4xx/Lib/libstm32l433.a differ diff --git a/system/STM32L4xx/Lib/libstm32l476.a b/system/STM32L4xx/Lib/libstm32l476.a index 639ffb5b..1f29ed4a 100644 Binary files a/system/STM32L4xx/Lib/libstm32l476.a and b/system/STM32L4xx/Lib/libstm32l476.a differ diff --git a/system/STM32L4xx/Lib/libstm32l496.a b/system/STM32L4xx/Lib/libstm32l496.a index 3b8f4d84..fde2f242 100644 Binary files a/system/STM32L4xx/Lib/libstm32l496.a and b/system/STM32L4xx/Lib/libstm32l496.a differ diff --git a/system/STM32L4xx/Source/stm32l4_adc.c b/system/STM32L4xx/Source/stm32l4_adc.c index 55681a9a..011b753a 100644 --- a/system/STM32L4xx/Source/stm32l4_adc.c +++ b/system/STM32L4xx/Source/stm32l4_adc.c @@ -282,10 +282,10 @@ bool stm32l4_adc_calibrate(stm32l4_adc_t *adc) return true; } -uint32_t stm32l4_adc_convert(stm32l4_adc_t *adc, unsigned int channel) +uint32_t stm32l4_adc_convert(stm32l4_adc_t *adc, unsigned int channel, unsigned int period) { ADC_TypeDef *ADCx = adc->ADCx; - uint32_t convert, adc_smp; + uint32_t convert, threshold, adcclk, adc_smp; if (adc->state != ADC_STATE_READY) { @@ -296,51 +296,64 @@ uint32_t stm32l4_adc_convert(stm32l4_adc_t *adc, unsigned int channel) * calibration and first conversion or between 2 consecutive conversions is too long. */ - if ((adc->instance == ADC_INSTANCE_ADC1) && - ((channel == ADC_CHANNEL_ADC1_TS) || (channel == ADC_CHANNEL_ADC1_VBAT) || (channel == ADC_CHANNEL_ADC1_VREFINT))) + if ((adc->instance == ADC_INSTANCE_ADC1) && (channel == ADC_CHANNEL_ADC1_TS)) { - if (channel == ADC_CHANNEL_ADC1_TS) - { - ADCx->CR |= ADC_CR_ADDIS; + ADCx->CR |= ADC_CR_ADDIS; - while (ADCx->CR & ADC_CR_ADEN) - { - } + while (ADCx->CR & ADC_CR_ADEN) + { + } #if defined(STM32L476xx) || defined(STM32L496xx) - armv7m_atomic_or(&ADC123_COMMON->CCR, ADC_CCR_TSEN); + armv7m_atomic_or(&ADC123_COMMON->CCR, ADC_CCR_TSEN); #else /* defined(STM32L476xx) || defined(STM32L496xx) */ - armv7m_atomic_or(&ADC1_COMMON->CCR, ADC_CCR_TSEN); + armv7m_atomic_or(&ADC1_COMMON->CCR, ADC_CCR_TSEN); #endif /* defined(STM32L476xx) || defined(STM32L496xx) */ - ADCx->ISR = ADC_ISR_ADRDY; - - do - { - ADCx->CR |= ADC_CR_ADEN; - } - while (!(ADCx->ISR & ADC_ISR_ADRDY)); - - armv7m_core_udelay(120); + ADCx->ISR = ADC_ISR_ADRDY; - /* min time is 5us */ - adc_smp = ADC_SAMPLE_TIME_247_5; - } - else if (channel == ADC_CHANNEL_ADC1_VBAT) - { - /* min time is 12us */ - adc_smp = ADC_SAMPLE_TIME_640_5; - } - else + do { - adc_smp = ADC_SAMPLE_TIME_47_5; + ADCx->CR |= ADC_CR_ADEN; } + while (!(ADCx->ISR & ADC_ISR_ADRDY)); + + armv7m_core_udelay(120); + } + + if ((stm32l4_system_hclk() <= 48000000) && (stm32l4_system_hclk() == stm32l4_system_sysclk())) + { + adcclk = stm32l4_system_hclk(); } else { - adc_smp = ADC_SAMPLE_TIME_47_5; + adcclk = stm32l4_system_hclk() / 2; } + /* period is in uS. 1e6 / adcclk is one tick in terms of uS. + * + * (period * adcclk) / 1e6 is the threshold for the sampling time. + * + * The upper limit for period is 50uS, and adcclk limited to 48MHz, + * which means no overflow handling is needed. + */ + + if (period > 50) + { + period = 50; + } + + threshold = ((uint32_t)period * adcclk); + + if (threshold < (uint32_t)( 2.5 * 1e6)) { adc_smp = ADC_SAMPLE_TIME_2_5; } + else if (threshold < (uint32_t)( 6.5 * 1e6)) { adc_smp = ADC_SAMPLE_TIME_6_5; } + else if (threshold < (uint32_t)( 12.5 * 1e6)) { adc_smp = ADC_SAMPLE_TIME_12_5; } + else if (threshold < (uint32_t)( 24.5 * 1e6)) { adc_smp = ADC_SAMPLE_TIME_24_5; } + else if (threshold < (uint32_t)( 47.5 * 1e6)) { adc_smp = ADC_SAMPLE_TIME_47_5; } + else if (threshold < (uint32_t)( 92.5 * 1e6)) { adc_smp = ADC_SAMPLE_TIME_92_5; } + else if (threshold < (uint32_t)(247.5 * 1e6)) { adc_smp = ADC_SAMPLE_TIME_247_5; } + else { adc_smp = ADC_SAMPLE_TIME_640_5; } + ADCx->SQR1 = (channel << 6); ADCx->SMPR1 = (channel < 10) ? (adc_smp << (channel * 3)) : 0; ADCx->SMPR2 = (channel >= 10) ? (adc_smp << ((channel * 3) - 30)) : 0; diff --git a/variants/STM32L433CC-Butterfly/variant.cpp b/variants/STM32L433CC-Butterfly/variant.cpp index 37bb0e42..eff7126e 100644 --- a/variants/STM32L433CC-Butterfly/variant.cpp +++ b/variants/STM32L433CC-Butterfly/variant.cpp @@ -45,13 +45,8 @@ extern const PinDescription g_APinDescription[NUM_TOTAL_PINS] = { GPIOB, GPIO_PIN_MASK(GPIO_PIN_PB12), GPIO_PIN_PB12, (PIN_ATTR_EXTI), PWM_INSTANCE_NONE, PWM_CHANNEL_NONE, ADC_INPUT_NONE }, { GPIOB, GPIO_PIN_MASK(GPIO_PIN_PB13), GPIO_PIN_PB13_TIM15_CH1N, (PIN_ATTR_PWM | PIN_ATTR_EXTI), PWM_INSTANCE_TIM15, PWM_CHANNEL_1, ADC_INPUT_NONE }, { GPIOB, GPIO_PIN_MASK(GPIO_PIN_PB14), GPIO_PIN_PB14_TIM1_CH2N, (PIN_ATTR_PWM | PIN_ATTR_EXTI), PWM_INSTANCE_TIM1, PWM_CHANNEL_2, ADC_INPUT_NONE }, -#if (USBD_TYPE == USBD_TYPE_CDC_DAP) || (USBD_TYPE == USBD_TYPE_CDC_MSC_DAP) - { NULL, GPIO_PIN_MASK(GPIO_PIN_PB15), GPIO_PIN_PB15, 0, PWM_INSTANCE_NONE, PWM_CHANNEL_NONE, ADC_INPUT_NONE }, - { NULL, GPIO_PIN_MASK(GPIO_PIN_PB8), GPIO_PIN_PB8, 0, PWM_INSTANCE_NONE, PWM_CHANNEL_NONE, ADC_INPUT_NONE }, -#else /* (USBD_TYPE == USBD_TYPE_CDC_DAP) || (USBD_TYPE == USBD_TYPE_CDC_MSC_DAP) */ { GPIOB, GPIO_PIN_MASK(GPIO_PIN_PB15), GPIO_PIN_PB15_TIM1_CH3N, (PIN_ATTR_PWM | PIN_ATTR_EXTI), PWM_INSTANCE_TIM1, PWM_CHANNEL_3, ADC_INPUT_NONE }, { GPIOB, GPIO_PIN_MASK(GPIO_PIN_PB8), GPIO_PIN_PB8_TIM16_CH1, (PIN_ATTR_PWM | PIN_ATTR_EXTI), PWM_INSTANCE_TIM16, PWM_CHANNEL_1, ADC_INPUT_NONE }, -#endif /* (USBD_TYPE == USBD_TYPE_CDC_DAP) || (USBD_TYPE == USBD_TYPE_CDC_MSC_DAP) */ { GPIOB, GPIO_PIN_MASK(GPIO_PIN_PB9), GPIO_PIN_PB9, (PIN_ATTR_EXTI), PWM_INSTANCE_NONE, PWM_CHANNEL_NONE, ADC_INPUT_NONE }, { GPIOA, GPIO_PIN_MASK(GPIO_PIN_PA15), GPIO_PIN_PA15_TIM2_CH1, (PIN_ATTR_PWM | PIN_ATTR_EXTI), PWM_INSTANCE_TIM2, PWM_CHANNEL_1, ADC_INPUT_NONE }, { GPIOA, GPIO_PIN_MASK(GPIO_PIN_PA2), GPIO_PIN_PA2_TIM2_CH3, (PIN_ATTR_PWM | PIN_ATTR_EXTI | PIN_ATTR_WKUP4), PWM_INSTANCE_TIM2, PWM_CHANNEL_3, ADC_INPUT_NONE }, diff --git a/variants/STM32L433CC-Butterfly/variant.h b/variants/STM32L433CC-Butterfly/variant.h index 7dbf8475..6b61b4be 100644 --- a/variants/STM32L433CC-Butterfly/variant.h +++ b/variants/STM32L433CC-Butterfly/variant.h @@ -41,9 +41,6 @@ #define STM32L4_CONFIG_SYSOPT 0 #define STM32L4_CONFIG_USB_VBUS GPIO_PIN_PB2 -#define STM32L4_CONFIG_DAP_SWCLK GPIO_PIN_PB15 -#define STM32L4_CONFIG_DAP_SWDIO GPIO_PIN_PB8 - #define USBCON /** Master clock frequency */