]> git.donarmstrong.com Git - kiibohd-controller.git/blobdiff - Macro/buffer/macro.c
Merge branch 'master' of github.com:kiibohd/controller
[kiibohd-controller.git] / Macro / buffer / macro.c
index eab23f33ee60e26985ff3379bd1d1e77fdd85577..9654c90484ac7fb5f41ba3493332b6037d832646 100644 (file)
@@ -1,15 +1,15 @@
-/* Copyright (C) 2011 by Jacob Alexander
- * 
+/* Copyright (C) 2011-2014 by Jacob Alexander
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
  * in the Software without restriction, including without limitation the rights
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  * copies of the Software, and to permit persons to whom the Software is
  * furnished to do so, subject to the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 
 // ----- Includes -----
 
-// AVR Includes
-#include <util/delay.h>
-#include <avr/interrupt.h>
+// Compiler Includes
+#include <Lib/MacroLib.h>
 
 // Project Includes
 #include <led.h>
 #include <print.h>
 #include <scan_loop.h>
-#include <usb_com.h>
+#include <output_com.h>
 
 // Keymaps
 #include <keymap.h>
@@ -78,6 +77,7 @@ inline void macro_finishedWithBuffer( uint8_t sentKeys )
 
 void jumpToBootloader(void)
 {
+#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) // AVR
        cli();
        // disable watchdog, if enabled
        // disable all peripherals
@@ -111,6 +111,7 @@ void jumpToBootloader(void)
        PORTA = 0; PORTB = 0; PORTC = 0; PORTD = 0; PORTE = 0; PORTF = 0;
        asm volatile("jmp 0x1FC00");
 #endif
+#endif
 }
 
 // Given a sampling array, and the current number of detected keypress