this post was submitted on 20 Sep 2023
5 points (100.0% liked)

ErgoMechKeyboards

5766 readers
14 users here now

Ergonomic, split and other weird keyboards

Rules

Keep it ergo

Posts must be of/about keyboards that have a clear delineation between the left and right halves of the keyboard, column stagger, or both. This includes one-handed (one half doesn't exist, what clearer delineation is that!?)

i.e. no regular non-split¹ row-stagger and no non-split¹ ortholinear²

¹ split meaning a separation of the halves, whether fixed in place or entirely separate, both are fine.
² ortholinear meaning keys layed out in a grid

No Spam

No excessive posting/"shilling" for commercial purposes. Vendors are permitted to promote their products/services but keep it to a minimum and use the [vendor] flair. Posts that appear to be marketing without being transparent about it will be removed.

No Buy/Sell/Trade

This subreddit is not a marketplace, please post on r/mechmarket or other relevant marketplace.

Some useful links

founded 1 year ago
MODERATORS
 

I'm having trouble figuring out what's wrong with my files for compiling. the initial errors are pointing to the .h and corresponding part in the keymap.c files but it seems fine to me? i haven't even managed to get to figuring out the joystick part which is where i thought i would start having a bunch of trouble

Unsure the best way to show files but I don't think copy pasting them into the body of this post would be best so I've uploaded here: https://drive.google.com/drive/folders/1WKobV73ZdovPCUUcp0jLBLaX8L6IFEmp?usp=drive_link

The txt file shows the error text I get when trying to compile

Thank you

you are viewing a single comment's thread
view the rest of the comments
[–] obosob 1 points 1 year ago* (last edited 1 year ago) (10 children)

Does your keyboard have asymmetric halves? The left having 7 columns and the right having 6? As the other commenter pointed out you have defined 6 columns but your layout macro in eiris.h has 7 elements for the left hand. I think the way to solve it is to define it as 7 columns, add NO_PIN to the end of MATRIX_COL_PINS_RIGHT and then just add XXX to the end of all the rows for the right half in your layout macro in eiris.h.

This is outlined in the documentation

[–] denton@lemm.ee 1 points 1 year ago* (last edited 1 year ago) (9 children)

Yes there's one extra column on the left.

I'd spotted that error but forgot to update the Google drive after updating the .h file. I'll try adding no pin!

Thank you!

Edit: that solved the LAYOUT errors!

Now it's just the QK_BOOT and joystick code errors

[–] obosob 1 points 1 year ago (8 children)

For the joystick part, do you have JOYSTICK_ENABLE = yes in your rules.mk?

[–] denton@lemm.ee 1 points 1 year ago (1 children)

Yep. QK_BOOT error was resolved after I updated, now it's just left with the joystick error. I've also uploaded rules.mk to the drive link

[–] obosob 1 points 1 year ago (1 children)

your compilation errors now just seem to be because of mismatched braces. you have an extra closing brace in keymap.c before the xPos = analogReadPin(B4); as well as after the intended close of the matrix_scan_user method.

[–] denton@lemm.ee 1 points 1 year ago (1 children)

I've tried to rewrite the joystick code and now am getting different errors:

Compiling: quantum/keymap_introspection.c                                                           [OK]
Compiling: quantum/command.c                                                                        [OK]
Compiling: tmk_core/protocol/host.c                                                                tmk_core/protocol/host.c: In function 'host_joystick_send':
tmk_core/protocol/host.c:171:10: error: 'report_joystick_t' {aka 'struct '} has no member named 'axes'
         .axes =
          ^~~~
tmk_core/protocol/host.c:172:13: error: extra brace group at end of initializer
             {
             ^
tmk_core/protocol/host.c:172:13: note: (near initialization for 'report')
tmk_core/protocol/host.c:172:13: error: excess elements in struct initializer [-Werror]
tmk_core/protocol/host.c:172:13: note: (near initialization for 'report')
cc1: all warnings being treated as errors
 [ERRORS]
 | 
 | 
 | 
gmake[1]: *** [builddefs/common_rules.mk:361: .build/obj_eiris_default/protocol/host.o] Error 1
gmake: *** [Makefile:392: eiris:default] Error 1
Make finished with errors

Also, I'm not sure if I need "#include "config_common.h" in my config.h file? I see it in some other config.h files. When I have that in my config.h file, it gives a fatal error: No such file or directory

[–] obosob 1 points 1 year ago (1 children)

i don't think you need to include config_common.h, that's just a convention for when there are multiple revisions of a keyboard but most of the stuff is common.

as for the other code, try removing things until you get it to compile and start adding it back. it looks like the problem could be happening inside some macro expansion or something. i think it would help to format your code a bit to make it easier to follow, there's not really a need for the switch statement with only one case, etc. use consistent indentation, and such.

[–] obosob 1 points 1 year ago (1 children)

so i had a crack at fixing it and got it to compile, obviously unable to test it functionally. I've pushed the code here.

I noticed you're not actually using the joystick features since you're reading the analog pins manually (btw, you should read them once per scan instead of in every if statement). so i just removed all the joystick code and the JOYSTICK_ENABLE = yes. i'm not sure what exactly you're trying to do but what I've got builds and doesn't remove any of the functional code, so see how you go from there. I don't know much about using the joystick feature in QMK so I can't really advise on how to use it instead of what you're doing, but as it stands you seem to not be utilising it anyway.

Good luck. if you're stuck, maybe try going to the QMK discord and explaining what you are trying to achieve and see what people say there. Be careful not to assume the implementation and ask the wrong question, describe what you want to achieve at a high level and see what they advise to implement it (see the XY problem)

[–] denton@lemm.ee 1 points 1 year ago* (last edited 1 year ago) (1 children)

I've actually got all the code to work now except the joystick part, which is the biggest (new) part for me for this keeb. I've been on the QMK discord (that's how I knew to update QMK to resolve QK_BOOT haha, although I'm not entirely sure the combo works...) What do you mean read the joystick input pins once per scan instead of in every if statement?

edit: yeah config_common is deprecated according to the QMK discord. very unfortunately I actually have no idea what I'm doing with QMK/C++ code (esp the joystick part) in general and have just been kinda sticking things I've found on the internet in in hopes of something working out but no luck so far

[–] obosob 1 points 1 year ago* (last edited 1 year ago) (1 children)

What I mean is in the matrix scan code you have multiple calls to analogReadPin(B5) and analogReadPin(B4). You used to just read it at the top of the function and store its value in a local variable. I'm suggesting to put that back.

[–] denton@lemm.ee 1 points 1 year ago

Ah ok got you, I've changed it back now.

Do you have any idea why this might be happening?

The joystick recognises UP correctly and just for the duration it's pushed upwards.

When pushed to the LEFT, it reads left but continuously goes left even when released.

When pushed DOWN, it triggers left and down and continuously goes left and down even when released (when slowwwwwly pushed down, it reads left first, then down)

when pushed to the RIGHT, nothing is recognised (when pushed up first then rolled over to the right, it recognises up and right/right once - inconsistent but most of the time it’s up and right, not just right)

load more comments (6 replies)
load more comments (6 replies)
load more comments (6 replies)