Basic matrix module for the hall effect keypad now working.

- Includes new "table pinning" setup (much easier to understand)
- Matrix layouts will be split into their own dependent modules later
- Changed the HID Raw view id (too many teensy devices on this
  computer...)
- Moved the macro processing outside of the usb timer signal
  (this will be slower overall, but will result in more consistant
  behaviour)
This commit is contained in:
Jacob Alexander 2011-10-15 20:01:46 -07:00
parent 46916defa5
commit 6557022f20
11 changed files with 259 additions and 139 deletions

11
main.c
View file

@ -62,8 +62,11 @@ volatile uint8_t sendKeypresses = 0;
// Initial Pin Setup, make sure they are sane
inline void pinSetup(void)
{
// For each pin, 0=input, 1=output
#if defined(__AVR_AT90USB1286__)
DDRA = 0x00;
#endif
DDRB = 0x00;
DDRC = 0x00;
DDRD = 0x00;
@ -72,7 +75,9 @@ inline void pinSetup(void)
// Setting pins to either high or pull-up resistor
#if defined(__AVR_AT90USB1286__)
PORTA = 0x00;
#endif
PORTB = 0x00;
PORTC = 0x00;
PORTD = 0x00;
@ -113,13 +118,13 @@ int main(void)
while ( scan_loop() );
sei();
// Run Macros over Key Indices and convert to USB Keys
process_macros();
// Send keypresses over USB if the ISR has signalled that it's time
if ( !sendKeypresses )
continue;
// Run Macros over Key Indices and convert to USB Keys
process_macros();
// Send USB Data
usb_send();