summaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authorroot <root@no.no.james.local>2014-12-08 18:39:07 +0000
committerroot <root@no.no.james.local>2014-12-08 18:39:07 +0000
commit804820fe687affa38a52e302179e4a2293cb1ffb (patch)
treeacb784fd60af24d8c389e366d74409c75802dfa0 /util.c
downloadrgb_ring-804820fe687affa38a52e302179e4a2293cb1ffb.tar.gz
rgb_ring-804820fe687affa38a52e302179e4a2293cb1ffb.tar.bz2
rgb_ring-804820fe687affa38a52e302179e4a2293cb1ffb.zip
fish
Diffstat (limited to 'util.c')
-rw-r--r--util.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/util.c b/util.c
new file mode 100644
index 0000000..9e82554
--- /dev/null
+++ b/util.c
@@ -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 = 0; // set clock prescaler to 1 (attiny 25/45/85/24/44/84/13/13A)
+#endif
+}