diff options
90 files changed, 7996 insertions, 3257 deletions
diff --git a/1-setup-path-win.bat b/1-setup-path-win.bat index 49fb00e149..2c15857bb7 100644 --- a/1-setup-path-win.bat +++ b/1-setup-path-win.bat @@ -1,9 +1,71 @@ -@echo off -setx /M path "%PATH%;C:\MinGW\bin;C:\MinGW\msys\1.0\bin" > nul 2>&1 -if NOT ["%errorlevel%"]==["0"] ( - echo FAILED. Rerun with administrator privileges. - pause -) else ( - echo Success! - pause -) +@SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION +@ECHO OFF +SET CMDLINERUNSTR=%SystemRoot%\system32\cmd.exe + +SET NEWPATH1="C:\MinGW\msys\1.0\bin" +SET NEWPATH2="C:\MinGW\bin" + +:: Make sure paths exist +IF NOT EXIST !NEWPATH1! (ECHO Path not found: %NEWPATH1% && GOTO ExitBatch) +IF NOT EXIST !NEWPATH2! (ECHO Path not found: %NEWPATH2% && GOTO ExitBatch) + +:: Add paths +CALL :AddPath %NEWPATH1% +CALL :AddPath %NEWPATH2% + +:: Branch to UpdateEnv if we need to update +IF DEFINED UPDATE (GOTO UpdateEnv) + +GOTO ExitBatch + +:: ----------------------------------------------------------------------------- + +:UpdateEnv +ECHO Making updated PATH go live . . . +REG delete HKCU\Environment /F /V TEMPVAR > nul 2>&1 +setx TEMPVAR 1 > nul 2>&1 +REG delete HKCU\Environment /F /V TEMPVAR > nul 2>&1 +IF NOT !cmdcmdline! == !CMDLINERUNSTR! (CALL :KillExplorer) +GOTO ExitBatch + +:: ----------------------------------------------------------------------------- + +:ExitBatch +ENDLOCAL +PAUSE +EXIT /b + +:: ----------------------------------------------------------------------------- + +:AddPath <pathToAdd> +ECHO %PATH% | FINDSTR /C:"%~1" > nul +IF ERRORLEVEL 1 ( + REG add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /f /v PATH /t REG_SZ /d "%PATH%;%~1" > nul 2>&1 + IF ERRORLEVEL 0 ( + ECHO Adding %1 . . . Success! + SET "PATH=%PATH%;%~1" + SET UPDATE=1 + ) ELSE ( + ECHO Adding %1 . . . FAILED. Run this script with administrator privileges. + ) +) ELSE ( + ECHO Skipping %1 - Already in PATH + ) +EXIT /b + +:: ----------------------------------------------------------------------------- + +:KillExplorer + +ECHO Your desktop is being restarted, please wait. . . +ping -n 5 127.0.0.1 > NUL 2>&1 +ECHO Killing process Explorer.exe. . . +taskkill /f /im explorer.exe +ECHO. +ECHO Your desktop is now loading. . . +ping -n 5 127.0.0.1 > NUL 2>&1 +ECHO. +ping -n 5 127.0.0.1 > NUL 2>&1 +START explorer.exe +START explorer.exe %CD% +EXIT /b
\ No newline at end of file diff --git a/BUILD_GUIDE.md b/BUILD_GUIDE.md index e8b242e4e3..f7a57d2fc9 100644 --- a/BUILD_GUIDE.md +++ b/BUILD_GUIDE.md @@ -3,11 +3,13 @@ ## Build Environment Setup ### Windows -1. Install [MHV AVR Tools](https://infernoembedded.com/sites/default/files/project/MHV_AVR_Tools_20131101.exe). Disable smatch, but **be sure to leave the option to add the tools to the PATH checked**. -2. Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The scripts depend on the default location. -3. Clone this repository. [This link will download it as a zip file, which you'll need to extract.](https://github.com/jackhumbert/qmk_firmware/archive/master.zip) Open the extracted folder in Windows Explorer. -4. Right-click on the 1-setup-path-win batch script, select "Run as administrator", and accept the User Account Control prompt. Press the spacebar to dismiss the success message in the command prompt that pops up. -5. Right-click on the 2-setup-environment-win batch script, select "Run as administrator", and accept the User Account Control prompt. This part may take a couple of minutes, and you'll need to approve a driver installation, but once it finishes, your environment is complete! +1. If you have ever installed WinAVR, uninstall it. +2. Install [MHV AVR Tools](https://infernoembedded.com/sites/default/files/project/MHV_AVR_Tools_20131101.exe). Disable smatch, but **be sure to leave the option to add the tools to the PATH checked**. +3. Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The scripts depend on the default location. +4. Clone this repository. [This link will download it as a zip file, which you'll need to extract.](https://github.com/jackhumbert/qmk_firmware/archive/master.zip) Open the extracted folder in Windows Explorer. +5. Right-click on the 1-setup-path-win batch script, select "Run as administrator", and accept the User Account Control prompt. Press the spacebar to dismiss the success message in the command prompt that pops up. +6. Right-click on the 2-setup-environment-win batch script, select "Run as administrator", and accept the User Account Control prompt. This part may take a couple of minutes, and you'll need to approve a driver installation, but once it finishes, your environment is complete! +7. Future build commands should be run from the standard Windows command prompt, which you can find by searching for "command prompt" from the start menu or start screen. Ignore the "MHV AVR Shell". ### Mac If you're using [homebrew,](http://brew.sh/) you can use the following commands: @@ -42,7 +44,10 @@ If you have any problems building the firmware, you can try using a tool called 4. Once you're in the correct keyboard-specific folder, run the `make` command. This should output a lot of information about the build process. ## Customizing, Building, and Deploying Your Firmware -1. Running the `make` command from your keyboard's folder will generate a .hex file based on the default keymap. All keymaps for a particular keyboard live in the `keymaps` folder in that keyboard's folder. To create your own keymap, copy `keymaps/default/keymap.c` to the `keymaps` folder, and rename it with your name, for example jack.c. Or, if you don't care about the ability to share your keymap with the community via GitHub, you can just modify the default keymap itself. Details on how to program keymap files can be found in other guides. + +Note: Some keyboard folders have non-standard organizations, and may not even support specifying alternate keymaps. Until these get reorganized, you will need to edit their default keymaps directly. + +1. Running the `make` command from your keyboard's folder will generate a .hex file based on the default keymap. All keymaps for a particular keyboard live in the `keymaps` folder in that keyboard's folder. To create your own keymap, copy `keymaps/default/keymap.c` to the `keymaps` folder, and rename it with your name, for example jack.c. Or, if you don't care about the ability to share your keymap with the community via GitHub, you can just modify the default keymap itself. Details on how to program keymap files can be found in other guides. 2. To build a keymap other than the default, type `KEYMAP=<name>` after `make`. So if I've named my keymap jack.c, the full command would be `make KEYMAP=jack`. 3. How you deploy the firmware will depend on whether you are using a PCB or a Teensy. In both cases, you'll need to put the keyboard in bootloader mode, either by pressing a button on the PCB/Teensy or pressing the key with the `RESET` keycode. Then, if you're using a PCB, just run `make KEYMAP=<name> dfu` to both build and deploy the firmware. If you're using a Teensy, you'll probably need to take the <keyboardname>.hex file that make produces in the keyboard's folder, and deploy it using the [Teensy Loader.](https://www.pjrc.com/teensy/loader.html) @@ -269,7 +269,7 @@ For this mod, you need an unused pin wiring to DI of WS2812 strip. After wiring RGBLIGHT_ENABLE = yes -Please note that the underglow is not compatible with MIDI functions. So you cannot enable both of them at the same time. +Please note that the underglow is not compatible with audio output. So you cannot enable both of them at the same time. Please add the following options into your config.h, and set them up according your hardware configuration. @@ -309,4 +309,4 @@ what things are (and likely aren't) too risky. - EEPROM has around a 100000 write cycle. You shouldn't rewrite the firmware repeatedly and continually; that'll burn the EEPROM eventually. -
\ No newline at end of file + diff --git a/keyboard/alps64/Makefile b/keyboard/alps64/Makefile index e90dcedb67..7634c4280e 100644 --- a/keyboard/alps64/Makefile +++ b/keyboard/alps64/Makefile @@ -53,9 +53,9 @@ SRC = keymap_common.c \ led.c ifdef KEYMAP - SRC := keymap_$(KEYMAP).c $(SRC) + SRC := keymaps/$(KEYMAP).c $(SRC) else - SRC := keymap_plain.c $(SRC) + SRC := keymaps/default.c $(SRC) endif CONFIG_H = config.h diff --git a/keyboard/alps64/keymap_plain.c b/keyboard/alps64/keymaps/default.c index a54899196a..a54899196a 100644 --- a/keyboard/alps64/keymap_plain.c +++ b/keyboard/alps64/keymaps/default.c diff --git a/keyboard/alps64/keymap_hasu.c b/keyboard/alps64/keymaps/hasu.c index d297d72fea..d297d72fea 100644 --- a/keyboard/alps64/keymap_hasu.c +++ b/keyboard/alps64/keymaps/hasu.c diff --git a/keyboard/atomic/Makefile b/keyboard/atomic/Makefile index e678b4efa8..da6d0ac60c 100644 --- a/keyboard/atomic/Makefile +++ b/keyboard/atomic/Makefile @@ -54,9 +54,9 @@ SRC = atomic.c \ backlight.c ifdef KEYMAP - SRC := keymaps/keymap_$(KEYMAP).c $(SRC) + SRC := keymaps/$(KEYMAP).c $(SRC) else - SRC := keymaps/keymap_default.c $(SRC) + SRC := keymaps/default.c $(SRC) endif CONFIG_H = config.h diff --git a/keyboard/atomic/README.md b/keyboard/atomic/README.md index c8e83cf55a..0e42370ba6 100644 --- a/keyboard/atomic/README.md +++ b/keyboard/atomic/README.md @@ -16,10 +16,10 @@ Depending on which keymap you would like to use, you will have to compile slight To build with the default keymap, simply run `make`. ### Other Keymaps -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `keymap_<name>.c` and see keymap document (you can find in top README.md) and existent keymap files. +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a file in the keymaps folder named `<name>.c` and see keymap document (you can find in top README.md) and existent keymap files. To build the firmware binary hex file with a keymap just do `make` |