From 452866319bc30ef1bb018c4aa70df519ab78b9bf Mon Sep 17 00:00:00 2001 From: tmk Date: Thu, 10 Jul 2014 15:28:36 +0900 Subject: [PATCH] Fix READEM of hhkb and doc/build.md --- doc/build.md | 24 +++++++++++++++--------- keyboard/hhkb/README.md | 29 +++++++---------------------- keyboard/hhkb/hhkb_avr.h | 11 ++++++----- 3 files changed, 28 insertions(+), 36 deletions(-) diff --git a/doc/build.md b/doc/build.md index bfe5de9fd..20702e94c 100644 --- a/doc/build.md +++ b/doc/build.md @@ -5,23 +5,22 @@ Build Firmware and Program Controller Download and Install -------------------- ### 1. Install Tools -First, you need tools to build firmware and program your controller. I assume you are on Windows here. -1. **Toolchain** Install [WinAVR][winavr]. This is old but works well for this purpose. `WinAVR` is a tool set to build firmware including C compiler(gcc) and make commands. You can use [CrossPack][crosspack] instead if you are on Mac. +1. **Toolchain** On Windows install [MHV AVR Tools][mhv] for AVR GCC compiler and [Cygwin][cygwin](or [MinGW][mingw]) for shell terminal. On Mac you can use [CrossPack][crosspack]. On Linux you can install AVR GCC with your favorite package manager. -2. **Programmer** Install [Atmel FLIP][flip]. `FLIP` is a tool to program(load) firmware into AVR controller via DFU bootloader. AVR USB chips including ATmega32U4 has DFU bootloader by factory default. You can also use [dfu-programmer][dfu-prog] instead if you are on Mac or Linux. +2. **Programmer** On Windows install [Atmel FLIP][flip]. On Mac and Linux install [dfu-programmer][dfu-prog]. -3. **Driver** At first time you start DFU bootloader on Chip 'Found New Hardware Wizard' will come up on Windows. If you install device driver properly you can find chip name like 'ATmega32U4' under 'LibUSB-Win32 Devices' tree on 'Device Manager'. If not you shall need to update its driver on 'Device Manager'. You will find the driver in `FLIP` install directory like: C:\Program Files (x86)\Atmel\Flip 3.4.5\usb\. If you use `dfu-programmer` install its driver. +3. **Driver** On Windows you start DFU bootloader on the chip first time you will see 'Found New Hardware Wizard' to install driver. If you install device driver properly you can find chip name like 'ATmega32U4' under 'LibUSB-Win32 Devices' tree on 'Device Manager'. If not you shall need to update its driver on 'Device Manager'. You will find the driver in `FLIP` install directory like: C:\Program Files (x86)\Atmel\Flip 3.4.5\usb\. In case of `dfu-programmer` use its driver. If you use PJRC Teensy you don't need step 2 and 3 above, just get [Teensy loader][teensy-loader]. ### 2. Download source -You can find firmware source at github: +You can find firmware source at github: - -If you are familiar with `Git` tools you are recommended to use it but you can also download zip archive from: +If you are familiar with `Git` tools you are recommended to use it but you can also download zip archive from: - @@ -29,7 +28,7 @@ If you are familiar with `Git` tools you are recommended to use it but you can a Build firmware -------------- ### 1. Open terminal -Open terminal window to get access to commands. You can use `cmd` in Windows or `Terminal.app` on Mac OSX. In Windows press `Windows` key and `R` then enter `cmd` in 'Run command' dialog showing up. +Open terminal window to get access to commands. Use Cygwin(or MingGW) `shell terminal` in Windows or `Terminal.app` on Mac OSX. In Windows press `Windows` key and `R` then enter `cmd` in 'Run command' dialog showing up. ### 2. Change directory Move to project directory in the firmware source. @@ -100,6 +99,9 @@ You may want to use other programmer like `avrdude` with AVRISPmkII, Arduino or $ make -f Makefile. program +[cygwin]: https://www.cygwin.com/ +[mingw]: http://www.mingw.org/ +[mhv]: https://infernoembedded.com/products/avr-tools [winavr]: http://winavr.sourceforge.net/ [crosspack]: http://www.obdev.at/products/crosspack/index.html [flip]: http://www.atmel.com/tools/FLIP.aspx @@ -116,14 +118,18 @@ Makefile Options #MCU = at90usb1286 # Teensy++ 2.0 F_CPU = 16000000 +Set your MCU and its clock in Hz. + # Boot Section Size in *bytes* # Teensy halfKay 512 # Atmel DFU loader 4096 # LUFA bootloader 4096 OPT_DEFS += -DBOOTLOADER_SIZE=4096 +If you are using PJRC Teensy use `512` for `BOOTLOADER_SIZE`, otherwise use `4096` unless you are sure. + ### 2. Features -Optional. Note that ***comment out*** to disable them. +Optional. Note that ***comment out*** with `#` to disable them. BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = yes # Mouse keys(+4700) @@ -152,7 +158,7 @@ Config.h Options ---------------- ### 1. Magic command key combination - #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_RSHIFT))) + #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_RSHIFT))) ### 2. Mechanical Locking Support for CapsLock diff --git a/keyboard/hhkb/README.md b/keyboard/hhkb/README.md index 7ea9843a6..d4a2cd022 100644 --- a/keyboard/hhkb/README.md +++ b/keyboard/hhkb/README.md @@ -2,7 +2,7 @@ Alternative Controller for HHKB Pro =================================== I wanted to add some features like vi cursor and mouse keys to my [HHKB][HHKB] but its controller is not programmable and firmware source code is not open, of course. This means customizing this keyboard needs to replace original controller with programmable one. -This controller can work with HHKB **Professional**, **Professional** 2 and **Type-S**. +This controller can work with HHKB **Professional**, **Professional** 2, **JP** and **Type-S**. See [this thread][AltController] in geekhack.org. @@ -43,7 +43,7 @@ See [doc/HHKB.txt](doc/HHKB.txt) and files under [doc/](doc/) for internal of HH See [this document](../../doc/build.md) first. ### Configuration -Set `MCU`, `BOOTLOADER_SIZE` and other build options in `Makefile` and `config.h`. +Set `MCU`, `BOOTLOADER_SIZE` and other build options in `Makefile` and `config.h`. If your target is **HHKB JP** you need to set `HHKB_JP` build option in `Makefile`. ### Build Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. Just `make` with `KEYMAP` option like: @@ -66,37 +66,22 @@ Use [Teensy Loader] if your controller is Teensy/Teensy++. ##Keymap -To define your own keymap create file named `keymap_.c` and see keymap document(you can find in top README.md) and existent keymap files. +To define your own keymap create file named `keymap_.c` and see [keymap document](../../doc/keymap.md) and existent keymap files. ##Hardware You have some options for hardware. Development boards with USB AVR family(ATMega32U4, AT90USB1286) like Teensy will work while MegaAVR with [V-USB] library is also cheaper option for DIY. ###1. TMK Alt Controller Board -TMK designed [Keyboard Controller Board for HHKB Pro2(KiCad project)](https://github.com/tmk/HHKB_controller). -See [this post](http://geekhack.org/index.php?topic=12047.msg948923#msg948923). +Design files are available at [Keyboard Controller Board for HHKB(KiCad project)](https://github.com/tmk/HHKB_controller) and see [Controller Distribution thread](http://geekhack.org/index.php?topic=56494.0) if you get an assembled one. -###2. PJRC Teensy++ 2.0 version - +---------------+ - | Teensy++ | - | | - | | HHKB pro HHKB pro2 - | | ~~~~~~~~ ~~~~~~~~~ - | PB0-2|------->ROW (6-8) (5-7) - | PB3-5|------->COL (9-11) (8-10) - | PB6|------->ENABLE (12) (11) - | PE6|<-------KEY (4) (3) - | PE7|------->PREV (5) (4) - | | - | | 5V--- (1-3) (1-2) - | | GND--- (13-14) (12-13) - +---------------+ +###2. PJRC Teensy +See [this thread](http://geekhack.org/index.php?topic=57008.0). -- NOTE: PJRC [Teensy](http://www.pjrc.com/teensy/) ###3. V-USB version -See [V-USB controller for HHKB](doc/V-USB.md) +See [V-USB controller for HHKB](doc/V-USB.md). [LUFA]: http://www.fourwalledcubicle.com/LUFA.php diff --git a/keyboard/hhkb/hhkb_avr.h b/keyboard/hhkb/hhkb_avr.h index 46fb16679..b7bd507b5 100644 --- a/keyboard/hhkb/hhkb_avr.h +++ b/keyboard/hhkb/hhkb_avr.h @@ -71,13 +71,14 @@ static inline void KEY_SELECT(uint8_t ROW, uint8_t COL) #elif defined(__AVR_AT90USB1286__) -/* +/* * For Teensy++(AT90USB1286) * - * row: PB0-2 - * col: PB3-5,6 - * key: PE6(pull-uped) - * prev: PE7 + * HHKB pro HHKB pro2 + * row: PB0-2 (6-8) (5-7) + * col: PB3-5,6 (9-12) (8-11) + * key: PE6(pull-uped) (4) (3) + * prev: PE7 (5) (4) * * TODO: convert into 'staitc inline' function */