misc stuff, preparation hack for autonomous clock (needs to be reverted)

This commit is contained in:
ikari
2009-12-03 00:30:05 +01:00
parent 0f0b1d5beb
commit 81097a290e
9 changed files with 40 additions and 22 deletions

View File

@@ -73,7 +73,8 @@ else ifeq ($(MCU),atmega644)
BINARY_LENGTH = 0xf000
EFUSE = 0xfd
HFUSE = 0x91
LFUSE = 0xef
# LFUSE = 0xef
LFUSE = 0xaf
else ifeq ($(MCU),atmega644p)
BINARY_LENGTH = 0xf000
EFUSE = 0xfd

View File

@@ -62,8 +62,10 @@
# error Unknown chip!
# endif
# define SD_CHANGE_VECT INT0_vect
# define SDCARD_WP (PINB & _BV(PB1))
# define SDCARD_WP (0)
# define SDCARD_WP_SETUP() do { DDRB &= ~ _BV(PB1); PORTB |= _BV(PB1); } while(0)
// # define SDCARD_WP (PINB & _BV(PB1))
// # define SDCARD_WP_SETUP() do { DDRB &= ~ _BV(PB1); PORTB |= _BV(PB1); } while(0)
# define SD_CHANGE_ICR MCUCR
# define SD_SUPPLY_VOLTAGE (1L<<21)
# define DEVICE_SELECT (8+!(PINA & _BV(PA2))+2*!(PINA & _BV(PA3)))

View File

@@ -96,7 +96,7 @@ void fpga_pgm(uint8_t* filename) {
}
}
file_close();
_delay_ms(10);
_delay_ms(100);
} while (!fpga_get_done() && retries--);
if(!fpga_get_done()) {
dprintf("FPGA failed to configure after %d tries.\n", MAXRETRIES);

View File

@@ -282,7 +282,8 @@ restart:
led_std();
set_avr_ena(0);
snes_reset(1);
if(romprops.ramsize_bytes) {
_delay_ms(100);
if(romprops.ramsize_bytes && fpga_test() == 0xa5) {
set_busy_led(1);
save_sram(file_lfn, romprops.ramsize_bytes, SRAM_SAVE_ADDR);
set_busy_led(0);

View File

@@ -56,7 +56,7 @@
// access routines
void spiInit(void)
{
uint8_t dummy;
volatile uint8_t dummy;
// setup SPI I/O pins
SPI_PORT = (SPI_PORT & ~SPI_MASK) | SPI_SCK | SPI_SS | SPI_MISO;
@@ -78,7 +78,7 @@ void spiInit(void)
}
uint8_t spiTransferByte(uint8_t data)
inline uint8_t spiTransferByte(uint8_t data)
{
// send the given data
SPDR = data;
@@ -94,7 +94,7 @@ uint8_t spiTransferByte(uint8_t data)
}
uint32_t spiTransferLong(const uint32_t data)
inline uint32_t spiTransferLong(const uint32_t data)
{
// It seems to be necessary to use the union in order to get efficient
// assembler code.