TMK keyboard firmware collection

User avatar
snacksthecat
✶✶✶✶

05 Jun 2019, 22:10

Unfortunately disabling bootmagic didn't work. I'll keep playing around with different things.

The pcb is an Alps plate spring pcb that I designed (using your kicad libraries btw). It's really not at all comparable to GH60. I just used that project as a starting point.

User avatar
hasu

05 Jun 2019, 23:00

Ah, then post schematic of your pcb so that we can check your matrix scan code.

And, what is your exact MCU part number or source?
Did you fiddle with MCU fuse setting with ISP programmer, perhaps?

User avatar
Muirium
µ

27 Sep 2019, 19:00

So, I've had a Caps Lock macro on my shoulder today. Having gotten it working again on Xwhatsit earlier, I decided to give my HHKB a go. Sure, Fn + Tab = Caps Lock, I know, but I really like Shift + Shift = Caps Lock the best. I hadn't tried this sooner because I don't really understand macros in TMK, and I also know Hasu uses Shift + Shift as the magic key combo for entering bootloader mode etc. But, hey, I've always got that reset button on the back! So here's my attempt today in Unimap.

Screenshot 2019-09-27 at 5.51.38 pm.png
Screenshot 2019-09-27 at 5.51.38 pm.png (281.74 KiB) Viewed 1333 times

I'm using the same trick Hasu showed me for my Command + Esc = Command + Tilde "macro". Namely: borrow another layer. In layer 5, both shifts are remapped to Caps Lock, like I did on my Kishsaver and AT in Xwhatsit's GUI. No timed macro cunningness here, but it works anyway. Well, with one downside.

To enter the HHKB's bootloader, you can either pull off the DIP switch port cover and press the red reset button, *or* press Shift + Shift + Fn + P (namely Shift + Shift + Pause/Break) to do it entirely on the keyboard. This trick has lost me that capability. I tried mapping P to Pause/Break in Layer 5 but that doesn't trigger it, and loses me the rather more useful ability to type capital P while holding Shift!

I wonder, is there a better way to achieve this? I don't want to have to mess in code, and all too likely break compatibility with Unimap. But I do like playing with my HHKB's Hasu-powered programmability often enough that the Magic key combo is plenty handy in its own right.

User avatar
Muirium
µ

27 Sep 2019, 19:18

Oh, actually, I think I've got it! Check this out:

Screenshot 2019-09-27 at 6.10.42 pm.png
Screenshot 2019-09-27 at 6.10.42 pm.png (286.9 KiB) Viewed 1325 times

I realised the problem I made for myself was I'd disabled Hasu's "Magic key" by swapping it out to Caps Lock. But! The only time I use his Magic key is when I'm pressing Pause/Break to enter the bootloader. And! Break is on Layer 1. So how about I just made sure those two Shifts were real Shift keys on Layer 1?

See, I read enough of TMK's documentation to know how "transparent" keys work. Any given layer overwrites the one below. My special layer shifting (and Shift destroying) Shift keys are down on Layer 0. If I overwrite them with normal Shifts up on Layer 1, all subsequent layers inherit those, until Layer 5, which is where Caps Lock looms, far away until it's called for.

So, as long as I press Fn + Shift + Shift + P in that order, Fn first!, I can enter the bootloader all posh style, without having to pull the DIP switch cover off. Very nice! Got to love this programmability. Powerful enough you can make yourself new problems and fix those too!

John Doe

06 Feb 2020, 08:15

Hi, guys, need your help here.

When I tried to compile for .hex file from the source code for a vintage kbd, error info was showed like this:

Code: Select all

In file included from keymap_mario.c:1:
keymap_common.h:50:37: error: 'KC_12' undeclared here (not in a function); did you mean 'KC_F12'?
   50 |     { KC_NO,    KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \
      |                                     ^~~
keymap_common.h:79:3: note: in expansion of macro 'KEYMAP'
   79 | ) KEYMAP( \
      |   ^~~~~~
keymap_mario.c:23:5: note: in expansion of macro 'KEYMAP_N'
   23 |     KEYMAP_N( \
      |     ^~~~~~~~


And keymap_common.h file was defined like this:

Code: Select all

#ifndef KEYMAP_COMMON_H
#define KEYMAP_COMMON_H

#include <stdint.h>
#include <stdbool.h>
#include "keycode.h"
#include "action.h"
#include "action_macro.h"
#include "report.h"
#include "host.h"
#include "print.h"
#include "debug.h"
#include "keymap.h"


#define KEYMAP( \
    K00, K01, K02, K03, K04, K05, K06, K07, \
    K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \
         K11, K12, K13, K14, K15, K16, K17, \
    K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, \
    K20, K21, K22, K23, K24, K25, K26, K27, \
    K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, \
    K30,                          K36, K37, \
    K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, \
    K40, K41, K42, K43, K44, K45, K46, K47, \
    K48, K49, K4A, K4B, K4C, K4D, K4E, K4F, \
    K60, K61, K62, K63, K64, K65, K66, K67, \
    K68, K69, K6A, K6B, K6C, K6D, K6E, K6F, \
    K70, K71, K72, K73, K74, K75, K76, K77, \
    K78, K79, K7A, K7B,           K7E, K7F  \
) { \
    { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \
    { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \
    { KC_NO,    KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \
    { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \
    { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \
    { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \
    { KC_##K30, KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_##K36, KC_##K37 }, \
    { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F }, \
    { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, \
    { KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_##K4F }, \
    { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \
    { KC_##K68, KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_##K6D, KC_##K6E, KC_##K6F }, \
    { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \
    { KC_##K78, KC_##K79, KC_##K7A, KC_##K7B, KC_NO,    KC_NO,    KC_##K7E, KC_##K7F }  \
}

#define KEYMAP_N( \
    K00, K01, K02, K03, K04, K05, K06, K07, \
    K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \
         K11, K12, K13,      K15, K16, K17, \
    K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, \
    K20, K21, K22, K23, K24, K25, K26, K27, \
    K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, \
    K30,                          K36, K37, \
    K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, \
    K40, K41, K42, K43, K44, K45, K46, K47, \
    K48, K49, K4A, K4B, K4C, K4D, K4E, K4F, \
    K60, K61, K62, K63, K64, K65, K66, K67, \
    K68, K69, K6A, K6B, K6C, K6D, K6E, K6F, \
    K70, K71, K72, K73, K74, K75, K76, K77, \
    K78, K79, K7A, K7B,           K7E, K7F  \
) KEYMAP( \
    K00, K01, K02, K03, K04, K05, K06, K07, \
    K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \
         K11, K12, K13, NO,  K15, K16, K17, \
    K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, \
    K20, K21, K22, K23, K24, K25, K26, K27, \
    K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, \
    K30,                          K36, K37, \
    K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, \
    K40, K41, K42, K43, K44, K45, K46, K47, \
    K48, K49, K4A, K4B, K4C, K4D, K4E, K4F, \
    K60, K61, K62, K63, K64, K65, K66, K67, \
    K68, K69, K6A, K6B, K6C, K6D, K6E, K6F, \
    K70, K71, K72, K73, K74, K75, K76, K77, \
    K78, K79, K7A, K7B,           K7E, K7F  \
)

#endif


The keymap_mario.c file was here, and the specific keys will be changed then if compiling without error, just for test now.

Code: Select all

#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    KEYMAP_N( \
        1,   1,  1,  1,  1,  1,  1,  1,   \
        9,   2,  3,  4,  5,  6,  7,  8,   \
             1,  9,  12,     1,  1,  1,   \
        8,   1,  2,  3,  4,  5,  6,  7,    \
        1,   9,  0,  1,  1,  1,  1,  1,   \
        1,   1,  1,  2,  3,  1,  1,  1,  \
        1,                       1,  1,   \
        I,   Q,  W,  E,  R,  T,  Y,  U,   \
        1,   O,  P,  1,  1,  1,  2,   2,   \
        K,   A,  S,  D,  F,  G,  H,  J,     \
        3,   L,  2,  3,  3,  2,  1,   1,  \
        1,   7,  4,  5,  6,  1,  1,   1,  \
        2,   Z,  X,  C,  V,  B,  N,  M,     \
        1,   2,  1,  2,          2,   3 \
)const action_t PROGMEM fn_actions[] = {};



Using Macos Catalina10.15.2 system environment, Xcode for coding, maybe no business with the error tho.

THANKS in advance.
Last edited by John Doe on 09 Feb 2020, 07:21, edited 3 times in total.

John Doe

06 Feb 2020, 08:55

Oh, I made a big mistake for the keymap_mario.c. No way for the row 3 and col 4 with a 12.
Can't believe my stupidness.
Solved now.

Edit:
another problem appeared:
When flashing the .hex file to the teensy2.0 with teensy loader, it seems failed. Then I tried original blink_fast_Teensy2.hex as a test, no issue appeared and the LED start blinking normally. Then I flashed soarer's hex file lot of times, some of them flashed successfully but more failed. I guess a possible reason may has connection with the .hex size (blink_fast_Teensy2.hex 7kb, soarer.hex 40, and my .hex file 62kb, all under MacOS)? Or what other potential causes?

Any help will be appreciated.

John Doe

06 Feb 2020, 14:57

Need to throw more money to get teensy2.0++ as more test?

John Doe

11 Feb 2020, 10:38

Sorry for fuss, I got a teensy2.0++ and make it worked finally. But a new phenomenon appeared, thats when I press ctrl + alphabet characteristic, like I press a-z while holding the alt key, it shows like this:

Code: Select all

å∫ç∂´ƒ©˙ˆ∆˚¬µ˜øπœ®ß†¨√∑≈¥Ω
still MacOS system, anybody could give a help? Thanks.

Findecanor

11 Feb 2020, 11:29

Isn't that what is supposed to happen on Mac when you hold Alt/Option and press an alphabetic key?

John Doe

11 Feb 2020, 11:47

Findecanor wrote:
11 Feb 2020, 11:29
Isn't that what is supposed to happen on Mac when you hold Alt/Option and press an alphabetic key?
Sorry, I just change to MacOS from windows for few days, not familiar with it yet. Is there a way to switch them to like alt+a = select all status?Thanks.

Post Reply

Return to “Workshop”