Skip to content
Snippets Groups Projects
Select Git revision
  • 0266c4707b0162da24a4e22074fd1cb449d943c5
  • master default
  • dev
3 results

TetraStackedLattice.js

Blame
  • TestApp.c 4.32 KiB
    /*
                 LUFA Library
         Copyright (C) Dean Camera, 2009.
                  
      dean [at] fourwalledcubicle [dot] com
          www.fourwalledcubicle.com
    */
    
    /*
      Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com)
    
      Permission to use, copy, modify, and distribute this software
      and its documentation for any purpose and without fee is hereby
      granted, provided that the above copyright notice appear in all
      copies and that both that the copyright notice and this
      permission notice and warranty disclaimer appear in supporting
      documentation, and that the name of the author not be used in
      advertising or publicity pertaining to distribution of the
      software without specific, written prior permission.
    
      The author disclaim 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
      whatsoever resulting from loss of use, data or profits, whether
      in an action of contract, negligence or other tortious action,
      arising out of or in connection with the use or performance of
      this software.
    */
    
    /** \file
     *
     *  Main source file for the TestApp demo. This file contains the main tasks of the demo and
     *  is responsible for the initial application hardware configuration.
     */
    
    #include "TestApp.h"
    
    /** Main program entry point. This routine configures the hardware required by the application, then
     *  starts the scheduler to run the application tasks.
     */
    int main(void)
    {
    	SetupHardware();
    	
    	puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY
    	       "LUFA Demo running.\r\n" ESC_INVERSE_OFF));
    
    	for (;;)
    	{
    		CheckJoystick();
    		CheckButton();
    		CheckTemperature();
    
    		/* Clear output-compare flag (logic 1 clears the flag) */
    		TIFR0 |= (1 << OCF0A);
    		
    		USB_USBTask();
    	}
    }
    
    void SetupHardware(void)
    {
    	/* Disable watchdog if enabled by bootloader/fuses */
    	MCUSR &= ~(1 << WDRF);
    	wdt_disable();
    
    	/* Disable clock division */
    	clock_prescale_set(clock_div_1);