diff options
author | James McKenzie <git@madingley.org> | 2014-12-15 12:10:09 +0000 |
---|---|---|
committer | James McKenzie <git@madingley.org> | 2014-12-15 12:10:09 +0000 |
commit | dcfe43860be2daf118e81a59029a34f018926ae5 (patch) | |
tree | 5d662969a51473eaaab6a8994e9f07b868c8ffa6 /util.c | |
download | clock-dcfe43860be2daf118e81a59029a34f018926ae5.tar.gz clock-dcfe43860be2daf118e81a59029a34f018926ae5.tar.bz2 clock-dcfe43860be2daf118e81a59029a34f018926ae5.zip |
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -0,0 +1,13 @@ +#include "project.h" + +void +setup_clocks (void) +{ +#ifdef __AVR_ATtiny10__ + CCP = 0xD8; // configuration change protection, write signature + CLKPSR = 0; // set cpu clock prescaler =1 (8Mhz) (attiny 4/5/9/10) +#else + CLKPR = _BV (CLKPCE); + CLKPR = 1; // set clock prescaler to 1 (attiny 25/45/85/24/44/84/13/13A) +#endif +} |