We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 03db672 commit 2e13eabCopy full SHA for 2e13eab
1 file changed
portable/MPLAB/PIC32MZ/port.c
@@ -234,6 +234,11 @@ __attribute__(( weak )) void vApplicationSetupTickTimerInterrupt( void )
234
{
235
const uint32_t ulCompareMatch = ( (configPERIPHERAL_CLOCK_HZ / portTIMER_PRESCALE) / configTICK_RATE_HZ ) - 1UL;
236
237
+ /* PR1 is 16-bit. Ensure that the configPERIPHERAL_CLOCK_HZ and
238
+ * configTICK_RATE_HZ are defined such that ulCompareMatch value would fit
239
+ * in 16-bits. */
240
+ configASSERT( ( ulCompareMatch & 0xFFFF0000 ) == 0 );
241
+
242
T1CON = 0x0000;
243
T1CONbits.TCKPS = portPRESCALE_BITS;
244
PR1 = ulCompareMatch;
0 commit comments