diff --git a/keyboards/hadron/i2c.h b/keyboards/hadron/i2c.h deleted file mode 100644 index 7ecf6eb2785f..000000000000 --- a/keyboards/hadron/i2c.h +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once - -#include - -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -#define I2C_READ 1 -#define I2C_WRITE 0 - -#define I2C_ACK 1 -#define I2C_NACK 0 - -#define SLAVE_BUFFER_SIZE 0x10 - -// i2c SCL clock frequency -#define SCL_CLOCK 800000L - -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -void i2c_master_init(void); -uint8_t i2c_master_start(uint8_t address); -void i2c_master_stop(void); -uint8_t i2c_master_write(uint8_t data); -uint8_t i2c_master_read(int); -void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); - - -static inline unsigned char i2c_start_read(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_READ); -} - -static inline unsigned char i2c_start_write(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_WRITE); -} - -// from SSD1306 scrips -extern unsigned char i2c_rep_start(unsigned char addr); -extern void i2c_start_wait(unsigned char addr); -extern unsigned char i2c_readAck(void); -extern unsigned char i2c_readNak(void); -extern unsigned char i2c_read(unsigned char ack); - -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); diff --git a/keyboards/hadron/ver2/ver2.c b/keyboards/hadron/ver2/ver2.c index abf21d425688..ca13427497ee 100644 --- a/keyboards/hadron/ver2/ver2.c +++ b/keyboards/hadron/ver2/ver2.c @@ -1,12 +1,13 @@ #include "ver2.h" #ifdef OLED_ENABLE -oled_rotation_t oled_init_kb(oled_rotation_t rotation) { return OLED_ROTATION_180; } +__attribute__ ((weak)) +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; +} -bool oled_task_kb(void) { - if (!oled_task_user()) { - return false; - } +__attribute__ ((weak)) +void oled_task_user(void) { oled_write_P(PSTR("LAYER "), false); oled_write_char(get_highest_layer(layer_state) + 0x30, true); @@ -60,6 +61,5 @@ bool oled_task_kb(void) { for (uint8_t y = 0; y < 8; y++) { oled_write_pixel(35, 0 + y, true); } - return false; } #endif diff --git a/keyboards/hadron/ver2/ver2.h b/keyboards/hadron/ver2/ver2.h index e7577d268471..8127b497f7c5 100644 --- a/keyboards/hadron/ver2/ver2.h +++ b/keyboards/hadron/ver2/ver2.h @@ -1,3 +1,3 @@ #pragma once -#include "../hadron.h" +#include "hadron.h" diff --git a/keyboards/hadron/ver3/rules.mk b/keyboards/hadron/ver3/rules.mk index da70b2a9bf19..ad753a5ff19e 100644 --- a/keyboards/hadron/ver3/rules.mk +++ b/keyboards/hadron/ver3/rules.mk @@ -6,21 +6,22 @@ BOARD = QMK_PROTON_C BOOTLOADER = stm32-dfu # Build Options -# change yes to no to disable +# comment out to disable the options. # BACKLIGHT_ENABLE = no -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +BOOTMAGIC_ENABLE = lite # Enable Bootmagic Lite MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = yes # Enable N-Key Rollover +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +CUSTOM_MATRIX = no # Custom matrix file AUDIO_ENABLE = yes RGBLIGHT_ENABLE = yes RGB_MATRIX_ENABLE = no # once arm_rgb is implemented RGB_MATRIX_DRIVER = WS2812 -HAPTIC_ENABLE = yes -HAPTIC_DRIVER = DRV2605L +HAPTIC_ENABLE += DRV2605L OLED_ENABLE = yes OLED_DRIVER = SSD1306 ENCODER_ENABLER = yes diff --git a/keyboards/hadron/ver3/ver3.c b/keyboards/hadron/ver3/ver3.c index 4c5a2e0c9abe..7eabe585586d 100644 --- a/keyboards/hadron/ver3/ver3.c +++ b/keyboards/hadron/ver3/ver3.c @@ -34,14 +34,14 @@ led_config_t g_led_config = { { #endif #ifdef OLED_ENABLE -oled_rotation_t oled_init_kb(oled_rotation_t rotation) { return OLED_ROTATION_180; } +__attribute__ ((weak)) +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; +} -bool oled_task_kb(void) { - if (!oled_task_user()) { - return false; - } - oled_write_P(PSTR("LAYER"), false); - oled_advance_char(); +__attribute__ ((weak)) +void oled_task_user(void) { + oled_write_P(PSTR("LAYER "), false); oled_write_char(get_highest_layer(layer_state) + 0x30, true); led_t led_state = host_keyboard_led_state(); @@ -71,10 +71,6 @@ bool oled_task_kb(void) { for (uint8_t x = 0; x < MATRIX_ROWS; x++) { for (uint8_t y = 0; y < MATRIX_COLS; y++) { bool on = (matrix_get_row(x) & (1 << y)) > 0; - - // force on for oled location - if((x == 0) && (y >= (MATRIX_COLS - 3))) on = 1; - oled_write_pixel(MATRIX_DISPLAY_X + y + 2, MATRIX_DISPLAY_Y + x + 2, on); } } @@ -89,10 +85,14 @@ bool oled_task_kb(void) { oled_write_pixel(MATRIX_DISPLAY_X + 19, MATRIX_DISPLAY_Y+y, true); } + // oled location + for (uint8_t x = 0; x < 3; x++) { + oled_write_pixel(MATRIX_DISPLAY_X + 14 + x, MATRIX_DISPLAY_Y + 2, true); + } + // bodge for layer number left hand side for (uint8_t y = 0; y < 8; y++) { oled_write_pixel(35, 0 + y, true); } - return false; } #endif