Skip to content

Commit

Permalink
Merge pull request qmk#11 from mtei/helix-i2c-bps-fix
Browse files Browse the repository at this point in the history
Helix i2c bps fix
  • Loading branch information
MakotoKurauchi authored Jun 21, 2018
2 parents d768cfd + 8128453 commit cb5937e
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion keyboards/helix/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void i2c_delay(void) {
// _delay_us(100);
}

// Setup twi to run at 100kHz
// Setup twi to run at 100kHz or 400kHz (see ./i2c.h SCL_CLOCK)
void i2c_master_init(void) {
// no prescaler
TWSR = 0;
Expand Down
2 changes: 1 addition & 1 deletion keyboards/helix/i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#define SLAVE_BUFFER_SIZE 0x10

// i2c SCL clock frequency
// i2c SCL clock frequency 400kHz
#define SCL_CLOCK 400000L

extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE];
Expand Down
2 changes: 0 additions & 2 deletions keyboards/helix/rev2/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "lufa.h"
#include "split_util.h"
#endif
#include "LUFA/Drivers/Peripheral/TWI.h"
#ifdef AUDIO_ENABLE
#include "audio.h"
#endif
Expand Down Expand Up @@ -479,7 +478,6 @@ void matrix_init_user(void) {
#endif
//SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
#ifdef SSD1306OLED
TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000));
iota_gfx_init(!has_usb()); // turns on the display
#endif
}
Expand Down
2 changes: 0 additions & 2 deletions keyboards/helix/rev2/keymaps/five_rows/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "lufa.h"
#include "split_util.h"
#endif
#include "LUFA/Drivers/Peripheral/TWI.h"
#ifdef AUDIO_ENABLE
#include "audio.h"
#endif
Expand Down Expand Up @@ -413,7 +412,6 @@ void matrix_init_user(void) {
#endif
//SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
#ifdef SSD1306OLED
TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000));
iota_gfx_init(!has_usb()); // turns on the display
#endif
}
Expand Down
2 changes: 0 additions & 2 deletions keyboards/helix/rev2/keymaps/froggy/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "lufa.h"
#include "split_util.h"
#endif
#include "LUFA/Drivers/Peripheral/TWI.h"
#ifdef AUDIO_ENABLE
#include "audio.h"
#endif
Expand Down Expand Up @@ -435,7 +434,6 @@ void matrix_init_user(void) {
#endif
//SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
#ifdef SSD1306OLED
TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000));
iota_gfx_init(!has_usb()); // turns on the display
#endif
}
Expand Down
2 changes: 0 additions & 2 deletions keyboards/helix/rev2/keymaps/led_test/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "lufa.h"
#include "split_util.h"
#endif
#include "LUFA/Drivers/Peripheral/TWI.h"
#ifdef AUDIO_ENABLE
#include "audio.h"
#endif
Expand Down Expand Up @@ -477,7 +476,6 @@ void matrix_init_user(void) {
#endif
//SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
#ifdef SSD1306OLED
TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000));
iota_gfx_init(!has_usb()); // turns on the display
#endif
}
Expand Down
1 change: 1 addition & 0 deletions keyboards/helix/ssd1306.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ static int8_t capture_sendchar(uint8_t c) {
bool iota_gfx_init(bool rotate) {
bool success = false;

i2c_master_init();
send_cmd1(DisplayOff);
send_cmd2(SetDisplayClockDiv, 0x80);
send_cmd2(SetMultiPlex, DisplayHeight - 1);
Expand Down

0 comments on commit cb5937e

Please sign in to comment.