mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-02-27 01:56:43 +00:00
16 lines
7.7 KiB
JavaScript
16 lines
7.7 KiB
JavaScript
|
import { _ as _export_sfc, c as createElementBlock, o as openBlock, a8 as createStaticVNode } from "./chunks/framework.DyMmIvSC.js";
|
|||
|
const __pageData = JSON.parse('{"title":"Building Your First Firmware","description":"","frontmatter":{},"headers":[],"relativePath":"newbs_building_firmware.md","filePath":"newbs_building_firmware.md"}');
|
|||
|
const _sfc_main = { name: "newbs_building_firmware.md" };
|
|||
|
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="building-your-first-firmware" tabindex="-1">Building Your First Firmware <a class="header-anchor" href="#building-your-first-firmware" aria-label="Permalink to "Building Your First Firmware""></a></h1><p>Now that you have set up your build environment you are ready to start building custom firmware. For this section of the guide we will bounce between 3 programs- your file manager, your text editor, and your terminal window. Keep all 3 open until you are done and happy with your keyboard firmware.</p><h2 id="configure-your-build-environment-defaults-optional" tabindex="-1">Configure Your Build Environment Defaults (Optional) <a class="header-anchor" href="#configure-your-build-environment-defaults-optional" aria-label="Permalink to "Configure Your Build Environment Defaults (Optional)""></a></h2><p>You can configure your build environment to set the defaults and make working with QMK less tedious. Let's do that now!</p><p>Most people new to QMK only have 1 keyboard. You can set this keyboard as your default with the <code>qmk config</code> command. For example, to set your default keyboard to <code>clueboard/66/rev4</code>:</p><pre><code>qmk config user.keyboard=clueboard/66/rev4\n</code></pre><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>The keyboard option is the path relative to the keyboard directory, the above example would be found in <code>qmk_firmware/keyboards/clueboard/66/rev4</code>. If you're unsure you can view a full list of supported keyboards with <code>qmk list-keyboards</code>.</p></div><p>You can also set your default keymap name. Most people use their GitHub username like the keymap name from the previous steps:</p><pre><code>qmk config user.keymap=<github_username>\n</code></pre><h2 id="create-a-new-keymap" tabindex="-1">Create a New Keymap <a class="header-anchor" href="#create-a-new-keymap" aria-label="Permalink to "Create a New Keymap""></a></h2><p>To create your own keymap you'll want to create a copy of the <code>default</code> keymap. If you configured your build environment in the last step you can do that easily with the QMK CLI:</p><pre><code>qmk new-keymap\n</code></pre><p>If you did not configure your environment, or you have multiple keyboards, you can specify a keyboard name:</p><pre><code>qmk new-keymap -kb <keyboard_name>\n</code></pre><p>Look at the output from that command, you should see something like this:</p><pre><code>Ψ Created a new keymap called <github_username> in: /home/me/qmk_firmware/keyboards/clueboard/66/rev3/keymaps/<github_username>.\n</code></pre><p>This is the location of your new <code>keymap.c</code> file.</p><h2 id="open-keymap-c-in-your-favorite-text-editor" tabindex="-1">Open <code>keymap.c</code> In Your Favorite Text Editor <a class="header-anchor" href="#open-keymap-c-in-your-favorite-text-editor" aria-label="Permalink to "Open `keymap.c` In Your Favorite Text Editor""></a></h2><p>Open your <code>keymap.c</code> file in your text editor. Inside this file you'll find the structure that controls how your keyboard behaves. At the top of <code>keymap.c</code> there may be some defines and enums that make the keymap easier to read. Farther down you'll find a line that looks like this:</p><pre><code>const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\n</code></pre><p>This line indicates where the list of Layers begins. Below that you'll find lines containing <code>LAYOUT</code>, and these lines indicate the start of a layer. Below that line is the list of keys that comprise a particular layer.</p><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>When editing your keymap file be careful not to add or remove any commas. If you do, you will prevent your firmware from compiling and it may not be easy to figure out where the extra, or missing, comma is.</p></div><h2 id="customize-the-layout-to-your-liking" tabindex="-1">Customize The Layout To Yo
|
|||
|
const _hoisted_36 = [
|
|||
|
_hoisted_1
|
|||
|
];
|
|||
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|||
|
return openBlock(), createElementBlock("div", null, _hoisted_36);
|
|||
|
}
|
|||
|
const newbs_building_firmware = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|||
|
export {
|
|||
|
__pageData,
|
|||
|
newbs_building_firmware as default
|
|||
|
};
|