added support for a new keyboard model

This commit is contained in:
2008-11-12 21:45:43 +00:00
parent dbc411f969
commit 5d7ab00387
9 changed files with 10770 additions and 0 deletions

View File

@ -23,6 +23,7 @@ CC = avr-gcc
# Options:
DEFINES = -DMODELIBMMODELM
#DEFINES = -DMODELMAYHEM
#DEFINES = -DMODELSUNTYPE5
CFLAGS = -Wall -Os -I. -mmcu=$(DEVICE) -DF_CPU=$(F_CPU) $(DEFINES)

View File

@ -147,6 +147,21 @@ static inline void bootLoaderInit(void) {
PORTC = 0xff;
}
#endif
#ifdef MODELMAYHEM
static inline void bootLoaderInit(void) {
// switch on leds
DDRD |= (1 << PIND1) | (1 << PIND3) | (1 << PIND6) | (1 << PIND7);
PORTD &= ~((1 << PIND1) | (1 << PIND3) | (1 << PIND6) | (1 << PIND7));
// choose matrix position for hotkey. we use KEY_D, so we set row 4
// and later look for column 5
DDRA = (1 << DDA4);
PORTA = ~(1 << PINA4);
DDRB &= ~(1 << PB5);
PORTB |= (1 << PB5);
DDRC = 0x00;
PORTC = 0xff;
}
#endif
#ifdef MODELSUNTYPE5
static inline void bootLoaderInit(void) {
// configure ports
@ -189,6 +204,12 @@ static inline void bootLoaderExit(void) {
PORTD |= (1 << PIND4) | (1 << PIND5) | (1 << PIND6);
}
#endif
#ifdef MODELMAYHEM
static inline void bootLoaderExit(void) {
// switch off leds
PORTD |= (1 << PIND1) | (1 << PIND3) | (1 << PIND6) | (1 << PIND7);
}
#endif
#ifdef MODELSUNTYPE5
static inline void bootLoaderExit(void) {
// switch off leds
@ -230,6 +251,34 @@ static inline uint8_t bootLoaderCondition() {
}
}
#endif
#ifdef MODELMAYHEM
static inline uint8_t bootLoaderCondition() {
// look for pin 5
if (!(PINB & (1 << PINB5))) {
// boot loader active, fade leds
ledcounter++;
if (ledcounter < ledbrightness) {
// switch on leds
PORTD &= ~((1 << PIND1) | (1 << PIND3) | (1 << PIND6) | (1 << PIND7));
} else {
// switch off leds
PORTD |= (1 << PIND1) | (1 << PIND3) | (1 << PIND6) | (1 << PIND7);
}
if (ledcounter == 255) {
ledcounter = 0;
ledbrightness += leddirection;
if (ledbrightness == 255) {
leddirection = -leddirection;
ledbrightness += leddirection;
}
}
return 1;
} else {
// no boot loader
return 0;
}
}
#endif
#ifdef MODELSUNTYPE5
static inline uint8_t bootLoaderCondition() {
// look for pin 12, KEY_D