Skip to content

Commit 5be87f1

Browse files
authored
Clarify that DMA timer fraction must be <= 1 (#1723)
1 parent 0e5cef3 commit 5be87f1

File tree

1 file changed

+3
-1
lines changed
  • src/rp2_common/hardware_dma/include/hardware

1 file changed

+3
-1
lines changed

src/rp2_common/hardware_dma/include/hardware/dma.h

+3-1
Original file line numberDiff line numberDiff 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
*/
876877
static 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

0 commit comments

Comments
 (0)