aboutsummaryrefslogtreecommitdiffstats
path: root/fw/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'fw/init.c')
-rw-r--r--fw/init.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/fw/init.c b/fw/init.c
new file mode 100644
index 0000000..9c89bee
--- /dev/null
+++ b/fw/init.c
@@ -0,0 +1,17 @@
+#include <xc.h>
+
+#include "init.h"
+
+void
+clockInit(void) {
+ OSCCON = 0xFC; // HFINTOSC @ 16MHz, 3x PLL, PLL enabled
+ ACTCON = 0x90; // active clock tuning enabled for USB
+}
+
+void
+pinsInit(void) {
+ // Disable all analog pin functions
+ ANSELA = 0;
+ ANSELB = 0;
+ ANSELC = 0;
+}