Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor m60 #639

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Refactor m60 #639

wants to merge 9 commits into from

Conversation

mcrosson
Copy link
Contributor

Some general updates and cleanup for the maker diary m60 keyboard

@Nicell Nicell added enhancement New feature or request shields PRs and issues related to shields labels Feb 1, 2021
@Nicell
Copy link
Member

Nicell commented Feb 1, 2021

@mcrosson Please request me for a review when you're ready for this to be reviewed.

@bricewge
Copy link

bricewge commented Feb 5, 2021

I tried the last artifact on a m60 keyboard, but the mapping is off :

  • Escape -> 1
  • 1 -> 2
  • Back space -> Tab
  • Tab -> q
  • q ->w

As if the Escape key dispread and the others moved one position to the left, leaving Ctrl_R empty.

@mcrosson
Copy link
Contributor Author

mcrosson commented Feb 5, 2021

I tried the last artifact on a m60 keyboard, but the mapping is off :

I likely have something shifted in the keymap. I'll have a look soon ; I'm waiting on some battery related feedback from someone who uses the m60 as a daily and is on a mission to figure out battery stuff.

@mcrosson
Copy link
Contributor Author

mcrosson commented Feb 5, 2021

@bricewge Does the button on the bottom of the keyboard do a reset on tap and/or bootloader on hold?

I added support for the bottom button and i'm thinking that messed something up in the main keymap but i want to be sure the bottom button works before diving too deep

@mcrosson
Copy link
Contributor Author

mcrosson commented Feb 5, 2021

@bricewge I think i found the bug with the keymap and overlay ; i just pushed an update that should address the problem you were seeing

one thing to note : i moved the on/off button definition to the END of the keymap/overlay so you will probably need to make a small adjustment to your keymap if you have a custom one defined

@bricewge
Copy link

bricewge commented Feb 6, 2021

@mcrosson thank you the quick fix. The mapping is correct now.

@bricewge Does the button on the bottom of the keyboard do a reset on tap and/or boot-loader on hold?

Yes, the button underneath the keyboard work as expected to.

For the battery part I'm glad some one else is testing it since I don't really know how to do it. I can't managed to use the Bluetooth on android to see if the battery report is correct, but me not being able to connect to Bluetooth isn't specific to this PR. I'll report back if I manage to correctly test it.

@mcrosson
Copy link
Contributor Author

mcrosson commented Feb 6, 2021

@mcrosson thank you the quick fix. The mapping is correct now.

@bricewge Does the button on the bottom of the keyboard do a reset on tap and/or boot-loader on hold?

Yes, the button underneath the keyboard work as expected to.

For the battery part I'm glad some one else is testing it since I don't really know how to do it. I can't managed to use the Bluetooth on android to see if the battery report is correct, but me not being able to connect to Bluetooth isn't specific to this PR. I'll report back if I manage to correctly test it.

Sounds good, keep me posted as well on anything you may find. I'm using a different keyboard day to day and hoping others with the m60 can help verify this while the battery stuff is being sorted out.

From what I've heard from others the battery setup is a little odd and proving difficult to get going. Which battery are you using @bricewge ?

@bricewge
Copy link

bricewge commented Feb 6, 2021

Sounds good, keep me posted as well on anything you may find. I'm using a different keyboard day to day and hoping others with the m60 can help verify this while the battery stuff is being sorted out.

Will do.

The battery I'm using is a 405570 3.7V 2200mAh with 3 wire: https://fr.aliexpress.com/item/32863787379.html

@gled-rs
Copy link

gled-rs commented Feb 8, 2021

Sounds good, keep me posted as well on anything you may find. I'm using a different keyboard day to day and hoping others with the m60 can help verify this while the battery stuff is being sorted out.

Will do.

The battery I'm using is a 405570 3.7V 2200mAh with 3 wire: https://fr.aliexpress.com/item/32863787379.html

Is your battery charging by any chance ?

After quite a lot of tests, it seems like this board does not charge batteries even on stock firmware ( see makerdiary/python-keyboard#27 ).

I am still investigating and trying to figure this out, but don't hold your breath, don't have a lot of bandwidth at this time on that subject...

@mcrosson
Copy link
Contributor Author

Given @gled-rs is working with makerdiary and still fighting through battery 'stuff' ; we should probably mark this as 'ready for review'

The battery indications seem to be working an until makerdiary reports back on why charging may not be 100% i think we can go forward with this set of updates as they won't affect battery related stuff that comes down the line from makerdiary in due course

@megamind4089
Copy link
Contributor

I have the battery setup working with my M60 keyboard. There are some board specific changes needed to achieve this.
Makerdiary has added some slightly complicated hardware connections in M60 for the power circuit.

According to their wiki:
http://wiki.makerdiary.com/m60/developer_guide/hardware/#power

Power¶
When powered by USB, the keyboard is always on.
When powered by a battery, the keyboard is on if the ON/OFF button is pressed or pin P0_28 outputs 0.
Button¶
The ON/OFF Button is at the back of the keyboard. It is connected to P0_27.

There is one typo in their wiki, Its P0_28 outputs 1

So in battery mode, the keyboard will only be switched on when

  • P0_27 is pressed or
  • P0_28 outputs 1

We need to set/reset P0_28 whenever button(P0_27) is pressed to make the keyboard switch on and off.
I have tested the above behavior with some quick changes and it seems to be working:
4725359

Since its a hardware specific button, I think it is better to remove the button from the keyboard scan and handle it differently

@gled-rs The issue you are facing may be some hardware issue, since my keyboard seems to be charging with the USB connections, I am able to see the battery percentage getting increased in the battery report.
If you have time, you can also load the following firmware and confirm
https://github.com/megamind4089/zmk/actions/runs/585417049

@y4m-y4m
Copy link
Contributor

y4m-y4m commented Jun 2, 2021

Are you sure P1_04, that you defined in nrf52840_m2.dts, is a power led ? I think it's connected to Pin SDB of the led matrix chip (IS31FL3733, Page 4), used to shutdown the chip when pulled to 0.

@petejohanson petejohanson added refactor and removed enhancement New feature or request labels Sep 30, 2021
@hyx0329
Copy link
Contributor

hyx0329 commented Mar 17, 2023

Any update on this? BTW P1_04 IS connected to the led matrix chip, and I think it shouldn't be a power led. I'm still using M60 as a daily drive. Please let me know if you need any assistance. I would like to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor shields PRs and issues related to shields
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants