• R/O
  • SSH
  • HTTPS

chibios: Commit


Commit MetaInfo

Revisión14389 (tree)
Tiempo2021-05-17 22:22:11
Autorgdisirio

Log Message

STM32 ADCv3 updated for dynamic clocking.

Cambiar Resumen

Diferencia incremental

--- trunk/os/hal/ports/STM32/LLD/ADCv3/hal_adc_lld.c (revision 14388)
+++ trunk/os/hal/ports/STM32/LLD/ADCv3/hal_adc_lld.c (revision 14389)
@@ -630,6 +630,10 @@
630630 if (adcp->state == ADC_STOP) {
631631 #if STM32_ADC_USE_ADC1
632632 if (&ADCD1 == adcp) {
633+
634+ osalDbgAssert(STM32_ADC12_CLOCK <= STM32_ADCCLK_MAX,
635+ "invalid clock frequency");
636+
633637 adcp->dmastp = dmaStreamAllocI(STM32_ADC_ADC1_DMA_STREAM,
634638 STM32_ADC_ADC1_DMA_IRQ_PRIORITY,
635639 (stm32_dmaisr_t)adc_lld_serve_dma_interrupt,
@@ -654,6 +658,10 @@
654658
655659 #if STM32_ADC_USE_ADC2
656660 if (&ADCD2 == adcp) {
661+
662+ osalDbgAssert(STM32_ADC12_CLOCK <= STM32_ADCCLK_MAX,
663+ "invalid clock frequency");
664+
657665 adcp->dmastp = dmaStreamAllocI(STM32_ADC_ADC2_DMA_STREAM,
658666 STM32_ADC_ADC2_DMA_IRQ_PRIORITY,
659667 (stm32_dmaisr_t)adc_lld_serve_dma_interrupt,
@@ -678,6 +686,10 @@
678686
679687 #if STM32_ADC_USE_ADC3
680688 if (&ADCD3 == adcp) {
689+
690+ osalDbgAssert(STM32_ADC345_CLOCK <= STM32_ADCCLK_MAX,
691+ "invalid clock frequency");
692+
681693 adcp->dmastp = dmaStreamAllocI(STM32_ADC_ADC3_DMA_STREAM,
682694 STM32_ADC_ADC3_DMA_IRQ_PRIORITY,
683695 (stm32_dmaisr_t)adc_lld_serve_dma_interrupt,
@@ -705,6 +717,10 @@
705717
706718 #if STM32_ADC_USE_ADC4
707719 if (&ADCD4 == adcp) {
720+
721+ osalDbgAssert(STM32_ADC345_CLOCK <= STM32_ADCCLK_MAX,
722+ "invalid clock frequency");
723+
708724 adcp->dmastp = dmaStreamAllocI(STM32_ADC_ADC4_DMA_STREAM,
709725 STM32_ADC_ADC4_DMA_IRQ_PRIORITY,
710726 (stm32_dmaisr_t)adc_lld_serve_dma_interrupt,
--- trunk/os/hal/ports/STM32/LLD/ADCv3/hal_adc_lld.h (revision 14388)
+++ trunk/os/hal/ports/STM32/LLD/ADCv3/hal_adc_lld.h (revision 14389)
@@ -731,14 +731,6 @@
731731 #else
732732 #error "invalid clock mode selected for STM32_ADC_ADC34_CLOCK_MODE"
733733 #endif
734-
735-#if STM32_ADC12_CLOCK > STM32_ADCCLK_MAX
736-#error "STM32_ADC12_CLOCK exceeding maximum frequency (STM32_ADCCLK_MAX)"
737-#endif
738-
739-#if STM32_ADC34_CLOCK > STM32_ADCCLK_MAX
740-#error "STM32_ADC34_CLOCK exceeding maximum frequency (STM32_ADCCLK_MAX)"
741-#endif
742734 #endif /* defined(STM32F3XX) */
743735
744736 #if defined(STM32L4XX) || defined(STM32L4XXP)
@@ -753,10 +745,6 @@
753745 #else
754746 #error "invalid clock mode selected for STM32_ADC_ADC123_CLOCK_MODE"
755747 #endif
756-
757-#if STM32_ADC123_CLOCK > STM32_ADCCLK_MAX
758-#error "STM32_ADC123_CLOCK exceeding maximum frequency (STM32_ADCCLK_MAX)"
759-#endif
760748 #endif /* defined(STM32L4XX) || defined(STM32L4XXP) */
761749
762750 #if defined(STM32G4XX)
@@ -783,14 +771,6 @@
783771 #else
784772 #error "invalid clock mode selected for STM32_ADC_ADC345_CLOCK_MODE"
785773 #endif
786-
787-#if STM32_ADC12_CLOCK > STM32_ADCCLK_MAX
788-#error "STM32_ADC12_CLOCK exceeding maximum frequency (STM32_ADCCLK_MAX)"
789-#endif
790-
791-#if STM32_ADC345_CLOCK > STM32_ADCCLK_MAX
792-#error "STM32_ADC345_CLOCK exceeding maximum frequency (STM32_ADCCLK_MAX)"
793-#endif
794774 #endif /* defined(STM32G4XX) */
795775
796776 #if !defined(STM32_DMA_REQUIRED)
--- trunk/os/hal/ports/STM32/STM32G4xx/hal_lld.h (revision 14388)
+++ trunk/os/hal/ports/STM32/STM32G4xx/hal_lld.h (revision 14389)
@@ -1428,7 +1428,7 @@
14281428 #endif
14291429
14301430 /**
1431- * @brief ADC clock frequency.
1431+ * @brief ADC12 clock frequency.
14321432 */
14331433 #if (STM32_ADC12SEL == STM32_ADC12SEL_NOCLK) || defined(__DOXYGEN__)
14341434 #define STM32_ADC12CLK 0
@@ -1444,7 +1444,7 @@
14441444 #endif
14451445
14461446 /**
1447- * @brief ADC clock frequency.
1447+ * @brief ADC345 clock frequency.
14481448 */
14491449 #if (STM32_ADC345SEL == STM32_ADC345SEL_NOCLK) || defined(__DOXYGEN__)
14501450 #define STM32_ADC345CLK 0
--- trunk/readme.txt (revision 14388)
+++ trunk/readme.txt (revision 14389)
@@ -74,7 +74,7 @@
7474 *****************************************************************************
7575
7676 *** Next ***
77-- NEW: STM32 USARTv2, USARTv3 updated for dynamic clocking.
77+- NEW: STM32 USARTv2, USARTv3, USBv1 updated for dynamic clocking.
7878 - NEW: Dynamic support implemented for STM32G4xx.
7979 - NEW: Dynamic clocks support in HAL.
8080 - NEW: Reload feature added to RT virtual timers.
Show on old repository browser