support for new hardware: IBM Host keyboard

This commit is contained in:
Ronald Schaten 2009-03-25 02:11:26 +00:00
parent 9fe5ef9a4e
commit 3d61f2b9bf
2 changed files with 32 additions and 0 deletions

View File

@ -25,6 +25,7 @@ CC = avr-gcc
DEFINES = -DMODELIBMMODELM DEFINES = -DMODELIBMMODELM
#DEFINES = -DMODELMAYHEM #DEFINES = -DMODELMAYHEM
#DEFINES = -DMODELSUNTYPE5 #DEFINES = -DMODELSUNTYPE5
#DEFINES = -DMODELIBMHOST
CFLAGS = -Wall -Os -I. -mmcu=$(DEVICE) -DF_CPU=$(F_CPU) $(DEFINES) CFLAGS = -Wall -Os -I. -mmcu=$(DEVICE) -DF_CPU=$(F_CPU) $(DEFINES)
LDFLAGS = -Wl,--section-start=.text=$(BOOTLOADER_ADDRESS) LDFLAGS = -Wl,--section-start=.text=$(BOOTLOADER_ADDRESS)

View File

@ -194,6 +194,20 @@ static inline void bootLoaderInit(void) {
SRSTROBEON; SRSTROBEOFF; SRSTROBEON; SRSTROBEOFF;
} }
#endif #endif
#ifdef MODELIBMHOST
static inline void bootLoaderInit(void) {
// choose matrix position for hotkey. we use KEY_D, so we set row 13
DDRA = 0x00;
PORTA = 0xff;
DDRC = (1 << DDC2);
PORTC = ~(1 << PINC2);
DDRD &= ~((1 << PIND4) | (1 << PIND5) | (1 << PIND6) | (1 << PIND7));
PORTD |= ((1 << PIND4) | (1 << PIND5) | (1 << PIND6) | (1 << PIND7));
// and later look for column 6
DDRB &= ~(1 << PB6);
PORTB |= (1 << PB6);
}
#endif
/** /**
* Clean up after boot loader action. In this case: switch off all LEDs. * Clean up after boot loader action. In this case: switch off all LEDs.
@ -216,6 +230,11 @@ static inline void bootLoaderExit(void) {
PORTB |= (1 << PB4) | (1 << PB5) | (1 << PB6) | (1 << PB7); PORTB |= (1 << PB4) | (1 << PB5) | (1 << PB6) | (1 << PB7);
} }
#endif #endif
#ifdef MODELIBMHOST
static inline void bootLoaderExit(void) {
// do nothing
}
#endif
/** /**
* Check if conditions for boot loader are met. This function is called in an * Check if conditions for boot loader are met. This function is called in an
@ -307,6 +326,18 @@ static inline uint8_t bootLoaderCondition() {
} }
} }
#endif #endif
#ifdef MODELIBMHOST
static inline uint8_t bootLoaderCondition() {
// look for pin 6
if (!(PINB & (1 << PINB6))) {
// boot loader active
return 1;
} else {
// no boot loader
return 0;
}
}
#endif
#endif /* __ASSEMBLER__ */ #endif /* __ASSEMBLER__ */