2011-12-20 22:36:04 +01:00
|
|
|
/*
|
|
|
|
* CTHN.de MiniLEDCube
|
2011-12-09 23:15:06 +01:00
|
|
|
*
|
2011-12-20 22:36:04 +01:00
|
|
|
* By Kai Lauterbach (klaute at web dot de) 11/2011
|
2011-12-09 23:15:06 +01:00
|
|
|
*
|
|
|
|
* Based on http://mosfetkiller.de/?s=miniledcube
|
|
|
|
*
|
|
|
|
* License: General Public License (GPL v3)
|
|
|
|
*
|
|
|
|
*/
|
2011-10-15 11:32:43 +02:00
|
|
|
|
|
|
|
#ifndef __main_h__
|
|
|
|
#define __main_h__
|
|
|
|
|
2011-10-19 00:04:59 +02:00
|
|
|
// Includes
|
|
|
|
#include "globals.h"
|
2011-10-15 11:32:43 +02:00
|
|
|
|
|
|
|
#include <avr/interrupt.h>
|
|
|
|
#include <avr/io.h>
|
2011-12-18 19:35:47 +01:00
|
|
|
#include <avr/eeprom.h>
|
2011-12-17 22:03:57 +01:00
|
|
|
|
2011-11-05 16:52:02 +01:00
|
|
|
// Cube-Data
|
2011-12-20 22:36:04 +01:00
|
|
|
uint32_t frame;
|
|
|
|
|
|
|
|
uint8_t level; // current layer
|
|
|
|
uint8_t mode = MODE_ANIMATION_LOOP; // firmware mode
|
|
|
|
uint8_t frmnum; // frame nummber in the animation loop
|
|
|
|
uint8_t delay; // delay in ISR calls between changing to the next animation frame
|
|
|
|
uint8_t delay_max = STARTUP_DELAY_MAX; // maximum delay between the animation frames
|
|
|
|
|
|
|
|
// eeprom array of the animation
|
|
|
|
uint32_t eep_anim[MAX_EEPROM_FRAMES] EEMEM;
|
|
|
|
|
|
|
|
// function prototypes
|
2011-10-15 11:32:43 +02:00
|
|
|
void init(void);
|
2011-12-20 22:36:04 +01:00
|
|
|
void loadEEPROMFrame(uint8_t);
|
2011-10-15 11:32:43 +02:00
|
|
|
|
|
|
|
extern void init_usb(void);
|
|
|
|
extern void usbPoll(void);
|
|
|
|
|
|
|
|
#endif // __main_h__
|
|
|
|
|