diff options
author | Erez Zukerman <bulk@ezuk.org> | 2016-11-29 08:16:04 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-29 08:16:04 -0500 |
commit | 51ae6da99edd732ccdec6e102bd757e08950d23b (patch) | |
tree | 53e316e1fbe468e0b1f65fd11e161ebc74c6ef70 /keyboards/ergodox/ez/ez.c | |
parent | 7b219a7f6016dfe80c1c3db33bcf859e3e355d8d (diff) | |
parent | f946d830f98da0161753d37da9659caa7469cf4f (diff) |
Merge pull request #918 from jackhumbert/wu5y7
Adds Ergodox EZ RGB lights (both sides using I2C) and implements API base, Midi SysEx API
Diffstat (limited to 'keyboards/ergodox/ez/ez.c')
-rw-r--r-- | keyboards/ergodox/ez/ez.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/keyboards/ergodox/ez/ez.c b/keyboards/ergodox/ez/ez.c index ddb8ff0cf7..039e4c6bb1 100644 --- a/keyboards/ergodox/ez/ez.c +++ b/keyboards/ergodox/ez/ez.c @@ -16,10 +16,10 @@ void matrix_init_kb(void) { // unused pins - C7, D4, D5, D7, E6 // set as input with internal pull-ip enabled DDRC &= ~(1<<7); - DDRD &= ~(1<<7 | 1<<5 | 1<<4); + DDRD &= ~(1<<5 | 1<<4); DDRE &= ~(1<<6); PORTC |= (1<<7); - PORTD |= (1<<7 | 1<<5 | 1<<4); + PORTD |= (1<<5 | 1<<4); PORTE |= (1<<6); ergodox_blink_all_leds(); @@ -51,6 +51,10 @@ uint8_t init_mcp23018(void) { mcp23018_status = 0x20; // I2C subsystem + + uint8_t sreg_prev; + sreg_prev=SREG; + cli(); if (i2c_initialized == 0) { i2c_init(); // on pins D(1,0) i2c_initialized++; @@ -79,6 +83,8 @@ uint8_t init_mcp23018(void) { out: i2c_stop(); + SREG=sreg_prev; + return mcp23018_status; } |