Don't compile in ISP sources into the XPLAIN bridge project.
[pub/USBasp.git] / Demos / Host / LowLevel / StillImageHost / StillImageHost.c
index d2eecb4..9df9531 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2011.
+     Copyright (C) Dean Camera, 2017.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
-  Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2017  Dean Camera (dean [at] fourwalledcubicle [dot] com)
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
@@ -18,7 +18,7 @@
   advertising or publicity pertaining to distribution of the
   software without specific, written prior permission.
 
-  The author disclaim all warranties with regard to this
+  The author disclaims all warranties with regard to this
   software, including all implied warranties of merchantability
   and fitness.  In no event shall the author be liable for any
   special, indirect or consequential damages or any damages
@@ -46,7 +46,7 @@ int main(void)
        puts_P(PSTR(ESC_FG_CYAN "Still Image Host Demo running.\r\n" ESC_FG_WHITE));
 
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
-       sei();
+       GlobalInterruptEnable();
 
        for (;;)
        {
@@ -59,13 +59,14 @@ int main(void)
 /** Configures the board hardware and chip peripherals for the demo's functionality. */
 void SetupHardware(void)
 {
+#if (ARCH == ARCH_AVR8)
        /* Disable watchdog if enabled by bootloader/fuses */
        MCUSR &= ~(1 << WDRF);
        wdt_disable();
 
-       /* Disable Clock Division */
-       CLKPR = (1 << CLKPCE);
-       CLKPR = 0;
+       /* Disable clock division */
+       clock_prescale_set(clock_div_1);
+#endif
 
        /* Hardware Initialization */
        Serial_Init(9600, false);
@@ -353,7 +354,7 @@ void UnicodeToASCII(uint8_t* UnicodeString,
 void ShowCommandError(uint8_t ErrorCode,
                       bool ResponseCodeError)
 {
-       char* FailureType = ((ResponseCodeError) ? PSTR("Response Code != OK") : PSTR("Transaction Fail"));
+       const char* FailureType = ((ResponseCodeError) ? PSTR("Response Code != OK") : PSTR("Transaction Fail"));
 
        printf_P(PSTR(ESC_FG_RED "Command Error (%S).\r\n"
                                 " -- Error Code %d\r\n" ESC_FG_WHITE), FailureType, ErrorCode);