File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/rp2_common/hardware_dma/include/hardware Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -867,14 +867,16 @@ bool dma_timer_is_claimed(uint timer);
867867 * \ingroup hardware_dma
868868 *
869869 * The timer will run at the system_clock_freq * numerator / denominator, so this is the speed
870- * that data elements will be transferred at via a DMA channel using this timer as a DREQ
870+ * that data elements will be transferred at via a DMA channel using this timer as a DREQ. The
871+ * multiplier must be less than or equal to one.
871872 *
872873 * \param timer the dma timer
873874 * \param numerator the fraction's numerator
874875 * \param denominator the fraction's denominator
875876 */
876877static inline void dma_timer_set_fraction (uint timer , uint16_t numerator , uint16_t denominator ) {
877878 check_dma_timer_param (timer );
879+ invalid_params_if (DMA , numerator > denominator );
878880 dma_hw -> timer [timer ] = (((uint32_t )numerator ) << DMA_TIMER0_X_LSB ) | (((uint32_t )denominator ) << DMA_TIMER0_Y_LSB );
879881}
880882
You can’t perform that action at this time.
0 commit comments