rgbyteclock-code/main.c

49 lines
1.1 KiB
C
Raw Permalink Normal View History

2014-03-01 03:50:09 +01:00
2014-03-01 03:54:52 +01:00
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <struppi@struppi.name> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return.
* (c) 2014 Stefan Rupp
* ----------------------------------------------------------------------------
*/
2014-03-01 03:50:09 +01:00
#include <avr/io.h>
2014-03-03 05:01:36 +01:00
#include <avr/interrupt.h>
2014-03-01 03:50:09 +01:00
#include "timer.h"
#include "lcd.h"
#include "rgbyteclock.h"
#include "spi.h"
2014-03-02 07:18:48 +01:00
#include "ledcontroller.h"
2014-03-03 05:01:36 +01:00
#include "rtc.h"
2014-03-12 17:07:18 +01:00
#include <util/delay.h>
2014-03-01 03:50:09 +01:00
int main(void)
{
timer_init();
rtc_init(0);
2014-03-12 17:07:18 +01:00
//spi_slave_init();
led_init();
2014-03-03 05:01:36 +01:00
sei();
2014-03-14 22:05:42 +01:00
lcd_init();
2014-03-01 03:50:09 +01:00
DDRC |= (1<<PC5); // Test LED
2014-03-14 22:05:42 +01:00
DDRD |= (1<<PD4); // Backlight
PORTD |= (1<<PD4);
lcd_puts("RGByteclock");
lcd_locate(1,0);
lcd_puts("www.bytewerk.org");
led_turn_all_on(); // turn all LED channels on.
2014-03-01 03:50:09 +01:00
rgbyteclock();
// rgbyteclock() should never end, but who knows...
while (1) { ; }
}