Coder Social home page Coder Social logo

cub-uanic / tmk_keyboard Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tmk/tmk_keyboard

158.0 158.0 157.0 26.71 MB

keyboard controller firmware for Atmel AVR USB family

Makefile 0.21% C 91.88% C++ 2.72% Assembly 3.84% Shell 0.01% Ruby 0.01% Python 0.69% JavaScript 0.01% HTML 0.61% PHP 0.04% Roff 0.01%

tmk_keyboard's People

Contributors

alex-ong avatar cub-uanic avatar erikpe avatar esell avatar eshaz avatar flabbergast avatar jeffreysung avatar kairyu avatar leizzer avatar marknsikora avatar njbair avatar obones avatar omenlabs avatar p3lim avatar papodaca avatar purdeaandrei avatar rhaberkorn avatar scottjad avatar shayneholmes avatar sigma avatar squarefrog avatar thematrixhasyouexception avatar thomasrussellmurphy avatar tibounise avatar tmk avatar wraul avatar xauser avatar xyverz avatar yashikno avatar youxiaojie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tmk_keyboard's Issues

trying to reset mcp23018 left side not responding

I've been trying to get this firmware working on my dox, but whenever I load it, the left half of the keyboard stops functioning. The keyboard is working fine with ben's standard firmware (no diode switch flipped or anything), so I don't think it's there's any hardware fault.

If I connect the keyboard with hid_listen running, I see this message:

trying to reset mcp23018
left side not responding

repeated in a pretty rapid loop.

Make with keymap failing - Ergodox FAQ out of date?

Running the command make -f Makefile.lufa dvorak fails with make: *** No rule to make target 'dvorak'. Stop..

If KEYMAP=dvorak make -f Makefile.lufa is the correct way to do it, then perhaps the Ergodox-FAQ.md file should be updated?

No response after reboot

After a regular reboot, the keyboard does not response. Unplug and replug "solves" the problem.

System: Windows 10
Keyboard: Ergodox from Falbatech

LGUI/RGUI not working?

I built this project successfully on Mac OS X Yosemite using the provided instructions. However, the LGUI and RGUI keys are never registered (regardless of where they are placed). All other keys function as expected. The keyboard was also tested on Linux and would not register LGUI and RGUI under this firmware.

On both the Mac and Linux machine, using Ben Blazak's stock Ergodox firmware (https://github.com/benblazak/ergodox-firmware) works fine including LGUI/RGUI.

If there's any other information or other files I can provide to be of assistance, I'd be happy to do so.

Roadmap

I think it would be a good idea to establish some sort of road map to limit duplication of work here. It would be good to get this fork to a state where it's easy for other contributors to help out.

Here's what I foresee as the priority of updates for the near future:

  • Assess outstanding Pull Requests, and close or merge as needed
  • Get a basic layout option together for each of the main layouts (QWERTY, Dvorak, Colemak, Workman)
  • Rework the default keymap to follow Ben Blazek's model.
  • Match the new keymap define method, and default to the reworked QWERTY
  • Make the Makefile.lufa default, rename to Makefile, and recommend that that should be the one to use unless Makefile.pjrc is something that is really needed
  • Refactor the fork to include tmk_core as a submodule, and move the Ergodox specific files to the root of the project
  • Create a docs/ directory with the current FAQ file, or move to Wiki.
  • Replace the current README with basic git and build instructions to make it much easier for newcomers to dive right in

I'm open to suggestions for anything else we've missed here. I'm happy to split up the work with @marknsikora to sprint to get this list done.

Documentation: small mistake

In the documentation keycode.txt there's a small mistake

KC_INSERT KC_INT 49 Keyboard Insert1

it's not KC_INT but KC_INS

Latest Teensy app unable to load hex file.

Tried building my keymap after an update. Builds fine. However when I try to load the built hex file in the Teensy app I get the following error.

00:11:33.327: Open File event
00:11:36.781: ihex: parse error line 1454

The tail of my hex reads as follows

:105AA000A30456042004FE03C503380351036A030C
:0E5AB0008303A303010203040506070809008F
:0200000400807A
:040374000000000085 //<--- complaints about this line.
:00000001FF

There is one ticket in QMK referring to a similar issue here. I doubt a similar fix can be applied here since the two makefile setups are different enough at this point.

Any ideas?

LEDS turn off when left hand reconnected

Fairly simple to reproduce using the default layout.

  1. Turn on num lock so LED1 is on
  2. Unplug and reattach left hand
  3. Switch to num pad layer
  4. The num pad works even though the LED1 is off

The light can be re-enabled by toggling the num lock twice

Re-work default keymap

Review and re-work default un-named keymap.
Take best practices and most generic things from KEYMAP_CUB.
See #11 for more details.

ACTION_MODS_KEY and MOD_RALT dont work

I think I found a bug.

On French keyboards, pressing RALT is different from pressing LALT and there are some symbols/character you just can only get by pressing RALT.

For example:

  • to get backslash you have to press RALT + 8.
  • to get pipe ("|") you have to press RALT + 6.
    and so on for 9 symbols.

So I've tried to define a macro on the ergodox source and the macro didn't work.

It was: ACTION_MODS_KEY(MOD_RALT, KC_8)

Getting deeper in the code I found this: in keycode.h there's a bit-filter:

#define MOD_INDEX(code) ((code) & 0x07)

but this filter means there can be only 3 bits = from 000 to 111 = only 7 possible values (from 001 to 111) whereas there are 8 modifiers (same file, in the code):

/* Modifiers */
KC_LCTRL            = 0xE0,
KC_LSHIFT,
KC_LALT,
KC_LGUI,
KC_RCTRL,
KC_RSHIFT,
KC_RALT,
KC_RGUI,

so I've modified the code to:

#define MOD_INDEX(code) ((code) & 0x0F)

and now the following macro work like expected and dont ignore RALT, like this:

ACTION_MODS_KEY(MOD_RALT, KC_8)

May I ask you how I should say this + test to the developping team responsible for this, and how to test it/make sure there's no consequences?

Improved debouncing code, scan rate ~950Hz

Hi,

thank you very much for making your firmware for the ErgoDox available! I was only a user until recently, when I thought I had a bad switch in my keyboard. Long story short: The perceived latency until my terminal emulator shows a window on a largish screen makes me hold the keys until the auto repeat kicks in and a second terminal emulator is started. I've detailed it in an issue here: i3/i3#3306 (comment)

So, in the course of this odyssey, I've rewritten the debouncing code (which was not so great, it blocks the whole keyboard for ~8ms when a single key is pressed) and managed to increase the keyboard scan rate from ~370Hz to ~950Hz, tested with the scan latency measurement code.

I've published my forked code here: https://github.com/fd0/ergodox-tmk

If you're interested, we can try merging my changes back here. I just thought I give you a heads up and say thanks! :)

Create my own mapping

Hi!

I want to create my own mapping for the ergodox, of course. What is the best way to do that? At first I just edited keymap.c to my liking. But I guess that is a bad idea since I will get merge conlficts later on when I pull in changes from upstream.

So, I made my own keymap_linus.h file. I also edited Makefile.lufa and added this at the end:

linus: OPT_DEFS += -DKEYMAP_LINUS
linus: all

And also I had to include the file in keymap.c.

Is this the recommended way to do it?

No wake from USB Suspend

Problem: Using my Ergodox on Arch Linux, the Ergodox will not wake the computer from suspend.

Attempted fix:

First "fix" caused it to always wake up instantly.

Ultimately ended up with the following diffs and it works great for me:

--- a/common/avr/suspend.c
+++ b/common/avr/suspend.c
@@ -59,6 +59,7 @@ static void power_down(uint8_t wdto)
 #ifdef PROTOCOL_LUFA
     if (USB_DeviceState == DEVICE_STATE_Configured) return;
 #endif
+#ifndef NO_SUSPEND_POWER_DOWN
     wdt_timeout = wdto;

     // Watchdog Interrupt Mode
@@ -78,6 +79,7 @@ static void power_down(uint8_t wdto)

     // Disable watchdog after sleep
     wdt_disable();
+#endif
 }

 void suspend_power_down(void)
@@ -90,8 +92,10 @@ bool suspend_wakeup_condition(void)
     matrix_power_up();
     matrix_scan();
     matrix_power_down();
-    for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
-        if (matrix_get_row(r)) return true;
+    for (uint8_t r = 0; r < MATRIX_ROWS; r++) { 
+      for (uint8_t c = 0; c < MATRIX_COLS; c++) {
+        if (matrix_is_on(r,c)) { return true; }
+      }
     }
     return false;
 }

make fails: too few arguments to function 'suspend_power_down'

When running make -f Makefile.pjrc in tmk_keyboard/keyboard/ergodox, I get the following error:

../../protocol/pjrc/main.c:63:13: error: too few arguments to function 'suspend_power_down'
             suspend_power_down();
             ^
In file included from ../../protocol/pjrc/main.c:35:0:
../../common/suspend.h:9:6: note: declared here
 void suspend_power_down(uint8_t timeout);
      ^
../../rules.mk:541: recipe for target 'obj_ergodox_pjrc/protocol/pjrc/main.o' failed
make: *** [obj_ergodox_pjrc/protocol/pjrc/main.o] Error 1

Dvorak Keymap

I've created the attached keymap_dvorak to replace the essentially empty tmk_keyboard-cub_layout/keyboard/ergodox/keymap_dvorak.h.

keymap_dvorak.h.txt

Modernise the LED interface.

There have been some massive improvements to tmk concerning hooks.

This makes it trivial to setup your own LED scheme directly from within your keymap. For example, I currently only use 4 layers, and rarely use caps, num or scroll lock. As a result I have the following in my keymap:

void show_layer_led(uint32_t layer)
{
    ergodox_led_all_off();

    switch (layer) {
        case 1 << 1:
            ergodox_right_led_1_on();
            break;
        case 1 << 2:
            ergodox_right_led_2_on();
            break;
        case 1 << 3:
            ergodox_right_led_3_on();
            break;
        case 1 << 4:
            ergodox_right_led_2_on();
            ergodox_right_led_3_on();
            break;
        default:
            break;
    }
}

void hook_layer_change(uint32_t layer_state)
{
    switch (layer_state) {
        case 1:
            show_layer_led(default_layer_state);
            break;
        default:
            show_layer_led(layer_state);
            break;
    }
}

void hook_default_layer_change(uint32_t layer_state)
{
    show_layer_led(default_layer_state);
}

Taking full advantage of this would help clean up matrix.c. I don't feel there is anything wrong with the current defaults in led.c, so these could be sane defaults in case users do not want to customise this.

Keyboard prevents system from going to standby

I'm using Ubuntu 14.04. and whenever I want to go to Standby, the machine powers down and then right back up again. When I unplug the keyboard the machine stays in standby mode. This is probably a tmk-wide issue, but I'm not shure about that.

tapping CTRL not working in macros

I guess it’s an upstream problem but I’ll open an issue here first given I’ve forked from you and use your ErgoDox code :)

In this macro

MACRO( I(50), T(LCTRL), T(LCTRL), W(255), W(255), T(ENTER), END)

https://github.com/kaimi/tmk_keyboard/blob/1.0.1/keyboard/ergodox/keymap_neo.h#L402

only the ENTER is registered, both LTCTRL are silently omitted. XEV output:

KeyPress event, serial 32, synthetic NO, window 0x3a00001,
    root 0xa2, subw 0x0, time 27317479, (-128,418), root:(559,457),
    state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,
"   XLookupString gives 1 bytes: (0d) "
"   XmbLookupString gives 1 bytes: (0d) "
    XFilterEvent returns: False

KeyRelease event, serial 32, synthetic NO, window 0x3a00001,
    root 0xa2, subw 0x0, time 27317535, (-128,418), root:(559,457),
    state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,
"   XLookupString gives 1 bytes: (0d) "
    XFilterEvent returns: False

I tried seperate D(LCTRL), U(LCTRL) and even reducing the macro to just T(LTCRL), T(ENTER). Don’t work either.

Bootloader keymap

Hi!

In the Massdrop config generator you can assign a key as [Teensy] which is the same as pushing on the bootloader button on the Teensy. I can't find anything about that on this project.
Is it possible to map a bootloader key with this firmware?

I just want to know whether I need to drill a hole in my case or not :)

Left hand LEDs usage

How can I test if the LEDs are even working? How does the activation of LEDs work depending on the active layer?

Edit: I found the code that should activate the LEDs in matrix.c, I've modified it to count the layers binary using the left hand LEDs but they are not lighting up. They are not lighting up at boot either. How can I debug?

Getting 'undefined reference to' error building with gcc-avr 7

Using avr-gcc-7.3.0-1 and avr-libc 2.0.0-1 on Arch Linux .

When building the with make -f Makefile.lufa:

obj_ergodox_lufa/ergodox.o: In function `ergodox_blink_all_leds':                                                                                                                                                   
./tmk_keyboard/keyboard/ergodox/ergodox.c:70: undefined reference to `ergodox_led_all_off'
./tmk_keyboard/keyboard/ergodox/ergodox.c:71: undefined reference to `ergodox_led_all_set'
./tmk_keyboard/keyboard/ergodox/ergodox.c:72: undefined reference to `ergodox_led_all_on'
./tmk_keyboard/keyboard/ergodox/ergodox.c:74: undefined reference to `ergodox_led_all_off'
obj_ergodox_lufa/led.o: In function `led_set':
./tmk_keyboard/keyboard/ergodox/led.c:31: undefined reference to `ergodox_right_led_1_on'
./tmk_keyboard/keyboard/ergodox/led.c:45: undefined reference to `ergodox_right_led_2_on'
./tmk_keyboard/keyboard/ergodox/led.c:52: undefined reference to `ergodox_right_led_3_on'
./tmk_keyboard/keyboard/ergodox/led.c:33: undefined reference to `ergodox_right_led_1_off'
./tmk_keyboard/keyboard/ergodox/led.c:47: undefined reference to `ergodox_right_led_2_off'
./tmk_keyboard/keyboard/ergodox/led.c:54: undefined reference to `ergodox_right_led_3_off'
collect2: error: ld returned 1 exit status
make: *** [../../tmk_core/rules.mk:545: ergodox_lufa.elf] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.