Skip to content

Commit

Permalink
Migrate hadron away from QWIIC_DRIVERS (qmk#14415)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr authored and coquizen committed Jun 3, 2022
1 parent 7a87505 commit 5b8a592
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 70 deletions.
46 changes: 0 additions & 46 deletions keyboards/hadron/i2c.h

This file was deleted.

12 changes: 6 additions & 6 deletions keyboards/hadron/ver2/ver2.c
Original file line number Diff line number Diff line change
@@ -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);

Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion keyboards/hadron/ver2/ver2.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#pragma once

#include "../hadron.h"
#include "hadron.h"
11 changes: 6 additions & 5 deletions keyboards/hadron/ver3/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
24 changes: 12 additions & 12 deletions keyboards/hadron/ver3/ver3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
}
}
Expand All @@ -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

0 comments on commit 5b8a592

Please sign in to comment.