diff options
-rw-r--r-- | os/hal/platforms/SPC5xx/EQADC_v1/adc_lld.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/os/hal/platforms/SPC5xx/EQADC_v1/adc_lld.c b/os/hal/platforms/SPC5xx/EQADC_v1/adc_lld.c index 2a27c62f7..75bca5fe3 100644 --- a/os/hal/platforms/SPC5xx/EQADC_v1/adc_lld.c +++ b/os/hal/platforms/SPC5xx/EQADC_v1/adc_lld.c @@ -652,6 +652,9 @@ void adc_lld_stop(ADCDriver *adcp) { /**
* @brief Starts an ADC conversion.
+ * @note Because an HW constraint the number of rows in the samples
+ * array must not be greater than the preconfigured value in
+ * the conversion group.
*
* @param[in] adcp pointer to the @p ADCDriver object
*
@@ -661,6 +664,9 @@ void adc_lld_start_conversion(ADCDriver *adcp) { edma_tcd_t *ctcdp = edmaGetTCD(adcp->cfifo_channel);
edma_tcd_t *rtcdp = edmaGetTCD(adcp->rfifo_channel);
+ chDbgAssert(adcp->grpp->num_iterations >= adcp->depth,
+ "adc_lld_start_conversion(), #1", "too many elements");
+
/* TODO: ISEL0, ISEL3 setup for HW triggers.*/
/* Updating the variable TCD fields for CFIFO.*/
|