Created
April 5, 2014 17:39
-
-
Save SergNikitin/9995241 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static inline void setTimerSettingsToDefaultByNum(uint_fast8_t timerNum) { | |
// enable timer interrupt | |
CpuTimer0Regs.TCR.bit.TIE = 1; | |
// free run mode switch on | |
CpuTimer0Regs.TCR.bit.FREE = 1; | |
CpuTimer0Regs.TCR.bit.SOFT = 0; | |
// set preload value and timer prescaler | |
CpuTimer0Regs.PRD.all = 0xFFFF; | |
CpuTimer1Regs.TPR.bit.TDDR = 0xFF; | |
CpuTimer1Regs.TPRH.bit.TDDRH = 0xFF; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment