// turn off low power timer
LPTMR_BWR_CSR_TEN(LPTMR0, (uint8_t)false);
// clear interrupts
TPM_WR_STATUS(TPM2, 1 << TPM_STATUS_TOF_SHIFT);
TPM_WR_STATUS(TPM2, 1 << TPM_STATUS_CH0F_SHIFT);
// turn off tpm clocks
TPM_HAL_SetClockMode(TPM1, kTpmClockSourceNoneClk);
TPM_HAL_SetClockMode(TPM2, kTpmClockSourceNoneClk);
TPM_HAL_ClearCounter(TPM1);
TPM_HAL_ClearCounter(TPM2);
// restart this timer when lptmr overflows
TPM_HAL_SetTriggerMode(TPM1, true);
TPM_HAL_SetTriggerMode(TPM2, true);
TPM_HAL_SetClockMode(TPM1, kTpmClockSourceModuleClk);
TPM_HAL_SetClockMode(TPM2, kTpmClockSourceModuleClk);
// reset counters
lptmrCnt = 0;
ppsTotal1 = 0;
ppsTotal2 = 0;
// reenable lptmr to overflow in 10 msec
LPTMR_BWR_CSR_TEN(LPTMR0, (uint8_t)true);