Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove custom ISSI lighting code #22073

Merged
merged 9 commits into from
Sep 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions keyboards/capsunlocked/cu75/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#pragma once

#define BACKLIGHT_PWM_MAP {8, 16, 40, 55, 70, 128, 200, 255}

/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
Expand Down
45 changes: 1 addition & 44 deletions keyboards/capsunlocked/cu75/cu75.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
#include <avr/sfr_defs.h>
#include <avr/timer_avr.h>
#include <avr/wdt.h>
#include "cu75.h"
#include "debug.h"
#include "../lfkeyboards/issi.h"
#include "../lfkeyboards/TWIlib.h"
#include "../lfkeyboards/lighting.h"
#include <avr/wdt.h>

#ifdef AUDIO_ENABLE
float test_sound[][2] = SONG(STARTUP_SOUND);
#include "audio.h"
#endif

uint16_t click_hz = CLICK_HZ;
Expand All @@ -34,39 +27,12 @@ void matrix_init_kb(void)
setPinOutput(C6);
writePinLow(C6);
#endif
#ifdef ISSI_ENABLE
issi_init();
#endif
}

void matrix_scan_kb(void)
{
#ifdef WATCHDOG_ENABLE
wdt_reset();
#endif
#ifdef ISSI_ENABLE
// switch/underglow lighting update
static uint32_t issi_device = 0;
static uint32_t twi_last_ready = 0;
if(twi_last_ready > 1000){
// Its been way too long since the last ISSI update, reset the I2C bus and start again
dprintf("TWI failed to recover, TWI re-init\n");
twi_last_ready = 0;
TWIInit();
force_issi_refresh();
}
if(isTWIReady()){
twi_last_ready = 0;
// If the i2c bus is available, kick off the issi update, alternate between devices
update_issi(issi_device, issi_device);
if(issi_device){
issi_device = 0;
}else{
issi_device = 3;
}
}else{
twi_last_ready++;
}
#endif
matrix_scan_user();
}
Expand All @@ -92,7 +58,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record)
}
if (keycode == QK_BOOT) {
reset_keyboard_kb();
} else {
}
return process_record_user(keycode, record);
}
Expand All @@ -105,11 +70,3 @@ void reset_keyboard_kb(void){
#endif
reset_keyboard();
}

// LFK lighting info
const uint8_t switch_matrices[] = {0, 1};
const uint8_t rgb_matrices[] = {6, 7};
const uint8_t rgb_sequence[] = {
24, 23, 22, 21, 20, 19, 18, 17, 1, 2, 3, 4, 5,
6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 9
};
17 changes: 0 additions & 17 deletions keyboards/capsunlocked/cu75/cu75.h
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
#pragma once

#include "quantum.h"
#include "matrix.h"
#include <avr/sfr_defs.h>

typedef struct RGB_Color {
uint16_t red;
uint16_t green;
uint16_t blue;
} RGB_Color;

typedef struct Layer_Info {
uint32_t layer;
uint32_t mask;
RGB_Color color;
} Layer_Info;

extern const uint32_t layer_count;
extern const Layer_Info layer_info[];

#define CLICK_HZ 500
#define CLICK_MS 2
Expand Down
24 changes: 0 additions & 24 deletions keyboards/capsunlocked/cu75/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,6 @@
"rows": ["F1", "B7", "B3", "D2", "D3", "B2"]
},
"diode_direction": "COL2ROW",
"backlight": {
"driver": "custom",
"levels": 8
},
"rgblight": {
"driver": "custom",
"hue_steps": 10,
"led_count": 24,
"animations": {
"breathing": true,
"rainbow_mood": true,
"rainbow_swirl": true,
"snake": true,
"knight": true,
"christmas": true,
"static_gradient": true,
"rgb_test": true,
"alternating": true,
"twinkle": true
}
},
"ws2812": {
"pin": "C7"
},
"processor": "atmega32u4",
"bootloader": "atmel-dfu",
"layouts": {
Expand Down
5 changes: 0 additions & 5 deletions keyboards/capsunlocked/cu75/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,5 @@ EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = yes
BACKLIGHT_ENABLE = yes # Disable keyboard backlight functionality
AUDIO_ENABLE = no # Audio output
RGBLIGHT_ENABLE = yes # Disable RGB underlight
SLEEP_LED_ENABLE = yes

ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be disabled
WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms
5 changes: 0 additions & 5 deletions keyboards/capsunlocked/cu75/keymaps/iso/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,5 @@ EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = yes
# BACKLIGHT_ENABLE = no # Disable keyboard backlight functionality
AUDIO_ENABLE = no # Audio output
RGBLIGHT_ENABLE = no # Disable RGB underlight
SLEEP_LED_ENABLE = yes

ISSI_ENABLE = no # If the I2C pullup resistors aren't install this must be disabled
WATCHDOG_ENABLE = yes # Resets keyboard if matrix_scan isn't run every 250ms
4 changes: 0 additions & 4 deletions keyboards/capsunlocked/cu75/post_rules.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
ifeq ($(strip $(ISSI_ENABLE)), yes)
OPT_DEFS += -DISSI_ENABLE
endif

ifeq ($(strip $(WATCHDOG_ENABLE)), yes)
OPT_DEFS += -DWATCHDOG_ENABLE
endif
Expand Down
3 changes: 0 additions & 3 deletions keyboards/capsunlocked/cu75/rules.mk
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
# TODO: These boards need to be converted to RGB Matrix
VPATH += keyboards/lfkeyboards
SRC = TWIlib.c issi.c lighting.c
Loading