Anybody know how to program a phantom?
-
- Main keyboard: K90 | Model M | Phantom
- Main mouse: DeathAdder | Anywhere MX
- Favorite switch: I'll have to buy more keyboards to find out!
- DT Pro Member: -
I'm having difficulty figuring out how to program my phantom. I'm using the TMK Keyboard firmware and it's really confusing. I want to use MXLOCK for my caps lock, and I want to have a function layer. I've got no idea on how to program this, and the github readme doesn't serve much help (I don't even know what files I should be editing). Any assistance is appreciated, whether a link to a tutorial, an example, or personal help.
-
- Location: Sweden
- Main keyboard: HHKB Pro 2
- Main mouse: MS IntelliMouse Explorer 3
- Favorite switch: MX Brown
- DT Pro Member: -
To start things off, here are the things you need to install and instructions for how to build:
https://github.com/tmk/tmk_keyboard/blo ... c/build.md
Then read here for phantom specifics:
https://github.com/tmk/tmk_keyboard/tre ... rd/phantom
You should do all edits and compilation in you git repo under keyboards/phantom
The easiest way to customize the keymap is to edit the default keymap which is keymap_ansi.h
If you take a look at the Makefile you will see how to add your own .h file (which i recommend)
This should get you started i hope
https://github.com/tmk/tmk_keyboard/blo ... c/build.md
Then read here for phantom specifics:
https://github.com/tmk/tmk_keyboard/tre ... rd/phantom
You should do all edits and compilation in you git repo under keyboards/phantom
The easiest way to customize the keymap is to edit the default keymap which is keymap_ansi.h
If you take a look at the Makefile you will see how to add your own .h file (which i recommend)
This should get you started i hope
-
- Main keyboard: K90 | Model M | Phantom
- Main mouse: DeathAdder | Anywhere MX
- Favorite switch: I'll have to buy more keyboards to find out!
- DT Pro Member: -
Thank you so much! I didn't realize there was a readme in the phantom folder. Is there a way to set a function key that allows the teensy to be reprogrammed without taking apart the keyboard?CJNE wrote:To start things off, here are the things you need to install and instructions for how to build:
https://github.com/tmk/tmk_keyboard/blo ... c/build.md
Then read here for phantom specifics:
https://github.com/tmk/tmk_keyboard/tre ... rd/phantom
You should do all edits and compilation in you git repo under keyboards/phantom
The easiest way to customize the keymap is to edit the default keymap which is keymap_ansi.h
If you take a look at the Makefile you will see how to add your own .h file (which i recommend)
This should get you started i hope
-
- Location: Sweden
- Main keyboard: HHKB Pro 2
- Main mouse: MS IntelliMouse Explorer 3
- Favorite switch: MX Brown
- DT Pro Member: -
Yes there is! If you use the default keymap_ansi.h file for your keymap, change this part:
to look like this:
Now you can map the key FN1 to be the teensy programming key.
I haven't tested the code in the phantom section but it should work the same as for other keyboards.
Function definitions and so on is explained in more detail here:
https://github.com/tmk/tmk_keyboard/blo ... /keymap.md
Code: Select all
static const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1)
};
Code: Select all
enum function_id {
TEENSY_KEY
};
void action_function(keyrecord_t *event, uint8_t id, uint8_t opt)
{
print("action_function called\n");
print("id = "); phex(id); print("\n");
print("opt = "); phex(opt); print("\n");
if (id == TEENSY_KEY) {
clear_keyboard();
print("\n\nJump to bootloader... ");
_delay_ms(250);
bootloader_jump(); // should not return
print("not supported.\n");
}
}
static const uint16_t PROGMEM fn_actions[] = {
ACTION_LAYER_MOMENTARY(1),
ACTION_FUNCTION(TEENSY_KEY)
};
I haven't tested the code in the phantom section but it should work the same as for other keyboards.
Function definitions and so on is explained in more detail here:
https://github.com/tmk/tmk_keyboard/blo ... /keymap.md
-
- Main keyboard: K90 | Model M | Phantom
- Main mouse: DeathAdder | Anywhere MX
- Favorite switch: I'll have to buy more keyboards to find out!
- DT Pro Member: -
Code: Select all
static const uint16_t PROGMEM fn_actions[] = {
ACTION_LAYER_MOMENTARY(1),
ACTION_FUNCTION(TEENSY_KEY)
};
-
- Location: Sweden
- Main keyboard: HHKB Pro 2
- Main mouse: MS IntelliMouse Explorer 3
- Favorite switch: MX Brown
- DT Pro Member: -
The 1 in that code is the layer number to switch to.
FN0 ... FNn are special functions that you can assign to keys and the numbers are just their position in the fn_actions array.
FN0 ... FNn are special functions that you can assign to keys and the numbers are just their position in the fn_actions array.
Code: Select all
static const uint16_t PROGMEM fn_actions[] = {
ACTION_LAYER_MOMENTARY(1), //This is FN0
ACTION_FUNCTION(TEENSY_KEY), //This is FN1
ACTION_LAYER_MOMENTARY(1) //This is FN2
//etc..
};
-
- Main keyboard: K90 | Model M | Phantom
- Main mouse: DeathAdder | Anywhere MX
- Favorite switch: I'll have to buy more keyboards to find out!
- DT Pro Member: -
Ok, I get it now. Is there any difference between makefile lufa and pjrc? When I try to make, it has a fatal error opening dependency file .dep/obj_phantom_lufa/pjrc_keymap.o.d
-
- Location: Sweden
- Main keyboard: HHKB Pro 2
- Main mouse: MS IntelliMouse Explorer 3
- Favorite switch: MX Brown
- DT Pro Member: -
Great Lufa and pjrc are two different USB stacks, they provide the same basic functionality. I think the tmk firmware is moving focus to Lufa nowadays. It shouldn't matter which one you choose.
You need to provide more detail in order to get help with the compile error. It might be that you have an error in your edited keymap, look for earlier errors in the compile output.
You need to provide more detail in order to get help with the compile error. It might be that you have an error in your edited keymap, look for earlier errors in the compile output.
-
- Main keyboard: K90 | Model M | Phantom
- Main mouse: DeathAdder | Anywhere MX
- Favorite switch: I'll have to buy more keyboards to find out!
- DT Pro Member: -
Code: Select all
C:\Users\xspartancx\Desktop\tmk_keyboard-master\keyboard\phantom>make -f Makefile.lufa an
si
0 [main] sh 5404 sync_with_child: child 8908(0x128) died before initialization
with status code 0x0
275 [main] sh 5404 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
0 [main] sh 9308 sync_with_child: child 8436(0x128) died before initialization
with status code 0x0
252 [main] sh 9308 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
-------- begin --------
avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
0 [main] sh 10228 sync_with_child: child 5712(0x120) died before initialization
with status code 0x0
247 [main] sh 10228 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
mkdir -p obj_phantom_lufa
Compiling C: keymap.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=512 -DF_US
B=16000000UL -DARCH=ARCH_AVR8 -D USB_DEVICE_ONLY -D USE_FLASH_DESCRIPTORS -D USE_STAT
IC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DPR
OTOCOL_LUFA -DBOOTMAGIC_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -D
VERSION= -DLAYOUT_ANSI -Os -funsigned-char -funsigned-bitfields -ffunction-sections -
fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Ws
trict-prototypes -Wa,-adhlns=obj_phantom_lufa/keymap.lst -I. -I../.. -I../../protocol
/lufa -I../../protocol/lufa/LUFA-120730 -I../../common -std=gnu99 -include config.h -
MMD -MP -MF .dep/obj_phantom_lufa_keymap.o.d keymap.c -o obj_phantom_lufa/keymap.o
In file included from keymap.c:124:
keymap_ansi.h: In function 'action_function':
keymap_ansi.h:31: warning: implicit declaration of function '_delay_ms'
keymap_ansi.h:32: warning: implicit declaration of function 'bootloader_jump'
keymap.c: At top level:
keymap.c:151: fatal error: opening dependency file .dep/obj_phantom_lufa_keymap.o.d:
No such file or directory
compilation terminated.
make: *** [obj_phantom_lufa/keymap.o] Error 1
-
- Location: Sweden
- Main keyboard: HHKB Pro 2
- Main mouse: MS IntelliMouse Explorer 3
- Favorite switch: MX Brown
- DT Pro Member: -
Ah, you are missing some includes, add
to the list of includes at the top keymap.c and try to compile again.
Code: Select all
#include <util/delay.h>
#include "bootloader.h"
-
- Main keyboard: K90 | Model M | Phantom
- Main mouse: DeathAdder | Anywhere MX
- Favorite switch: I'll have to buy more keyboards to find out!
- DT Pro Member: -
Still can't access the dependency file...
I found http://www.avrfreaks.net/index.php?name ... ew&t=80740, since I have Vista 64 bit does that mean I need to use something like ubuntu to compile? or is there another problem with how I set up the code?
Code: Select all
C:\Users\xspartancx\Desktop\tmk_keyboard-master\keyboard\phantom>make -f Makefile.lufa an
si
0 [main] sh 9920 sync_with_child: child 1944(0x128) died before initialization
with status code 0x0
66 [main] sh 9920 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
0 [main] sh 9504 sync_with_child: child 4484(0x128) died before initialization
with status code 0x0
75 [main] sh 9504 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
-------- begin --------
avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
0 [main] sh 7240 sync_with_child: child 9804(0x120) died before initialization
with status code 0x0
63 [main] sh 7240 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
mkdir -p obj_phantom_lufa
Compiling C: keymap.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=512 -DF_US
B=16000000UL -DARCH=ARCH_AVR8 -D USB_DEVICE_ONLY -D USE_FLASH_DESCRIPTORS -D USE_STAT
IC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DPR
OTOCOL_LUFA -DBOOTMAGIC_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -D
VERSION= -DLAYOUT_ANSI -Os -funsigned-char -funsigned-bitfields -ffunction-sections -
fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Ws
trict-prototypes -Wa,-adhlns=obj_phantom_lufa/keymap.lst -I. -I../.. -I../../protocol
/lufa -I../../protocol/lufa/LUFA-120730 -I../../common -std=gnu99 -include config.h -
MMD -MP -MF .dep/obj_phantom_lufa_keymap.o.d keymap.c -o obj_phantom_lufa/keymap.o
keymap.c:153: fatal error: opening dependency file .dep/obj_phantom_lufa_keymap.o.d:
No such file or directory
compilation terminated.
make: *** [obj_phantom_lufa/keymap.o] Error 1
-
- Main keyboard: K90 | Model M | Phantom
- Main mouse: DeathAdder | Anywhere MX
- Favorite switch: I'll have to buy more keyboards to find out!
- DT Pro Member: -
Tried it in linux:
EDIT::found out I had to install a library, now it works. Thanks for all your help CJNE!
Code: Select all
mkdir -p obj_phantom_lufa
Compiling C: keymap.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DBOOTLOADER_SIZE=512 -DF_USB=16000000UL -DARCH=ARCH_AVR8 -D USB_DEVICE_ONLY -D USE_FLASH_DESCRIPTORS -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DVERSION=unknown -DLAYOUT_ANSI -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_phantom_lufa/keymap.lst -I. -I../.. -I../../protocol/lufa -I../../protocol/lufa/LUFA-120730 -I../../common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_phantom_lufa_keymap.o.d keymap.c -o obj_phantom_lufa/keymap.o
keymap.c:21:24: fatal error: util/delay.h: No such file or directory
compilation terminated.
make: *** [obj_phantom_lufa/keymap.o] Error 1
-
- Main keyboard: K90 | Model M | Phantom
- Main mouse: DeathAdder | Anywhere MX
- Favorite switch: I'll have to buy more keyboards to find out!
- DT Pro Member: -
aaaaaand I think I bricked my teensy. I was trying to get the locking caps lock to work, and decided to try the programming key. My computer made the hardware unplugging sound, and now the teensy doesn't light up nor is recognized by the computer
- matt3o
- -[°_°]-
- Location: Italy
- Main keyboard: WhiteFox
- Main mouse: Anywhere MX
- Favorite switch: Anything, really
- DT Pro Member: 0030
- Contact:
unplug, wait, press backspace while replugging.
-
- Main keyboard: K90 | Model M | Phantom
- Main mouse: DeathAdder | Anywhere MX
- Favorite switch: I'll have to buy more keyboards to find out!
- DT Pro Member: -
Okay, I'll try that when I get home. Is that supposed to happen when I hit the program button?matt3o wrote:unplug, wait, press backspace while replugging.
- matt3o
- -[°_°]-
- Location: Italy
- Main keyboard: WhiteFox
- Main mouse: Anywhere MX
- Favorite switch: Anything, really
- DT Pro Member: 0030
- Contact:
yes, if you don't actually send the firmware right after.
-
- Main keyboard: K90 | Model M | Phantom
- Main mouse: DeathAdder | Anywhere MX
- Favorite switch: I'll have to buy more keyboards to find out!
- DT Pro Member: -
Okay. I hit the program button and it never reconnected though, so the teensy program never recognized it :/
-
- Main keyboard: K90 | Model M | Phantom
- Main mouse: DeathAdder | Anywhere MX
- Favorite switch: I'll have to buy more keyboards to find out!
- DT Pro Member: -
Had to restart for it to work, i guess I won't use the program button. The unfortunate part is that I can't get the locking caps lock to work. I use CAPS and it works like a normal caps lock, which isn't very effective for MXLOCK. I try LCAP, and it doesn't even turn caps lock on.
-
- Main keyboard: K90 | Model M | Phantom
- Main mouse: DeathAdder | Anywhere MX
- Favorite switch: I'll have to buy more keyboards to find out!
- DT Pro Member: -
did the program key not work because it's missing the [0] = and [1] = in keymap_anis.h?
Code: Select all
static const uint16_t PROGMEM fn_actions[] = {
ACTION_LAYER_MOMENTARY(1),
ACTION_FUNCTION(TEENSY_KEY)
};
-
- Location: Sweden
- Main keyboard: HHKB Pro 2
- Main mouse: MS IntelliMouse Explorer 3
- Favorite switch: MX Brown
- DT Pro Member: -
No, it definitely did trigger the jump to bootloader function, it shut down USB but what happened next i don't know. It was supposed to jump to the bootloader but perhaps the address was not set right?
Assuming it is a Teensy 2.0, try to add:
to config.h, compile and program then try again.
Assuming it is a Teensy 2.0, try to add:
Code: Select all
#define BOOTLOADER_SIZE 512
-
- Main keyboard: K90 | Model M | Phantom
- Main mouse: DeathAdder | Anywhere MX
- Favorite switch: I'll have to buy more keyboards to find out!
- DT Pro Member: -
Cool, it works now! Now if only I could get the LED dimming and locking caps to work... :/ I posted on the official TMK firmware thread over on Geekhack asking about that.
-
- Main keyboard: K90 | Model M | Phantom
- Main mouse: DeathAdder | Anywhere MX
- Favorite switch: I'll have to buy more keyboards to find out!
- DT Pro Member: -
Tried asking on the TMK post, nobody there is sure either as to why the LED brightness and locking caps doesn't work. If you'd like to look at my config.h and keymap.h it's here:
My config.h: http://pastebin.com/7hB9jatE
My keymap_ansi.h: http://pastebin.com/N0wTL3wA
This is a version without the program button, btw
My config.h: http://pastebin.com/7hB9jatE
My keymap_ansi.h: http://pastebin.com/N0wTL3wA
This is a version without the program button, btw
-
- Location: Sweden
- Main keyboard: HHKB Pro 2
- Main mouse: MS IntelliMouse Explorer 3
- Favorite switch: MX Brown
- DT Pro Member: -
Try to add this to config.h
As for the LED brightness, have a look in the Makefile you use and make sure that SLEEP_LED_ENABLE is set to no or commented out (add a # to the beginning of the line)
Code: Select all
#define LOCKING_SUPPORT_ENABLE
#define LOCKING_RESYNC_ENABLE
- HzFaq
- Location: Windsor, UK
- Main keyboard: Phantom
- Main mouse: CST L-Trac
- Favorite switch: MX Clears
- DT Pro Member: -
I was just looking at the LED brightness thing the other day; on a previous firmware version I had fixed it but don't actually remember how...I've since upgraded to a newer firmware and the brightness thing seems to be back!
I think it was this but I've been playing around with my Ergodox and haven't had a chance to test it again. I'm almost positive the solution was in that thread, there's a little more discussion about the leds a few pages further back as well so maybe try there.
I think it was this but I've been playing around with my Ergodox and haven't had a chance to test it again. I'm almost positive the solution was in that thread, there's a little more discussion about the leds a few pages further back as well so maybe try there.
-
- Main keyboard: K90 | Model M | Phantom
- Main mouse: DeathAdder | Anywhere MX
- Favorite switch: I'll have to buy more keyboards to find out!
- DT Pro Member: -
I'm able to get the caps lock to work now, but still can't figure out the LEDs. Those aren't too big of a deal for me though, as I rarely use caps lock or scroll lock. Thanks for the help
-
- Location: Sweden
- Main keyboard: HHKB Pro 2
- Main mouse: MS IntelliMouse Explorer 3
- Favorite switch: MX Brown
- DT Pro Member: -
Glad that you got some of it working at least I don't have a phantom so it's hard to debug.xSpartanCx wrote:I'm able to get the caps lock to work now, but still can't figure out the LEDs. Those aren't too big of a deal for me though, as I rarely use caps lock or scroll lock. Thanks for the help
It could be worth trying with PJRC if you are currently using Lufa, or the other way around...