Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Maximilian Friedersdorff 2024-07-04 15:20:50 +01:00
commit caad39421c
170 changed files with 38730 additions and 26170 deletions

View file

@ -73,7 +73,7 @@ EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
CONSOLE_ENABLE ?= yes # Console for debug(+400)
COMMAND_ENABLE ?= yes # Commands for debug and configuration
#SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
#NKRO_ENABLE ?= yes # USB Nkey Rollover
NKRO_ENABLE ?= yes # USB Nkey Rollover
#ACTIONMAP_ENABLE ?= yes # Use 16bit action codes in keymap instead of 8bit keycodes

File diff suppressed because it is too large Load diff

View file

@ -1,66 +0,0 @@
#include "keymap_common.h"
#ifdef KEYMAP_SECTION_ENABLE
const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
#else
const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
#endif
/* 0: qwerty
* ,-----------------------------------------------------------.
* |` | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| #|Bsp|
* |-----------------------------------------------------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |
* |-----------------------------------------------------------|
* |Caps | A| S| D| F| G| H| J| K| L| ;| '|Enter |
* |-----------------------------------------------------------|
* |Shft| \| Z| X| C| V| B| N| M| ,| .| /|Shift |Esc|
* |-----------------------------------------------------------'
* |Ctrl|Gui |Alt | Space |App |Alt |Gui |Ctrl |
* `-----------------------------------------------------------'
*/
KEYMAP( \
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NUHS, BSPC, \
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \
CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, \
LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT,ESC, \
LCTL,LGUI,LALT, SPC, APP, RALT,RGUI,RCTL),
};
#ifdef KEYMAP_SECTION_ENABLE
const action_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
#else
const action_t fn_actions[] PROGMEM = {
#endif
[0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_LAYER_MOMENTARY(2),
[2] = ACTION_LAYER_MOMENTARY(3),
[3] = ACTION_LAYER_MOMENTARY(4),
[4] = ACTION_LAYER_MOMENTARY(5),
[5] = ACTION_LAYER_MOMENTARY(6),
[6] = ACTION_LAYER_MOMENTARY(7),
[7] = ACTION_LAYER_TOGGLE(1),
[8] = ACTION_LAYER_TOGGLE(2),
[9] = ACTION_LAYER_TOGGLE(3),
[10] = ACTION_LAYER_TAP_TOGGLE(1),
[11] = ACTION_LAYER_TAP_TOGGLE(2),
[12] = ACTION_LAYER_TAP_TOGGLE(3),
[13] = ACTION_LAYER_TAP_KEY(1, KC_BSLASH),
[14] = ACTION_LAYER_TAP_KEY(2, KC_TAB),
[15] = ACTION_LAYER_TAP_KEY(3, KC_ENTER),
[16] = ACTION_LAYER_TAP_KEY(4, KC_SPACE),
[17] = ACTION_LAYER_TAP_KEY(5, KC_SCOLON),
[18] = ACTION_LAYER_TAP_KEY(6, KC_QUOTE),
[19] = ACTION_LAYER_TAP_KEY(7, KC_SLASH),
[20] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_SPACE),
[21] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_SPACE),
[22] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_QUOTE),
[23] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENTER),
[24] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ESC),
[25] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_BSPACE),
[26] = ACTION_MODS_ONESHOT(MOD_LCTL),
[27] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_ESC),
[28] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_BSPACE),
[29] = ACTION_MODS_ONESHOT(MOD_LSFT),
[30] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_GRAVE),
[31] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_BSLASH),
};

View file

@ -62,7 +62,7 @@ void matrix_init(void)
}
//debug
debug_matrix = true;
debug_matrix = false;
LED_ON();
_delay_ms(500);
LED_OFF();

View file

@ -0,0 +1,82 @@
/*
Copyright 2023 Jun Wako <wakojun@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/>.
*/
#include "unimap_trans.h"
#define AC_L1 ACTION_LAYER_MOMENTARY(1)
#define AC_L2 ACTION_LAYER_MOMENTARY(2)
#define AC_SLS2 ACTION_LAYER_TAP_KEY(2, KC_SLSH)
#define AC_SCL3 ACTION_LAYER_TAP_KEY(3, KC_SCLN)
#define AC_SPC4 ACTION_LAYER_TAP_KEY(4, KC_SPC)
#define AC_BACK ACTION_MODS_KEY(MOD_LALT, KC_LEFT)
#define AC_FRWD ACTION_MODS_KEY(MOD_LALT, KC_RIGHT)
#define AC_ENT_ ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENT)
#ifdef KEYMAP_SECTION_ENABLE
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
#else
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = {
#endif
/* 0:
* ,-----------------------------------------------------------.
* |` | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \ |
* |-----------------------------------------------------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Bspc|
* |-----------------------------------------------------------|
* |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Enter |
* |-----------------------------------------------------------|
* |Shft| \| Z| X| C| V| B| N| M| ,| .| /|Shift |
* |-----------------------------------------------------------'
* |Ctrl|Gui |Alt | Space |Alt |App | L1 |
* `-----------------------------------------------------------'
*/
[0] = UNIMAP_ALPS64( \
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, GRV, BSLS,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSPC,
LCTL,A, S, D, F, G, H, J, K, L, SCL3,QUOT, ENT_,
LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLS2, RSFT,L1,
L2, LGUI,LALT, SPC4, APP, RALT,RGUI,L1),
[1] = UNIMAP_ALPS64( \
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,GRV,
CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP, INS, DEL,
TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT, TRNS,
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PPLS,PMNS,END, PGDN,DOWN,TRNS, TRNS,TRNS,
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS),
[2] = UNIMAP_ALPS64(
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL,
TRNS,HOME,PGDN,UP, PGUP,END, HOME,PGDN,PGUP,END, NO, NO, NO, TRNS,
TRNS,NO, LEFT,DOWN,RGHT,NO, LEFT,DOWN,UP, RGHT,NO, NO, TRNS,
TRNS,TRNS,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, TRNS, TRNS,TRNS,
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS),
[3] = UNIMAP_ALPS64(
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL,
TAB, NO, NO, NO, NO, NO, WH_L,WH_D,MS_U,WH_U,WH_R,BACK,FRWD, TRNS,
TRNS,ACL0,ACL1,ACL2,ACL2,NO, NO, MS_L,MS_D,MS_R,TRNS,NO, TRNS,
TRNS,TRNS,NO, NO, NO, NO, BTN3,BTN2,BTN1,BACK,FRWD,NO, TRNS,TRNS,
TRNS,TRNS,TRNS, BTN1, TRNS,TRNS,TRNS,TRNS),
[4] = UNIMAP_ALPS64(
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL,
TAB, NO, NO, NO, NO, NO, WH_L,WH_D,MS_U,WH_U,WH_R,BTN4,BTN5, TAB,
LCTL,VOLD,VOLU,MUTE,NO, NO, NO, MS_L,MS_D,MS_R,BTN1,NO, ENT,
LSFT,TRNS,NO, NO, NO, NO, BTN3,BTN2,BTN1,BACK,FRWD,NO, TRNS,TRNS,
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS),
};

View file

@ -0,0 +1,47 @@
TARGET ?= eeprom_tool
TMK_DIR ?= ../../tmk_core
TARGET_DIR ?= .
SRC ?= $(TARGET).c
CONFIG_H ?= config.h
# MCU name
MCU ?= atmega32u4
#MCU ?= atmega32u2
# Processor frequency.
F_CPU ?= 16000000
#
# LUFA specific
#
ARCH ?= AVR8
F_USB ?= $(F_CPU)
# Interrupt driven control endpoint task
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
#
# Build Options
#
MOUSEKEY_ENABLE ?= no # Mouse keys
EXTRAKEY_ENABLE ?= no # Media control and System control
CONSOLE_ENABLE ?= yes # Console for debug
COMMAND_ENABLE ?= no # Commands for debug and configuration
NKRO_ENABLE ?= no # USB Nkey Rollover
NO_KEYBOARD ?= yes # No keyboard interface
NO_DEBUG ?= yes
# Boot Section Size in bytes
OPT_DEFS += -DBOOTLOADER_SIZE=4096
#OPT_DEFS += -DNO_DEBUG
# Search Path
VPATH += $(TARGET_DIR)
VPATH += $(TMK_DIR)
include $(TMK_DIR)/protocol/lufa.mk
include $(TMK_DIR)/common.mk
include $(TMK_DIR)/rules.mk

View file

@ -0,0 +1,6 @@
NAME = eeprom_show
MCU = atmega32u2
TARGET = $(NAME)_$(MCU)
SRC = $(NAME).c
include Makefile

View file

@ -0,0 +1,6 @@
NAME = eeprom_show
MCU = atmega32u4
TARGET = $(NAME)_$(MCU)
SRC = $(NAME).c
include Makefile

View file

@ -0,0 +1,6 @@
NAME = eeprom_wipe
MCU = atmega32u2
TARGET = $(NAME)_$(MCU)
SRC = $(NAME).c
include Makefile

View file

@ -0,0 +1,6 @@
NAME = eeprom_wipe
MCU = atmega32u4
TARGET = $(NAME)_$(MCU)
SRC = $(NAME).c
include Makefile

View file

@ -0,0 +1,18 @@
EEPROM tool
===========
This can show and erase EEPROM content and would be useful when you have a trouble with EEPROM.
Prebuilt firmware
-----------------
`eeprom_show` just shows content of EEPROM and `eeprom_wipe` overwrites all bytes of EEPROM with 0xFF.
You can see the contents using `hid_listen`.
#### For ATmega32u2:
- eeprom_show_32u2.hex
- eeprom_wipe_32u2.hex
#### For ATmega32u4:
- eeprom_show_32u4.hex
- eeprom_wipe_32u4.hex

View file

@ -0,0 +1,50 @@
/*
Copyright 2012 Jun Wako <wakojun@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/>.
*/
#ifndef CONFIG_H
#define CONFIG_H
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0xEEEE
#define DEVICE_VER 0x0001
#define MANUFACTURER TMK
#define PRODUCT EEPROM Tool
#define DESCRIPTION Product from TMK keyboard firmware project
/* matrix size */
#define MATRIX_ROWS 0
#define MATRIX_COLS 0
/* key combination for command */
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
// Disable power saving in USB suspend loop but remote wakeup is still valid.
// This allows keep USB::Task() going during suspend without power down time delay.
//#define NO_SUSPEND_POWER_DOWN
// Disable USB startup wait, which can delays starting UHS2 Task() for 350-600ms.
//#define NO_USB_STARTUP_WAIT_LOOP
// Disable USB suspend loop, which blocks UHS2 Task() while power saving.
// Note that this also disables power saving and remote wakeup from keyboard completely.
//#define NO_USB_SUSPEND_LOOP
#endif

View file

@ -0,0 +1,28 @@
#include "hook.h"
#include "print.h"
#include "timer.h"
#include <avr/eeprom.h>
static void eeprom_show(void)
{
xprintf("eeprom:");
for (int i = 0; i < E2END + 1; i++) {
if ((i % 16) == 0) { xprintf("\n%04X: ", i); }
xprintf("%02X ", eeprom_read_byte((uint8_t *)i));
}
xprintf("\n");
}
void hook_late_init(void)
{
eeprom_show();
}
void hook_main_loop(void)
{
static uint16_t last_time = 0;
uint16_t t = timer_read();
if (t != last_time && (t % 1000) == 0) xprintf(".");
last_time = t;
}

View file

@ -0,0 +1,42 @@
#include "hook.h"
#include "print.h"
#include "timer.h"
#include <avr/eeprom.h>
static void eeprom_show(void)
{
xprintf("eeprom:");
for (int i = 0; i < E2END + 1; i++) {
if ((i % 16) == 0) { xprintf("\n%04X: ", i); }
xprintf("%02X ", eeprom_read_byte((uint8_t *)i));
}
xprintf("\n");
}
static void eeprom_wipe(void)
{
xprintf("eeprom wipe: ");
for (int i = 0; i < E2END + 1; i++) {
if ((i % 16) == 0) { xprintf("%04X: ", i); }
eeprom_write_byte((uint8_t *)i, 0xFF);
}
xprintf("\n");
}
void hook_late_init(void)
{
//eeprom_show();
//xprintf("\n");
//eeprom_wipe();
//xprintf("\n");
eeprom_show();
}
void hook_main_loop(void)
{
static uint16_t last_time = 0;
uint16_t t = timer_read();
if (t != last_time && (t % 1000) == 0) xprintf(".");
last_time = t;
}

View file

@ -0,0 +1,41 @@
#include "hook.h"
#include "print.h"
#include "timer.h"
#include <avr/eeprom.h>
static void eeprom_show(void)
{
xprintf("eeprom:");
for (int i = 0; i < E2END + 1; i++) {
if ((i % 16) == 0) { xprintf("\n%04X: ", i); }
xprintf("%02X ", eeprom_read_byte((uint8_t *)i));
}
xprintf("\n");
}
static void eeprom_wipe(void)
{
xprintf("eeprom wipe: ");
for (int i = 0; i < E2END + 1; i++) {
if ((i % 16) == 0) { xprintf("%04X: ", i); }
eeprom_write_byte((uint8_t *)i, 0xFF);
}
xprintf("\n");
}
void hook_late_init(void)
{
eeprom_show();
xprintf("\n");
eeprom_wipe();
xprintf("\n");
eeprom_show();
}
void hook_main_loop(void)
{
static uint16_t last_time = 0;
uint16_t t = timer_read();
if (t != last_time && (t % 1000) == 0) xprintf(".");
last_time = t;
}

View file

@ -113,7 +113,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# comment out to disable the options.
#
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)

View file

@ -48,8 +48,7 @@ TMK_DIR = ../../tmk_core
TARGET_DIR = .
# project specific files
SRC = keymap_common.c \
matrix.c \
SRC = matrix.c \
led.c
ifdef KEYMAP

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -9,6 +9,10 @@ Controller PCB
(HHKB_controller.jpg)
6MHz crystal Kyocera(KSS) CX1255CA
https://ele.kyocera.com/sites/default/files/assets/static/discontinued/cx1255ca_2013_e.pdf
Keyswitch PCB
-------------
HC4051 Analog Multiplexer: select a row line.

View file

@ -62,7 +62,7 @@ const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = {
[1] = UNIMAP_HHKB(
PWR, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL,
CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP, TRNS, TRNS,
TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT, PENT,
TRNS,VOLD,VOLU,MUTE,EJCT,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT, PENT,
TRNS, BRTD,BRTI,SLEP,WAKE,TRNS,PPLS,PMNS,END, PGDN,DOWN, TRNS,TRNS,
TRNS,TRNS, TRNS, TRNS,TRNS),

View file

@ -35,7 +35,7 @@ const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = {
[1] = UNIMAP_HHKB(
PWR, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL,
CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP, TRNS, TRNS,
TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT, PENT,
TRNS,VOLD,VOLU,MUTE,EJCT,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT, PENT,
TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,PPLS,PMNS,END, PGDN,DOWN, TRNS,TRNS,
TRNS,TRNS, TRNS, TRNS,TRNS),
};

47
keyboard/minimum/Makefile Normal file
View file

@ -0,0 +1,47 @@
TARGET ?= minimum
TMK_DIR ?= ../../tmk_core
TARGET_DIR ?= .
SRC ?= $(TARGET).c
CONFIG_H ?= config.h
# MCU name
MCU ?= atmega32u4
#MCU ?= atmega32u2
# Processor frequency.
F_CPU ?= 16000000
#
# LUFA specific
#
ARCH ?= AVR8
F_USB ?= $(F_CPU)
# Interrupt driven control endpoint task
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
#
# Build Options
#
MOUSEKEY_ENABLE ?= no # Mouse keys
EXTRAKEY_ENABLE ?= no # Media control and System control
CONSOLE_ENABLE ?= no # Console for debug
COMMAND_ENABLE ?= no # Commands for debug and configuration
NKRO_ENABLE ?= no # USB Nkey Rollover
NO_KEYBOARD ?= yes # No keyboard interface
NO_DEBUG ?= yes
# Boot Section Size in bytes
OPT_DEFS += -DBOOTLOADER_SIZE=4096
#OPT_DEFS += -DNO_DEBUG
# Search Path
VPATH += $(TARGET_DIR)
VPATH += $(TMK_DIR)
#include $(TMK_DIR)/protocol/lufa.mk
#include $(TMK_DIR)/common.mk
include $(TMK_DIR)/rules.mk

View file

@ -0,0 +1,3 @@
minimum
=======
This is a template of minimum project for starting point.

50
keyboard/minimum/config.h Normal file
View file

@ -0,0 +1,50 @@
/*
Copyright 2012 Jun Wako <wakojun@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/>.
*/
#ifndef CONFIG_H
#define CONFIG_H
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0xEEEE
#define DEVICE_VER 0x0000
#define MANUFACTURER TMK
#define PRODUCT minimum
#define DESCRIPTION Product from TMK keyboard firmware project
/* matrix size */
#define MATRIX_ROWS 0
#define MATRIX_COLS 0
/* key combination for command */
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
// Disable power saving in USB suspend loop but remote wakeup is still valid.
// This allows keep USB::Task() going during suspend without power down time delay.
//#define NO_SUSPEND_POWER_DOWN
// Disable USB startup wait, which can delays starting UHS2 Task() for 350-600ms.
//#define NO_USB_STARTUP_WAIT_LOOP
// Disable USB suspend loop, which blocks UHS2 Task() while power saving.
// Note that this also disables power saving and remote wakeup from keyboard completely.
//#define NO_USB_SUSPEND_LOOP
#endif

View file

@ -0,0 +1,3 @@
int main(void)
{
}

View file

@ -0,0 +1,47 @@
TARGET ?= nokeyboard
TMK_DIR ?= ../../tmk_core
TARGET_DIR ?= .
SRC ?= $(TARGET).c
CONFIG_H ?= config.h
# MCU name
MCU ?= atmega32u4
#MCU ?= atmega32u2
# Processor frequency.
F_CPU ?= 16000000
#
# LUFA specific
#
ARCH ?= AVR8
F_USB ?= $(F_CPU)
# Interrupt driven control endpoint task
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
#
# Build Options
#
MOUSEKEY_ENABLE ?= no # Mouse keys
EXTRAKEY_ENABLE ?= no # Media control and System control
CONSOLE_ENABLE ?= yes # Console for debug
COMMAND_ENABLE ?= no # Commands for debug and configuration
NKRO_ENABLE ?= no # USB Nkey Rollover
NO_KEYBOARD ?= yes # No keyboard interface
NO_DEBUG ?= yes
# Boot Section Size in bytes
OPT_DEFS += -DBOOTLOADER_SIZE=4096
#OPT_DEFS += -DNO_DEBUG
# Search Path
VPATH += $(TARGET_DIR)
VPATH += $(TMK_DIR)
include $(TMK_DIR)/protocol/lufa.mk
include $(TMK_DIR)/common.mk
include $(TMK_DIR)/rules.mk

View file

@ -0,0 +1,5 @@
nokeyboard
==========
This is a template for small project without keyboard function.
You can use `xprintf()` to display messages on [`hid_listen`](https://github.com/tmk/tmk_keyboard/wiki#hid_listen) console for debug.

View file

@ -0,0 +1,50 @@
/*
Copyright 2012 Jun Wako <wakojun@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/>.
*/
#ifndef CONFIG_H
#define CONFIG_H
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0xEEEE
#define DEVICE_VER 0x0000
#define MANUFACTURER TMK
#define PRODUCT nokeyboard
#define DESCRIPTION Product from TMK keyboard firmware project
/* matrix size */
#define MATRIX_ROWS 0
#define MATRIX_COLS 0
/* key combination for command */
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
// Disable power saving in USB suspend loop but remote wakeup is still valid.
// This allows keep USB::Task() going during suspend without power down time delay.
//#define NO_SUSPEND_POWER_DOWN
// Disable USB startup wait, which can delays starting UHS2 Task() for 350-600ms.
//#define NO_USB_STARTUP_WAIT_LOOP
// Disable USB suspend loop, which blocks UHS2 Task() while power saving.
// Note that this also disables power saving and remote wakeup from keyboard completely.
//#define NO_USB_SUSPEND_LOOP
#endif

View file

@ -0,0 +1,11 @@
#include "hook.h"
#include "print.h"
#include "timer.h"
void hook_main_loop(void)
{
static uint16_t last_time = 0;
uint16_t t = timer_read();
if (t != last_time && (t % 1000) == 0) xprintf(".");
last_time = t;
}