summaryrefslogtreecommitdiff
path: root/keyboards/miiiw
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/miiiw')
-rw-r--r--keyboards/miiiw/blackio83/blackio83.c21
-rw-r--r--keyboards/miiiw/blackio83/info.json3
-rw-r--r--keyboards/miiiw/blackio83/rev_0100/config.h13
3 files changed, 15 insertions, 22 deletions
diff --git a/keyboards/miiiw/blackio83/blackio83.c b/keyboards/miiiw/blackio83/blackio83.c
index 0d8412624e..8c80ebd73c 100644
--- a/keyboards/miiiw/blackio83/blackio83.c
+++ b/keyboards/miiiw/blackio83/blackio83.c
@@ -97,34 +97,37 @@ void keyboard_post_init_kb(void) {
loop10hz_token = defer_exec(LOOP_10HZ_PERIOD, loop_10Hz, NULL);
}
-__attribute__((weak)) void shutdown_user(void) {
+bool shutdown_kb(bool jump_to_bootloader) {
+ if (shutdown_user(jump_to_bootloader)) {
#ifdef RGB_MATRIX_ENABLE
- rgb_matrix_set_suspend_state(true);
-#endif // RGB_MATRIX_ENABLE
- wait_ms(10);
+ rgb_matrix_set_suspend_state(true);
+#endif // RGB_MATRIX_ENABLE
+ wait_ms(10);
+ }
ws2812_poweroff();
+ return true;
}
#ifdef DIP_SWITCH_ENABLE
bool dip_switch_update_mask_kb(uint32_t state) {
if (!dip_switch_update_mask_user(state)) { return false; }
-
+
if(state & 0x01) {
led_suspend();
usbDisconnectBus(&USB_DRIVER);
usbStop(&USB_DRIVER);
- shutdown_user();
+ shutdown_user(true);
setPinInputHigh(POWER_SWITCH_PIN);
palEnableLineEvent(POWER_SWITCH_PIN, PAL_EVENT_MODE_RISING_EDGE);
POWER_EnterSleep();
}
-
+
return true;
}
#endif
uint32_t loop_10Hz(uint32_t trigger_time, void *cb_arg) {
-
+
if(last_input_activity_elapsed() > 1000) {
static uint32_t pmu_timer = 0;
if(timer_elapsed32(pmu_timer) > 3000) {
@@ -144,7 +147,7 @@ uint32_t loop_10Hz(uint32_t trigger_time, void *cb_arg) {
extern matrix_row_t matrix[MATRIX_ROWS];
static uint32_t restore_tick = 0;
- if(matrix[0] == 0x4000 && matrix[1] == 0 &&
+ if(matrix[0] == 0x4000 && matrix[1] == 0 &&
matrix[2] == 0 && matrix[3] == 0 && matrix[4] == 0 && matrix[5] == 0x201) {
if(restore_tick++ > 50) {
restore_tick = 0;
diff --git a/keyboards/miiiw/blackio83/info.json b/keyboards/miiiw/blackio83/info.json
index 40fc6b7d89..107e288099 100644
--- a/keyboards/miiiw/blackio83/info.json
+++ b/keyboards/miiiw/blackio83/info.json
@@ -26,6 +26,9 @@
"cols": ["H0", "H1", "H2", "H3", "H4", "H5", "H6", "H7", "H8", "H9", "H10", "H11", "H12", "H13", "H14", "H15"],
"rows": ["A7", "A6", "A5", "A4", "A3", "A2"]
},
+ "dip_switch": {
+ "pins": ["B0", "B1", "B8", "B12"]
+ },
"processor": "STM32F072",
"rgb_matrix": {
"driver": "ws2812",
diff --git a/keyboards/miiiw/blackio83/rev_0100/config.h b/keyboards/miiiw/blackio83/rev_0100/config.h
index 803c8a8a3b..e68a9d0b16 100644
--- a/keyboards/miiiw/blackio83/rev_0100/config.h
+++ b/keyboards/miiiw/blackio83/rev_0100/config.h
@@ -16,20 +16,7 @@
#pragma once
-/*
- * Keyboard Matrix Assignments
- *
- * Change this to how you wired your keyboard
- * COLS: AVR pins used for columns, left to right
- * ROWS: AVR pins used for rows, top to bottom
- * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
- * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
- *
- */
-
-/* Dip Switch */
#define POWER_SWITCH_PIN B0
-#define DIP_SWITCH_PINS { B0, B1, B8, B12 }
/* 16 with dummy columns for shift registers */
#define SHR_SERIES_NUM 2