Merge branch 'feat/moonlander-revb' into firmware25
Some checks failed
Build firmware / build-firmware (default) (push) Failing after 5s
Build firmware / build-firmware (oryx) (push) Failing after 2s
Unit Tests / test (push) Failing after 2s

This commit is contained in:
Florian Didron
2025-12-09 10:22:55 +07:00
8 changed files with 918 additions and 4 deletions

View File

@@ -454,10 +454,6 @@ void keyboard_post_init_kb(void) {
}
rgb_matrix_enable_noeeprom();
#endif
#if defined(DEFERRED_EXEC_ENABLE)
is_launching = true;
defer_exec(500, startup_exec, NULL);
#endif
#if defined(DEFERRED_EXEC_ENABLE)
is_launching = true;
defer_exec(500, startup_exec, NULL);

View File

@@ -0,0 +1,39 @@
/* Copyright 2020 ZSA Technology Labs, Inc <@zsa>
* Copyright 2020 Jack Humbert <jack.humb@gmail.com>
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
/* key matrix size */
#define MATRIX_ROWS 12
#define MATRIX_COLS 7
#define MCP23018_TIMEOUT 10
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_VCC
#define IS31FL3731_I2C_TIMEOUT 5
#define MUSIC_MAP
#define FIRMWARE_VERSION_SIZE 17
#define DYNAMIC_KEYMAP_EEPROM_ADDR (EECONFIG_SIZE + FIRMWARE_VERSION_SIZE)
#define AUDIO_PIN A5
#define AUDIO_PIN_ALT A4
#define AUDIO_PIN_ALT_AS_NEGATIVE
#define AUDIO_INIT_DELAY 100

View File

@@ -0,0 +1,784 @@
{
"keyboard_name": "Moonlander Mark I",
"manufacturer": "ZSA Technology Labs",
"url": "zsa.io/moonlander",
"maintainer": "ZSA via Drashna",
"usb": {
"vid": "0x3297",
"pid": "0x1972",
"device_version": "0.0.1",
"shared_endpoint": {
"mouse": false
}
},
"features": {
"audio": true,
"bootmagic": true,
"command": true,
"console": true,
"deferred_exec": true,
"extrakey": true,
"mousekey": true,
"nkro": true,
"rgb_matrix": true,
"swap_hands": true
},
"qmk": {
"locking": {
"enabled": true,
"resync": true
}
},
"audio": {
"driver": "dac_additive"
},
"dynamic_keymap": {
"layer_count": 8
},
"eeprom": {
"wear_leveling": {
"driver": "embedded_flash"
}
},
"mousekey": {
"delay": 0,
"interval": 20,
"max_speed": 7,
"time_to_max": 60,
"wheel_delay": 400
},
"rgb_matrix": {
"animations": {
"alphas_mods": true,
"gradient_up_down": true,
"gradient_left_right": true,
"breathing": true,
"band_sat": true,
"band_val": true,
"band_pinwheel_sat": true,
"band_pinwheel_val": true,
"band_spiral_sat": true,
"band_spiral_val": true,
"cycle_all": true,
"cycle_left_right": true,
"cycle_up_down": true,
"rainbow_moving_chevron": true,
"cycle_out_in": true,
"cycle_out_in_dual": true,
"cycle_pinwheel": true,
"cycle_spiral": true,
"dual_beacon": true,
"rainbow_beacon": true,
"rainbow_pinwheels": true,
"flower_blooming": true,
"raindrops": true,
"jellybean_raindrops": true,
"hue_breathing": true,
"hue_pendulum": true,
"hue_wave": true,
"pixel_rain": true,
"pixel_flow": true,
"pixel_fractal": true,
"typing_heatmap": true,
"digital_rain": true,
"solid_reactive_simple": true,
"solid_reactive": true,
"solid_reactive_wide": true,
"solid_reactive_multiwide": true,
"solid_reactive_cross": true,
"solid_reactive_multicross": true,
"solid_reactive_nexus": true,
"solid_reactive_multinexus": true,
"splash": true,
"multisplash": true,
"solid_splash": true,
"solid_multisplash": true,
"starlight": true,
"starlight_dual_hue": true,
"starlight_dual_sat": true,
"riverflow": true
},
"center_point": [120, 36],
"driver": "is31fl3731",
"layout": [
{"matrix": [0, 0], "x": 0, "y": 4, "flags": 1},
{"matrix": [1, 0], "x": 0, "y": 20, "flags": 1},
{"matrix": [2, 0], "x": 0, "y": 36, "flags": 1},
{"matrix": [3, 0], "x": 0, "y": 52, "flags": 1},
{"matrix": [4, 0], "x": 0, "y": 68, "flags": 1},
{"matrix": [0, 1], "x": 16, "y": 3, "flags": 4},
{"matrix": [1, 1], "x": 16, "y": 19, "flags": 4},
{"matrix": [2, 1], "x": 16, "y": 35, "flags": 4},
{"matrix": [3, 1], "x": 16, "y": 51, "flags": 4},
{"matrix": [4, 1], "x": 16, "y": 67, "flags": 1},
{"matrix": [0, 2], "x": 32, "y": 1, "flags": 4},
{"matrix": [1, 2], "x": 32, "y": 17, "flags": 4},
{"matrix": [2, 2], "x": 32, "y": 33, "flags": 4},
{"matrix": [3, 2], "x": 32, "y": 49, "flags": 4},
{"matrix": [4, 2], "x": 32, "y": 65, "flags": 1},
{"matrix": [0, 3], "x": 48, "y": 0, "flags": 4},
{"matrix": [1, 3], "x": 48, "y": 16, "flags": 4},
{"matrix": [2, 3], "x": 48, "y": 32, "flags": 4},
{"matrix": [3, 3], "x": 48, "y": 48, "flags": 4},
{"matrix": [4, 3], "x": 48, "y": 64, "flags": 1},
{"matrix": [0, 4], "x": 64, "y": 1, "flags": 4},
{"matrix": [1, 4], "x": 64, "y": 17, "flags": 4},
{"matrix": [2, 4], "x": 64, "y": 33, "flags": 4},
{"matrix": [3, 4], "x": 64, "y": 49, "flags": 4},
{"matrix": [4, 4], "x": 64, "y": 65, "flags": 1},
{"matrix": [0, 5], "x": 80, "y": 3, "flags": 4},
{"matrix": [1, 5], "x": 80, "y": 19, "flags": 4},
{"matrix": [2, 5], "x": 80, "y": 35, "flags": 4},
{"matrix": [3, 5], "x": 80, "y": 51, "flags": 4},
{"matrix": [0, 6], "x": 96, "y": 4, "flags": 1},
{"matrix": [1, 6], "x": 96, "y": 20, "flags": 1},
{"matrix": [2, 6], "x": 96, "y": 36, "flags": 1},
{"matrix": [5, 0], "x": 88, "y": 69, "flags": 1},
{"matrix": [5, 1], "x": 100, "y": 80, "flags": 1},
{"matrix": [5, 2], "x": 112, "y": 91, "flags": 1},
{"matrix": [5, 3], "x": 108, "y": 69, "flags": 1},
{"matrix": [6, 6], "x": 240, "y": 4, "flags": 1},
{"matrix": [7, 6], "x": 240, "y": 20, "flags": 1},
{"matrix": [8, 6], "x": 240, "y": 36, "flags": 1},
{"matrix": [9, 6], "x": 240, "y": 52, "flags": 1},
{"matrix": [10, 6], "x": 240, "y": 68, "flags": 1},
{"matrix": [6, 5], "x": 224, "y": 3, "flags": 4},
{"matrix": [7, 5], "x": 224, "y": 19, "flags": 4},
{"matrix": [8, 5], "x": 224, "y": 35, "flags": 4},
{"matrix": [9, 5], "x": 224, "y": 51, "flags": 4},
{"matrix": [10, 5], "x": 224, "y": 67, "flags": 1},
{"matrix": [6, 4], "x": 208, "y": 1, "flags": 4},
{"matrix": [7, 4], "x": 208, "y": 17, "flags": 4},
{"matrix": [8, 4], "x": 208, "y": 33, "flags": 4},
{"matrix": [9, 4], "x": 208, "y": 49, "flags": 4},
{"matrix": [10, 4], "x": 208, "y": 65, "flags": 1},
{"matrix": [6, 3], "x": 192, "y": 0, "flags": 4},
{"matrix": [7, 3], "x": 192, "y": 16, "flags": 4},
{"matrix": [8, 3], "x": 192, "y": 32, "flags": 4},
{"matrix": [9, 3], "x": 192, "y": 48, "flags": 4},
{"matrix": [10, 3], "x": 192, "y": 64, "flags": 1},
{"matrix": [6, 2], "x": 176, "y": 1, "flags": 4},
{"matrix": [7, 2], "x": 176, "y": 17, "flags": 4},
{"matrix": [8, 2], "x": 176, "y": 33, "flags": 4},
{"matrix": [9, 2], "x": 176, "y": 49, "flags": 4},
{"matrix": [10, 2], "x": 176, "y": 65, "flags": 1},
{"matrix": [6, 1], "x": 160, "y": 3, "flags": 4},
{"matrix": [7, 1], "x": 160, "y": 19, "flags": 4},
{"matrix": [8, 1], "x": 160, "y": 35, "flags": 4},
{"matrix": [9, 1], "x": 160, "y": 51, "flags": 4},
{"matrix": [6, 0], "x": 144, "y": 4, "flags": 1},
{"matrix": [7, 0], "x": 144, "y": 20, "flags": 1},
{"matrix": [8, 0], "x": 144, "y": 36, "flags": 1},
{"matrix": [11, 6], "x": 152, "y": 69, "flags": 1},
{"matrix": [11, 5], "x": 140, "y": 80, "flags": 1},
{"matrix": [11, 4], "x": 128, "y": 91, "flags": 1},
{"matrix": [11, 3], "x": 132, "y": 69, "flags": 1}
],
"led_flush_limit": 26,
"led_process_limit": 5,
"max_brightness": 175,
"sleep": true
},
"processor": "STM32F303",
"bootloader": "custom",
"layout_aliases": {
"LAYOUT_moonlander": "LAYOUT"
},
"tapping": {
"toggle": 1
},
"layouts": {
"LAYOUT_halfmoon": {
"layout": [
{
"label": "k00",
"matrix": [0, 0],
"x": 0,
"y": 0
},
{
"label": "k01",
"matrix": [0, 1],
"x": 1,
"y": 0
},
{
"label": "k02",
"matrix": [0, 2],
"x": 2,
"y": 0
},
{
"label": "k03",
"matrix": [0, 3],
"x": 3,
"y": 0
},
{
"label": "k04",
"matrix": [0, 4],
"x": 4,
"y": 0
},
{
"label": "k05",
"matrix": [0, 5],
"x": 5,
"y": 0
},
{
"label": "k06",
"matrix": [0, 6],
"x": 6,
"y": 0
},
{
"label": "k07",
"matrix": [1, 0],
"x": 7,
"y": 0
},
{
"label": "k08",
"matrix": [1, 1],
"x": 8,
"y": 0
},
{
"label": "k09",
"matrix": [1, 2],
"x": 9,
"y": 0
},
{
"label": "k10",
"matrix": [1, 3],
"x": 10,
"y": 0
},
{
"label": "k11",
"matrix": [1, 4],
"x": 11,
"y": 0
},
{
"label": "k12",
"matrix": [1, 5],
"x": 12,
"y": 0
},
{
"label": "k13",
"matrix": [1, 6],
"x": 13,
"y": 0
},
{
"label": "k14",
"matrix": [2, 0],
"x": 14,
"y": 0
},
{
"label": "k15",
"matrix": [2, 1],
"x": 15,
"y": 0
},
{
"label": "k16",
"matrix": [2, 2],
"x": 16,
"y": 0
},
{
"label": "k17",
"matrix": [2, 3],
"x": 17,
"y": 0
},
{
"label": "k18",
"matrix": [2, 4],
"x": 18,
"y": 0
},
{
"label": "k19",
"matrix": [2, 5],
"x": 19,
"y": 0
},
{
"label": "k20",
"matrix": [2, 6],
"x": 20,
"y": 0
},
{
"label": "k21",
"matrix": [3, 0],
"x": 21,
"y": 0
},
{
"label": "k22",
"matrix": [3, 1],
"x": 22,
"y": 0
},
{
"label": "k23",
"matrix": [3, 2],
"x": 23,
"y": 0
},
{
"label": "k24",
"matrix": [3, 3],
"x": 24,
"y": 0
},
{
"label": "k25",
"matrix": [3, 4],
"x": 25,
"y": 0
},
{
"label": "k26",
"matrix": [3, 5],
"x": 26,
"y": 0
},
{
"label": "k27",
"matrix": [4, 0],
"x": 27,
"y": 0
},
{
"label": "k28",
"matrix": [4, 1],
"x": 28,
"y": 0
},
{
"label": "k29",
"matrix": [4, 2],
"x": 29,
"y": 0
},
{
"label": "k30",
"matrix": [4, 3],
"x": 30,
"y": 0
},
{
"label": "k31",
"matrix": [4, 4],
"x": 31,
"y": 0
},
{
"label": "k32",
"matrix": [5, 3],
"x": 32,
"y": 0
},
{
"label": "k33",
"matrix": [5, 0],
"x": 33,
"y": 0
},
{
"label": "k34",
"matrix": [5, 1],
"x": 34,
"y": 0
},
{
"label": "k35",
"matrix": [5, 2],
"x": 35,
"y": 0
}
]
},
"LAYOUT": {
"layout": [
{
"matrix": [0, 0],
"x": 0,
"y": 0.375
},
{
"matrix": [0, 1],
"x": 1,
"y": 0.375
},
{
"matrix": [0, 2],
"x": 2,
"y": 0.125
},
{
"matrix": [0, 3],
"x": 3,
"y": 0
},
{
"matrix": [0, 4],
"x": 4,
"y": 0.125
},
{
"matrix": [0, 5],
"x": 5,
"y": 0.25
},
{
"matrix": [0, 6],
"x": 6,
"y": 0.25
},
{
"matrix": [6, 0],
"x": 10,
"y": 0.25
},
{
"matrix": [6, 1],
"x": 11,
"y": 0.25
},
{
"matrix": [6, 2],
"x": 12,
"y": 0.125
},
{
"matrix": [6, 3],
"x": 13,
"y": 0
},
{
"matrix": [6, 4],
"x": 14,
"y": 0.125
},
{
"matrix": [6, 5],
"x": 15,
"y": 0.375
},
{
"matrix": [6, 6],
"x": 16,
"y": 0.375
},
{
"matrix": [1, 0],
"x": 0,
"y": 1.375
},
{
"matrix": [1, 1],
"x": 1,
"y": 1.375
},
{
"matrix": [1, 2],
"x": 2,
"y": 1.125
},
{
"matrix": [1, 3],
"x": 3,
"y": 1
},
{
"matrix": [1, 4],
"x": 4,
"y": 1.125
},
{
"matrix": [1, 5],
"x": 5,
"y": 1.25
},
{
"matrix": [1, 6],
"x": 6,
"y": 1.25
},
{
"matrix": [7, 0],
"x": 10,
"y": 1.25
},
{
"matrix": [7, 1],
"x": 11,
"y": 1.25
},
{
"matrix": [7, 2],
"x": 12,
"y": 1.125
},
{
"matrix": [7, 3],
"x": 13,
"y": 1
},
{
"matrix": [7, 4],
"x": 14,
"y": 1.125
},
{
"matrix": [7, 5],
"x": 15,
"y": 1.375
},
{
"matrix": [7, 6],
"x": 16,
"y": 1.375
},
{
"matrix": [2, 0],
"x": 0,
"y": 2.375
},
{
"matrix": [2, 1],
"x": 1,
"y": 2.375
},
{
"matrix": [2, 2],
"x": 2,
"y": 2.125
},
{
"matrix": [2, 3],
"x": 3,
"y": 2
},
{
"matrix": [2, 4],
"x": 4,
"y": 2.125
},
{
"matrix": [2, 5],
"x": 5,
"y": 2.25
},
{
"matrix": [2, 6],
"x": 6,
"y": 2.25
},
{
"matrix": [8, 0],
"x": 10,
"y": 2.25
},
{
"matrix": [8, 1],
"x": 11,
"y": 2.25
},
{
"matrix": [8, 2],
"x": 12,
"y": 2.125
},
{
"matrix": [8, 3],
"x": 13,
"y": 2
},
{
"matrix": [8, 4],
"x": 14,
"y": 2.125
},
{
"matrix": [8, 5],
"x": 15,
"y": 2.375
},
{
"matrix": [8, 6],
"x": 16,
"y": 2.375
},
{
"matrix": [3, 0],
"x": 0,
"y": 3.375
},
{
"matrix": [3, 1],
"x": 1,
"y": 3.375
},
{
"matrix": [3, 2],
"x": 2,
"y": 3.125
},
{
"matrix": [3, 3],
"x": 3,
"y": 3
},
{
"matrix": [3, 4],
"x": 4,
"y": 3.125
},
{
"matrix": [3, 5],
"x": 5,
"y": 3.25
},
{
"matrix": [9, 1],
"x": 11,
"y": 3.25
},
{
"matrix": [9, 2],
"x": 12,
"y": 3.125
},
{
"matrix": [9, 3],
"x": 13,
"y": 3
},
{
"matrix": [9, 4],
"x": 14,
"y": 3.125
},
{
"matrix": [9, 5],
"x": 15,
"y": 3.375
},
{
"matrix": [9, 6],
"x": 16,
"y": 3.375
},
{
"matrix": [4, 0],
"x": 0,
"y": 4.375
},
{
"matrix": [4, 1],
"x": 1,
"y": 4.375
},
{
"matrix": [4, 2],
"x": 2,
"y": 4.125
},
{
"matrix": [4, 3],
"x": 3,
"y": 4
},
{
"matrix": [4, 4],
"x": 4,
"y": 4.125
},
{
"matrix": [5, 3],
"x": 5,
"y": 4.5,
"w": 2
},
{
"matrix": [11, 3],
"x": 10,
"y": 4.5,
"w": 2
},
{
"matrix": [10, 2],
"x": 12,
"y": 4.125
},
{
"matrix": [10, 3],
"x": 13,
"y": 4
},
{
"matrix": [10, 4],
"x": 14,
"y": 4.125
},
{
"matrix": [10, 5],
"x": 15,
"y": 4.375
},
{
"matrix": [10, 6],
"x": 16,
"y": 4.375
},
{
"matrix": [5, 0],
"x": 5,
"y": 5.5,
"h": 1.5
},
{
"matrix": [5, 1],
"x": 6,
"y": 5.5,
"h": 1.5
},
{
"matrix": [5, 2],
"x": 7,
"y": 5.5,
"h": 1.5
},
{
"matrix": [11, 4],
"x": 9,
"y": 5.5,
"h": 1.5
},
{
"matrix": [11, 5],
"x": 10,
"y": 5.5,
"h": 1.5
},
{
"matrix": [11, 6],
"x": 11,
"y": 5.5,
"h": 1.5
}
]
}
}
}

View File

@@ -0,0 +1,85 @@
/*
ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
* STM32F303xB memory setup.
*/
MEMORY
{
flash0 (rx) : org = 0x08002000, len = 128k - 0x2000
flash1 (rx) : org = 0x00000000, len = 0
flash2 (rx) : org = 0x00000000, len = 0
flash3 (rx) : org = 0x00000000, len = 0
flash4 (rx) : org = 0x00000000, len = 0
flash5 (rx) : org = 0x00000000, len = 0
flash6 (rx) : org = 0x00000000, len = 0
flash7 (rx) : org = 0x00000000, len = 0
ram0 (wx) : org = 0x20000000, len = 32k
ram1 (wx) : org = 0x00000000, len = 0
ram2 (wx) : org = 0x00000000, len = 0
ram3 (wx) : org = 0x00000000, len = 0
ram4 (wx) : org = 0x10000000, len = 8k
ram5 (wx) : org = 0x00000000, len = 0
ram6 (wx) : org = 0x00000000, len = 0
ram7 (wx) : org = 0x00000000, len = 0
}
/* For each data/text section two region are defined, a virtual region
and a load region (_LMA suffix).*/
/* Flash region to be used for exception vectors.*/
REGION_ALIAS("VECTORS_FLASH", flash0);
REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
/* Flash region to be used for constructors and destructors.*/
REGION_ALIAS("XTORS_FLASH", flash0);
REGION_ALIAS("XTORS_FLASH_LMA", flash0);
/* Flash region to be used for code text.*/
REGION_ALIAS("TEXT_FLASH", flash0);
REGION_ALIAS("TEXT_FLASH_LMA", flash0);
/* Flash region to be used for read only data.*/
REGION_ALIAS("RODATA_FLASH", flash0);
REGION_ALIAS("RODATA_FLASH_LMA", flash0);
/* Flash region to be used for various.*/
REGION_ALIAS("VARIOUS_FLASH", flash0);
REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);
/* Flash region to be used for RAM(n) initialization data.*/
REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);
/* RAM region to be used for Main stack. This stack accommodates the processing
of all exceptions and interrupts.*/
REGION_ALIAS("MAIN_STACK_RAM", ram0);
/* RAM region to be used for the process stack. This is the stack used by
the main() function.*/
REGION_ALIAS("PROCESS_STACK_RAM", ram0);
/* RAM region to be used for data segment.*/
REGION_ALIAS("DATA_RAM", ram0);
REGION_ALIAS("DATA_RAM_LMA", flash0);
/* RAM region to be used for BSS segment.*/
REGION_ALIAS("BSS_RAM", ram0);
/* RAM region to be used for the default heap.*/
REGION_ALIAS("HEAP_RAM", ram0);
/* Generic rules inclusion.*/
INCLUDE rules.ld

View File

@@ -0,0 +1,10 @@
CUSTOM_MATRIX = lite
VPATH += drivers/gpio
SRC += matrix.c mcp23018.c
I2C_DRIVER_REQUIRED = yes
MCU_LDSCRIPT = moonlander
DFU_ARGS = -d 3297:2003 -a 0 -s 0x08002000:leave
DFU_SUFFIX_ARGS = -v 3297 -p 2003