diff options
Diffstat (limited to 'keyboards/mechmini')
-rw-r--r-- | keyboards/mechmini/mechmini.c | 3 | ||||
-rw-r--r-- | keyboards/mechmini/mechmini.h | 4 | ||||
-rwxr-xr-x | keyboards/mechmini/program | 74 | ||||
-rw-r--r-- | keyboards/mechmini/readme.md | 64 | ||||
-rw-r--r-- | keyboards/mechmini/rules.mk | 7 |
5 files changed, 71 insertions, 81 deletions
diff --git a/keyboards/mechmini/mechmini.c b/keyboards/mechmini/mechmini.c index 72b9d624fb..baa2e03575 100644 --- a/keyboards/mechmini/mechmini.c +++ b/keyboards/mechmini/mechmini.c @@ -1,13 +1,16 @@ /* Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.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/>. */ diff --git a/keyboards/mechmini/mechmini.h b/keyboards/mechmini/mechmini.h index 35c85c839d..2890fad7ad 100644 --- a/keyboards/mechmini/mechmini.h +++ b/keyboards/mechmini/mechmini.h @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef KEYMAP_COMMON_H -#define KEYMAP_COMMON_H +#ifndef MECHMINI_H +#define MECHMINI_H #include "keycode.h" #include "action.h" diff --git a/keyboards/mechmini/program b/keyboards/mechmini/program deleted file mode 100755 index a88d9cd9b0..0000000000 --- a/keyboards/mechmini/program +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python -# Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.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/>. - -from __future__ import print_function - -import os -import sys -import time -import usb - -if len(sys.argv) < 2: - print('Usage: %s <firmware.hex>' % sys.argv[0]) - sys.exit(1) - -print('Searching for ps2avrGB... ', end='') - -dev = usb.core.find(idVendor=0x20A0, idProduct=0x422D) -if dev is None: - raise ValueError('Device not found') - -print('Found', end='\n\n') - -print('Device Information:') -print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor)) -print(' idProduct: %d (0x%04x)' % (dev.idProduct, dev.idProduct)) -print('Manufacturer: %s' % (dev.iManufacturer)) -print('Serial: %s' % (dev.iSerialNumber)) -print('Product: %s' % (dev.iProduct), end='\n\n') - -print('Transferring control to bootloader... ', end='') - -dev.set_configuration() - -request_type = usb.util.build_request_type( - usb.util.CTRL_OUT, - usb.util.CTRL_TYPE_CLASS, - usb.util.CTRL_RECIPIENT_DEVICE) - -USBRQ_HID_SET_REPORT = 0x09 -HID_REPORT_OPTION = 0x0301 - - -try: - dev.ctrl_transfer( - request_type, - USBRQ_HID_SET_REPORT, - HID_REPORT_OPTION, - 0, - [0, 0, 0xFF] + [0] * 5 - ) -except usb.core.USBError: - # for some reason I keep getting USBError, but it works! - pass - -# wait a bit until bootloader starts up -time.sleep(2) - -print('OK') -print('Programming...') -if os.system('bootloadHID -r "%s"' % sys.argv[1]) == 0: - print('\nDone!') diff --git a/keyboards/mechmini/readme.md b/keyboards/mechmini/readme.md new file mode 100644 index 0000000000..b95153051c --- /dev/null +++ b/keyboards/mechmini/readme.md @@ -0,0 +1,64 @@ +mechmini +======== + +A compact ortholinear/staggered keyboard. + +Keyboard Maintainer: QMK Community +Hardware Supported: mechmini PCB +Hardware Availability: https://mechkeys.ca/collections/keyboards/products/mechmini-2-0-pcb + +Make example for this keyboard (after setting up your build environment): + + make mechmini:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. + +## Mechmini Notes + +Note that this is a complete replacement for the firmware, so you won't be +using Bootmapper Client to change any keyboard settings, since not all the +USB report options are supported. + +## Installing + +First, install the requirements. These commands are for OSX, but all you +need is the AVR toolchain and `bootloadHID` for flashing: + +``` +$ brew cask install crosspack-avr +$ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb +``` + +In order to use the `./program` script, which can reboot the board into +the bootloader, you'll need Python 2 with PyUSB installed: + +``` +$ pip install pyusb +``` + +Then, with the keyboard plugged in, simply run this command from the +`qmk_firmware` directory: + +``` +$ make mechmini:program +``` + +If you prefer, you can just build it and flash the firmware directly with +`bootloadHID` if you boot the board while holding down `L_Ctrl` to keep it +in the bootloader: + +``` +$ make mechmini +$ bootloadHID -r mechmini_default.hex +``` + +## Troubleshooting + +From my experience, it's really hard to brick these boards. But these +tricks have been useful when it got stuck in a weird scenario. + +1. Try plugging the board in while pressing `L_Ctrl`. This will force it + to boot only the bootloader without loading the firmware. Once this is + done, just reflash the board with the original firmware. +2. Sometimes USB hubs can act weird, so try connecting the board directly + to your computer or plugging/unplugging the USB hub. diff --git a/keyboards/mechmini/rules.mk b/keyboards/mechmini/rules.mk index 626af1d131..d089858273 100644 --- a/keyboards/mechmini/rules.mk +++ b/keyboards/mechmini/rules.mk @@ -20,9 +20,6 @@ PROTOCOL = VUSB # unsupported features for now NO_UART = yes NO_SUSPEND_POWER_DOWN = yes -BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = yes -DISABLE_WS2812 = yes # processor frequency F_CPU = 12000000 @@ -33,7 +30,7 @@ MOUSEKEY_ENABLE = yes EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes COMMAND_ENABLE = yes - +BACKLIGHT_ENABLE = no RGBLIGHT_ENABLE = yes RGBLIGHT_CUSTOM_DRIVER = yes @@ -45,4 +42,4 @@ CUSTOM_MATRIX = yes SRC = matrix.c i2c.c # programming options -PROGRAM_CMD = ./keyboards/mechmini/program $(TARGET).hex +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex
\ No newline at end of file |