summaryrefslogtreecommitdiff
path: root/keyboards/cannonkeys/satisfaction75
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/cannonkeys/satisfaction75')
-rw-r--r--keyboards/cannonkeys/satisfaction75/config.h19
-rw-r--r--keyboards/cannonkeys/satisfaction75/i2c_master.c4
-rw-r--r--keyboards/cannonkeys/satisfaction75/prototype/info.json12
-rw-r--r--keyboards/cannonkeys/satisfaction75/rev1/info.json32
-rw-r--r--keyboards/cannonkeys/satisfaction75/rev1/rev1.h2
-rw-r--r--keyboards/cannonkeys/satisfaction75/satisfaction75.c118
-rw-r--r--keyboards/cannonkeys/satisfaction75/satisfaction75.h8
-rw-r--r--keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c58
-rw-r--r--keyboards/cannonkeys/satisfaction75/satisfaction_oled.c14
9 files changed, 186 insertions, 81 deletions
diff --git a/keyboards/cannonkeys/satisfaction75/config.h b/keyboards/cannonkeys/satisfaction75/config.h
index 092b372577..8387289d87 100644
--- a/keyboards/cannonkeys/satisfaction75/config.h
+++ b/keyboards/cannonkeys/satisfaction75/config.h
@@ -35,7 +35,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_ROW_PINS { B3, B4, A0, A2, A4, A3 }
#define DIODE_DIRECTION COL2ROW
-#define NUMBER_OF_ENCODERS 1
#define ENCODERS_PAD_A { B9 }
#define ENCODERS_PAD_B { B8 }
@@ -72,15 +71,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// TODO: refactor with new user EEPROM code (coming soon)
#define EEPROM_MAGIC 0x451F
-#define EEPROM_MAGIC_ADDR 32
+#define EEPROM_MAGIC_ADDR 40
// Bump this every time we change what we store
// This will automatically reset the EEPROM with defaults
// and avoid loading invalid data from the EEPROM
#define EEPROM_VERSION 0x01
-#define EEPROM_VERSION_ADDR 34
+#define EEPROM_VERSION_ADDR 42
// Dynamic keymap starts after EEPROM version
-#define DYNAMIC_KEYMAP_EEPROM_ADDR 35
+#define DYNAMIC_KEYMAP_EEPROM_ADDR 43
// Dynamic macro starts after dynamic keymaps (35+(4*6*16*2)) = (35+768) = 803
@@ -90,13 +89,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// 1 for OLED default mode
// 6 for 3x custom encoder settings, left, right, and press (18 total)
-#define DYNAMIC_KEYMAP_ENABLED_ENCODER_MODES 803
-#define DYNAMIC_KEYMAP_CUSTOM_BACKLIGHT 804
-#define DYNAMIC_KEYMAP_DEFAULT_OLED 805
-#define DYNAMIC_KEYMAP_CUSTOM_ENCODER 806
+#define DYNAMIC_KEYMAP_ENABLED_ENCODER_MODES 811
+#define DYNAMIC_KEYMAP_CUSTOM_BACKLIGHT 812
+#define DYNAMIC_KEYMAP_DEFAULT_OLED 813
+#define DYNAMIC_KEYMAP_CUSTOM_ENCODER 814
-#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 824
-#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 200
+#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 832
+#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 192
#define DYNAMIC_KEYMAP_MACRO_COUNT 16
diff --git a/keyboards/cannonkeys/satisfaction75/i2c_master.c b/keyboards/cannonkeys/satisfaction75/i2c_master.c
index 56e810d32a..0e3adbbf16 100644
--- a/keyboards/cannonkeys/satisfaction75/i2c_master.c
+++ b/keyboards/cannonkeys/satisfaction75/i2c_master.c
@@ -110,11 +110,11 @@ i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data,
return chibios_to_qmk(status);
}
-i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t* regaddr, uint8_t* data, uint16_t length, uint16_t timeout)
+i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)
{
i2c_address = devaddr;
i2cStart(&I2C_DRIVER, &i2cconfig);
- msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), regaddr, 1, data, length, MS2ST(timeout));
+ msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), &regaddr, 1, data, length, MS2ST(timeout));
return chibios_to_qmk(status);
}
diff --git a/keyboards/cannonkeys/satisfaction75/prototype/info.json b/keyboards/cannonkeys/satisfaction75/prototype/info.json
new file mode 100644
index 0000000000..8f5ab9f2a6
--- /dev/null
+++ b/keyboards/cannonkeys/satisfaction75/prototype/info.json
@@ -0,0 +1,12 @@
+{
+ "keyboard_name": "Satisfaction75 prototype",
+ "url": "",
+ "maintainer": "Cannon Keys",
+ "width": 16.5,
+ "height": 6.5,
+ "layouts": {
+ "LAYOUT_default": {
+ "layout": [{"x":0, "y":0}, {"x":1.5, "y":0}, {"x":2.5, "y":0}, {"x":3.5, "y":0}, {"x":4.5, "y":0}, {"x":5.75, "y":0}, {"x":6.75, "y":0}, {"x":7.75, "y":0}, {"x":8.75, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25, "w":2}, {"x":15.5, "y":1}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.5, "y":2.25, "w":1.5}, {"x":15.5, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25, "w":2.25}, {"x":15.5, "y":3.25}, {"x":0, "y":4.25, "w":2.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":1.75}, {"x":14.25, "y":4.5}, {"x":15.5, "y":4.25}, {"x":0, "y":5.25, "w":1.25}, {"x":1.25, "y":5.25, "w":1.25}, {"x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"x":10, "y":5.25}, {"x":11, "y":5.25}, {"x":12, "y":5.25}, {"x":13.25, "y":5.5}, {"x":14.25, "y":5.5}, {"x":15.25, "y":5.5}]
+ }
+ }
+}
diff --git a/keyboards/cannonkeys/satisfaction75/rev1/info.json b/keyboards/cannonkeys/satisfaction75/rev1/info.json
new file mode 100644
index 0000000000..fd25aacdb7
--- /dev/null
+++ b/keyboards/cannonkeys/satisfaction75/rev1/info.json
@@ -0,0 +1,32 @@
+{
+ "keyboard_name": "Satisfaction75 rev1",
+ "url": "",
+ "maintainer": "Cannon Keys",
+ "width": 16.5,
+ "height": 6.5,
+ "layouts": {
+ "LAYOUT_default": {
+ "layout": [{"x":0, "y":0}, {"x":1.5, "y":0}, {"x":2.5, "y":0}, {"x":3.5, "y":0}, {"x":4.5, "y":0}, {"x":5.75, "y":0}, {"x":6.75, "y":0}, {"x":7.75, "y":0}, {"x":8.75, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25, "w":2}, {"x":15.5, "y":1}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.5, "y":2.25, "w":1.5}, {"x":15.5, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25, "w":2.25}, {"x":15.5, "y":3.25}, {"x":0, "y":4.25, "w":2.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":1.75}, {"x":14.25, "y":4.5}, {"x":15.5, "y":4.25}, {"x":0, "y":5.25, "w":1.25}, {"x":1.25, "y":5.25, "w":1.25}, {"x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"x":10, "y":5.25}, {"x":11, "y":5.25}, {"x":12, "y":5.25}, {"x":13.25, "y":5.5}, {"x":14.25, "y":5.5}, {"x":15.25, "y":5.5}]
+ },
+
+ "LAYOUT_iso": {
+ "layout": [{"x":0, "y":0}, {"x":1.5, "y":0}, {"x":2.5, "y":0}, {"x":3.5, "y":0}, {"x":4.5, "y":0}, {"x":5.75, "y":0}, {"x":6.75, "y":0}, {"x":7.75, "y":0}, {"x":8.75, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25, "w":2}, {"x":15.5, "y":1}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":15.5, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25}, {"x":13.75, "y":2.25, "w":1.25, "h":2}, {"x":15.5, "y":3.25}, {"x":0, "y":4.25, "w":1.25}, {"x":1.25, "y":4.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":1.75}, {"x":14.25, "y":4.5}, {"x":15.5, "y":4.25}, {"x":0, "y":5.25, "w":1.25}, {"x":1.25, "y":5.25, "w":1.25}, {"x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"x":10, "y":5.25}, {"x":11, "y":5.25}, {"x":12, "y":5.25}, {"x":13.25, "y":5.5}, {"x":14.25, "y":5.5}, {"x":15.25, "y":5.5}]
+ },
+
+ "LAYOUT_3x2": {
+ "layout": [{"x":0, "y":0}, {"x":1.5, "y":0}, {"x":2.5, "y":0}, {"x":3.5, "y":0}, {"x":4.5, "y":0}, {"x":5.75, "y":0}, {"x":6.75, "y":0}, {"x":7.75, "y":0}, {"x":8.75, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25, "w":2}, {"x":15.5, "y":1}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.5, "y":2.25, "w":1.5}, {"x":15.5, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25, "w":2.25}, {"x":15.5, "y":3.25}, {"x":0, "y":4.25, "w":2.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":1.75}, {"x":14.25, "y":4.5}, {"x":15.5, "y":4.25}, {"x":0, "y":5.25, "w":1.25}, {"x":1.25, "y":5.25, "w":1.25}, {"x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"x":10, "y":5.25, "w":1.5}, {"x":11.5, "y":5.25, "w":1.5}, {"x":13.25, "y":5.5}, {"x":14.25, "y":5.5}, {"x":15.25, "y":5.5}]
+ },
+
+ "LAYOUT_2x2": {
+ "layout": [{"x":0, "y":0}, {"x":1.5, "y":0}, {"x":2.5, "y":0}, {"x":3.5, "y":0}, {"x":4.5, "y":0}, {"x":5.75, "y":0}, {"x":6.75, "y":0}, {"x":7.75, "y":0}, {"x":8.75, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25}, {"x":14, "y":1.25}, {"x":15.5, "y":1}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.5, "y":2.25, "w":1.5}, {"x":15.5, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25, "w":2.25}, {"x":15.5, "y":3.25}, {"x":0, "y":4.25, "w":2.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":1.75}, {"x":14.25, "y":4.5}, {"x":15.5, "y":4.25}, {"x":0, "y":5.25, "w":1.5}, {"x":1.5, "y":5.25, "w":1.5}, {"x":3, "y":5.25, "w":7}, {"x":10, "y":5.25, "w":1.5}, {"x":11.5, "y":5.25, "w":1.5}, {"x":13.25, "y":5.5}, {"x":14.25, "y":5.5}, {"x":15.25, "y":5.5}]
+ },
+
+ "LAYOUT_split_space": {
+ "layout": [{"x":0, "y":0}, {"x":1.5, "y":0}, {"x":2.5, "y":0}, {"x":3.5, "y":0}, {"x":4.5, "y":0}, {"x":5.75, "y":0}, {"x":6.75, "y":0}, {"x":7.75, "y":0}, {"x":8.75, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25, "w":2}, {"x":15.5, "y":1}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.5, "y":2.25, "w":1.5}, {"x":15.5, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25, "w":2.25}, {"x":15.5, "y":3.25}, {"x":0, "y":4.25, "w":2.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":1.75}, {"x":14.25, "y":4.5}, {"x":15.5, "y":4.25}, {"x":0, "y":5.25, "w":1.25}, {"x":1.25, "y":5.25, "w":1.25}, {"x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":2.25}, {"x":6, "y":5.25, "w":1.25}, {"x":7.25, "y":5.25, "w":2.75}, {"x":10, "y":5.25}, {"x":11, "y":5.25}, {"x":12, "y":5.25}, {"x":13.25, "y":5.5}, {"x":14.25, "y":5.5}, {"x":15.25, "y":5.5}]
+ },
+
+ "LAYOUT_all": {
+ "layout": [{"x":0, "y":0}, {"x":1.5, "y":0}, {"x":2.5, "y":0}, {"x":3.5, "y":0}, {"x":4.5, "y":0}, {"x":5.75, "y":0}, {"x":6.75, "y":0}, {"x":7.75, "y":0}, {"x":8.75, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":5, "y":1.25}, {"x":6, "y":1.25}, {"x":7, "y":1.25}, {"x":8, "y":1.25}, {"x":9, "y":1.25}, {"x":10, "y":1.25}, {"x":11, "y":1.25}, {"x":12, "y":1.25}, {"x":13, "y":1.25}, {"x":14, "y":1.25}, {"x":15.5, "y":1}, {"x":0, "y":2.25, "w":1.5}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":5.5, "y":2.25}, {"x":6.5, "y":2.25}, {"x":7.5, "y":2.25}, {"x":8.5, "y":2.25}, {"x":9.5, "y":2.25}, {"x":10.5, "y":2.25}, {"x":11.5, "y":2.25}, {"x":12.5, "y":2.25}, {"x":13.5, "y":2.25, "w":1.5}, {"x":15.5, "y":2.25}, {"x":0, "y":3.25, "w":1.75}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":5.75, "y":3.25}, {"x":6.75, "y":3.25}, {"x":7.75, "y":3.25}, {"x":8.75, "y":3.25}, {"x":9.75, "y":3.25}, {"x":10.75, "y":3.25}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3.25}, {"x":13.75, "y":3.25, "w":1.25}, {"x":15.5, "y":3.25}, {"x":0, "y":4.25, "w":1.25}, {"x":1.25, "y":4.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.25, "y":4.25}, {"x":6.25, "y":4.25}, {"x":7.25, "y":4.25}, {"x":8.25, "y":4.25}, {"x":9.25, "y":4.25}, {"x":10.25, "y":4.25}, {"x":11.25, "y":4.25}, {"x":12.25, "y":4.25, "w":1.75}, {"x":14.25, "y":4.5}, {"x":15.5, "y":4.25}, {"x":0, "y":5.25, "w":1.25}, {"x":1.25, "y":5.25, "w":1.25}, {"x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":2.25}, {"x":6, "y":5.25, "w":1.25}, {"x":7.25, "y":5.25, "w":2.75}, {"x":10, "y":5.25}, {"x":11, "y":5.25}, {"x":12, "y":5.25}, {"x":13.25, "y":5.5}, {"x":14.25, "y":5.5}, {"x":15.25, "y":5.5}]
+ }
+ }
+}
diff --git a/keyboards/cannonkeys/satisfaction75/rev1/rev1.h b/keyboards/cannonkeys/satisfaction75/rev1/rev1.h
index 302b7e43de..65ff16b985 100644
--- a/keyboards/cannonkeys/satisfaction75/rev1/rev1.h
+++ b/keyboards/cannonkeys/satisfaction75/rev1/rev1.h
@@ -24,7 +24,7 @@
#define LAYOUT_iso( \
K000, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \
- K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \
+ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K215, \
K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K315, \
K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K415, \
K500, K501, K502, K505, K509, K510, K511, K512, K513, K515 \
diff --git a/keyboards/cannonkeys/satisfaction75/satisfaction75.c b/keyboards/cannonkeys/satisfaction75/satisfaction75.c
index 0e788b29b7..12d3660dae 100644
--- a/keyboards/cannonkeys/satisfaction75/satisfaction75.c
+++ b/keyboards/cannonkeys/satisfaction75/satisfaction75.c
@@ -17,8 +17,8 @@
#include "tmk_core/common/eeprom.h"
// HACK
-#include "keyboards/zeal60/zeal60_api.h" // Temporary hack
-#include "keyboards/zeal60/zeal60_keycodes.h" // Temporary hack
+#include "keyboards/wilba_tech/via_api.h" // Temporary hack
+#include "keyboards/wilba_tech/via_keycodes.h" // Temporary hack
/* Artificial delay added to get media keys to work in the encoder*/
@@ -72,7 +72,7 @@ void eeprom_set_valid(bool valid)
void eeprom_reset(void)
{
- // Set the Zeal60 specific EEPROM state as invalid.
+ // Set the VIA specific EEPROM state as invalid.
eeprom_set_valid(false);
// Set the TMK/QMK EEPROM state as invalid.
eeconfig_disable();
@@ -94,51 +94,53 @@ void raw_hid_receive( uint8_t *data, uint8_t length )
}
case id_get_keyboard_value:
{
- switch( command_data[0])
- {
- case id_uptime:
- {
- uint32_t value = timer_read32();
- command_data[1] = (value >> 24 ) & 0xFF;
- command_data[2] = (value >> 16 ) & 0xFF;
- command_data[3] = (value >> 8 ) & 0xFF;
- command_data[4] = value & 0xFF;
- break;
- }
- case id_oled_default_mode:
- {
- uint8_t default_oled = eeprom_read_byte((uint8_t*)DYNAMIC_KEYMAP_DEFAULT_OLED);
- command_data[1] = default_oled;
- break;
- }
- case id_oled_mode:
- {
- command_data[1] = oled_mode;
- break;
-
- }
- case id_encoder_modes:
- {
- command_data[1] = enabled_encoder_modes;
- break;
- }
- case id_encoder_custom:
- {
- // uint8_t custom_encoder_idx = command_data[1];
- // command_data[2] = 0x00;
- // command_data[3] = 0x00;
- // command_data[4] = 0x00;
- // command_data[5] = 0x00;
- // command_data[6] = 0x00;
- // command_data[7] = 0x00;
- break;
- }
- default:
- {
- *command_id = id_unhandled;
- break;
- }
- }
+ switch( command_data[0])
+ {
+ case id_uptime:
+ {
+ uint32_t value = timer_read32();
+ command_data[1] = (value >> 24 ) & 0xFF;
+ command_data[2] = (value >> 16 ) & 0xFF;
+ command_data[3] = (value >> 8 ) & 0xFF;
+ command_data[4] = value & 0xFF;
+ break;
+ }
+ case id_oled_default_mode:
+ {
+ uint8_t default_oled = eeprom_read_byte((uint8_t*)DYNAMIC_KEYMAP_DEFAULT_OLED);
+ command_data[1] = default_oled;
+ break;
+ }
+ case id_oled_mode:
+ {
+ command_data[1] = oled_mode;
+ break;
+ }
+ case id_encoder_modes:
+ {
+ command_data[1] = enabled_encoder_modes;
+ break;
+ }
+ case id_encoder_custom:
+ {
+ uint8_t custom_encoder_idx = command_data[1];
+ uint16_t keycode = retrieve_custom_encoder_config(custom_encoder_idx, ENC_CUSTOM_CW);
+ command_data[2] = keycode >> 8;
+ command_data[3] = keycode & 0xFF;
+ keycode = retrieve_custom_encoder_config(custom_encoder_idx, ENC_CUSTOM_CCW);
+ command_data[4] = keycode >> 8;
+ command_data[5] = keycode & 0xFF;
+ keycode = retrieve_custom_encoder_config(custom_encoder_idx, ENC_CUSTOM_PRESS);
+ command_data[6] = keycode >> 8;
+ command_data[7] = keycode & 0xFF;
+ break;
+ }
+ default:
+ {
+ *command_id = id_unhandled;
+ break;
+ }
+ }
break;
}
#ifdef DYNAMIC_KEYMAP_ENABLE
@@ -164,7 +166,10 @@ void raw_hid_receive( uint8_t *data, uint8_t length )
}
case id_encoder_custom:
{
- // uint8_t custom_encoder_idx = command_data[1];
+ uint8_t custom_encoder_idx = command_data[1];
+ uint8_t encoder_behavior = command_data[2];
+ uint16_t keycode = (command_data[3] << 8) | command_data[4];
+ set_custom_encoder_config(custom_encoder_idx, encoder_behavior, keycode);
break;
}
default:
@@ -208,13 +213,6 @@ void raw_hid_receive( uint8_t *data, uint8_t length )
{
uint16_t offset = ( command_data[0] << 8 ) | command_data[1];
uint16_t size = command_data[2]; // size <= 28
- dynamic_keymap_macro_get_buffer( offset, size, &command_data[3] );
- break;
- }
- case id_dynamic_keymap_macro_set_buffer:
- {
- uint16_t offset = ( command_data[0] << 8 ) | command_data[1];
- uint16_t size = command_data[2]; // size <= 28
dynamic_keymap_macro_set_buffer( offset, size, &command_data[3] );
break;
}
@@ -339,9 +337,9 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
uint16_t mapped_code = handle_encoder_press();
uint16_t held_keycode_timer = timer_read();
if(mapped_code != 0){
- register_code(mapped_code);
+ register_code16(mapped_code);
while (timer_elapsed(held_keycode_timer) < MEDIA_KEY_DELAY){ /* no-op */ }
- unregister_code(mapped_code);
+ unregister_code16(mapped_code);
}
} else {
// Do something else when release
@@ -380,9 +378,9 @@ void encoder_update_kb(uint8_t index, bool clockwise) {
}
uint16_t held_keycode_timer = timer_read();
if(mapped_code != 0){
- register_code(mapped_code);
+ register_code16(mapped_code);
while (timer_elapsed(held_keycode_timer) < MEDIA_KEY_DELAY){ /* no-op */ }
- unregister_code(mapped_code);
+ unregister_code16(mapped_code);
}
} else {
if(clockwise){
diff --git a/keyboards/cannonkeys/satisfaction75/satisfaction75.h b/keyboards/cannonkeys/satisfaction75/satisfaction75.h
index dfab68017f..188a1d4970 100644
--- a/keyboards/cannonkeys/satisfaction75/satisfaction75.h
+++ b/keyboards/cannonkeys/satisfaction75/satisfaction75.h
@@ -47,6 +47,12 @@ enum encoder_modes {
ENC_MODE_CLOCK_SET // This shouldn't be included in the default modes, so we put it after NUM_ENCODER_MODES
};
+enum custom_encoder_behavior {
+ ENC_CUSTOM_CW = 0,
+ ENC_CUSTOM_CCW,
+ ENC_CUSTOM_PRESS
+};
+
enum oled_modes {
OLED_DEFAULT,
OLED_TIME,
@@ -96,6 +102,8 @@ void change_encoder_mode(bool negative);
uint16_t handle_encoder_clockwise(void);
uint16_t handle_encoder_ccw(void);
uint16_t handle_encoder_press(void);
+uint16_t retrieve_custom_encoder_config(uint8_t encoder_idx, uint8_t behavior);
+void set_custom_encoder_config(uint8_t encoder_idx, uint8_t behavior, uint16_t new_code);
void update_time_config(int8_t increment);
diff --git a/keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c b/keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c
index 6776816918..e866d897c7 100644
--- a/keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c
+++ b/keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c
@@ -1,4 +1,5 @@
#include "satisfaction75.h"
+#include "tmk_core/common/eeprom.h"
void pre_encoder_mode_change(){
if(encoder_mode == ENC_MODE_CLOCK_SET){
@@ -111,6 +112,17 @@ uint16_t handle_encoder_clockwise(){
case ENC_MODE_BRIGHTNESS:
mapped_code = KC_BRIGHTNESS_UP;
break;
+#ifdef DYNAMIC_KEYMAP_ENABLE
+ case ENC_MODE_CUSTOM0:
+ mapped_code = retrieve_custom_encoder_config(0, ENC_CUSTOM_CW);
+ break;
+ case ENC_MODE_CUSTOM1:
+ mapped_code = retrieve_custom_encoder_config(1, ENC_CUSTOM_CW);
+ break;
+ case ENC_MODE_CUSTOM2:
+ mapped_code = retrieve_custom_encoder_config(2, ENC_CUSTOM_CW);
+ break;
+#endif
case ENC_MODE_CLOCK_SET:
update_time_config(1);
queue_for_send = true;
@@ -145,6 +157,18 @@ uint16_t handle_encoder_ccw(){
case ENC_MODE_BRIGHTNESS:
mapped_code = KC_BRIGHTNESS_DOWN;
break;
+#ifdef DYNAMIC_KEYMAP_ENABLE
+ case ENC_MODE_CUSTOM0:
+ mapped_code = retrieve_custom_encoder_config(0, ENC_CUSTOM_CCW);
+ break;
+ case ENC_MODE_CUSTOM1:
+ mapped_code = retrieve_custom_encoder_config(1, ENC_CUSTOM_CCW);
+ break;
+ case ENC_MODE_CUSTOM2:
+ mapped_code = retrieve_custom_encoder_config(2, ENC_CUSTOM_CCW);
+ break;
+#endif
+
case ENC_MODE_CLOCK_SET:
update_time_config(-1);
queue_for_send = true;
@@ -159,6 +183,7 @@ uint16_t handle_encoder_press(){
case ENC_MODE_VOLUME:
mapped_code = KC_MUTE;
break;
+ default:
case ENC_MODE_MEDIA:
mapped_code = KC_MEDIA_PLAY_PAUSE;
break;
@@ -174,11 +199,42 @@ uint16_t handle_encoder_press(){
breathing_enable();
}
break;
+#ifdef DYNAMIC_KEYMAP_ENABLE
+ case ENC_MODE_CUSTOM0:
+ mapped_code = retrieve_custom_encoder_config(0, ENC_CUSTOM_PRESS);
+ break;
+ case ENC_MODE_CUSTOM1:
+ mapped_code = retrieve_custom_encoder_config(1, ENC_CUSTOM_PRESS);
+ break;
+ case ENC_MODE_CUSTOM2:
+ mapped_code = retrieve_custom_encoder_config(2, ENC_CUSTOM_PRESS);
+ break;
+#endif
case ENC_MODE_CLOCK_SET:
time_config_idx = (time_config_idx + 1) % 5;
- default:
case ENC_MODE_BRIGHTNESS:
break;
}
return mapped_code;
}
+
+
+uint16_t retrieve_custom_encoder_config(uint8_t encoder_idx, uint8_t behavior){
+#ifdef DYNAMIC_KEYMAP_ENABLE
+ void* addr = (void*)(DYNAMIC_KEYMAP_CUSTOM_ENCODER + (encoder_idx * 6) + (behavior * 2));
+ //big endian
+ uint16_t keycode = eeprom_read_byte(addr) << 8;
+ keycode |= eeprom_read_byte(addr + 1);
+ return keycode;
+#else
+ return 0;
+#endif
+}
+
+void set_custom_encoder_config(uint8_t encoder_idx, uint8_t behavior, uint16_t new_code){
+#ifdef DYNAMIC_KEYMAP_ENABLE
+ void* addr = (void*)(DYNAMIC_KEYMAP_CUSTOM_ENCODER + (encoder_idx * 6) + (behavior * 2));
+ eeprom_update_byte(addr, (uint8_t)(new_code >> 8));
+ eeprom_update_byte(addr + 1, (uint8_t)(new_code & 0xFF));
+#endif
+}
diff --git a/keyboards/cannonkeys/satisfaction75/satisfaction_oled.c b/keyboards/cannonkeys/satisfaction75/satisfaction_oled.c
index 4e22587db8..6553bd1300 100644
--- a/keyboards/cannonkeys/satisfaction75/satisfaction_oled.c
+++ b/keyboards/cannonkeys/satisfaction75/satisfaction_oled.c
@@ -91,8 +91,8 @@ void draw_default(){
if (hour == 0){
hour = 12;
}
- char hour_str[2] = "";
- char min_str[2] = "";
+ char hour_str[3] = "";
+ char min_str[3] = "";
sprintf(hour_str, "%02d", hour);
sprintf(min_str, "%02d", minute);
@@ -199,11 +199,11 @@ void draw_clock(){
if (hour == 0){
hour = 12;
}
- char hour_str[2] = "";
- char min_str[2] = "";
- char year_str[4] = "";
- char month_str[2] = "";
- char day_str[2] = "";
+ char hour_str[3] = "";
+ char min_str[3] = "";
+ char year_str[5] = "";
+ char month_str[3] = "";
+ char day_str[3] = "";
sprintf(hour_str, "%02d", hour);
sprintf(min_str, "%02d", minute);