/* Setup a timer for a regular tick. This function uses peripheral timer 1. The function is declared weak so an application writer can use a different timer by redefining this implementation. If a different timer is used then configTICK_INTERRUPT_VECTOR must also be defined in FreeRTOSConfig.h to ensure the RTOS provided tick interrupt handler is installed on the correct vector number. When Timer 1 is used the vector number is defined as _TIMER_1_VECTOR.  */
__attribute__((weak))
/* Setup a timer for a regular tick. This function uses peripheral timer 1. The function is declared weak so an application writer can use a different timer by redefining this implementation. If a different timer is used then configTICK_INTERRUPT_VECTOR must also be defined in FreeRTOSConfig.h to ensure the RTOS provided tick interrupt handler is installed on the correct vector number. When Timer 1 is used the vector number is defined as _TIMER_1_VECTOR.  */
__attribute__((weak))
{
const uint32_t ulCompareMatch = ( (configPERIPHERAL_CLOCK_HZ / portTIMER_PRESCALE) / configTICK_RATE_HZ ) - 1;
	T1CON = 0x0000;
	T1CONbits.TCKPS = portPRESCALE_BITS;
	PR1 = ulCompareMatch;
	IPC1bits.T1IP = configKERNEL_INTERRUPT_PRIORITY;
	IFS0bits.T1IF = 0;
	IEC0bits.T1IE = 1;
	T1CONbits.TON = 1;
}