2011-11-26 07:10:30 +00:00
|
|
|
/*
|
|
|
|
* main.c
|
|
|
|
*
|
|
|
|
* Created on: Nov 25, 2011
|
|
|
|
* Author: Doug
|
|
|
|
*/
|
|
|
|
|
2011-12-08 05:17:47 +00:00
|
|
|
#include <avr/io.h>
|
2011-12-10 06:11:31 +00:00
|
|
|
#include <avr/interrupt.h>
|
2011-12-08 05:17:47 +00:00
|
|
|
#include <util/delay.h>
|
2011-12-10 18:35:41 +00:00
|
|
|
#include "external_mem.h"
|
2011-12-08 05:17:47 +00:00
|
|
|
#include "tests/simm_electrical_test.h"
|
2011-12-10 06:11:31 +00:00
|
|
|
#include "usb_serial/usb_serial.h"
|
2011-12-08 05:17:47 +00:00
|
|
|
|
2011-11-26 07:10:30 +00:00
|
|
|
int main(void)
|
|
|
|
{
|
2011-12-10 06:11:31 +00:00
|
|
|
cli();
|
|
|
|
|
2011-12-08 05:17:47 +00:00
|
|
|
DDRD |= (1 << 7);
|
|
|
|
PORTD &= ~(1 << 7);
|
|
|
|
|
2012-01-27 04:42:42 +00:00
|
|
|
// If there was a brownout detected, turn on the LED momentarily
|
2011-12-14 05:56:20 +00:00
|
|
|
if (MCUSR & (1 << BORF))
|
|
|
|
{
|
|
|
|
MCUSR = 0;
|
|
|
|
PORTD |= (1 << 7);
|
|
|
|
_delay_ms(500);
|
|
|
|
PORTD &= ~(1 << 7);
|
|
|
|
}
|
|
|
|
|
2011-12-10 18:35:41 +00:00
|
|
|
ExternalMem_Init();
|
|
|
|
ExternalMem_SetAddress(0);
|
2011-12-12 05:48:26 +00:00
|
|
|
ExternalMem_Assert(SIMM_CS | SIMM_OE);
|
|
|
|
ExternalMem_Deassert(SIMM_WE);
|
2011-12-10 06:11:31 +00:00
|
|
|
USBSerial_Init();
|
|
|
|
sei();
|
|
|
|
|
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
USBSerial_Check();
|
|
|
|
}
|
|
|
|
|
2011-11-26 07:10:30 +00:00
|
|
|
return 0;
|
|
|
|
}
|