-
-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
Bootmagic doesn't work. #6560
Comments
I see that you're on avr-gcc 9.2. Could you downgrade to 8.3 and see if the issue persists? |
Also, tagging @alex-ong since this may be related to the debounce API stuff. |
We only support gcc 8.3 and 7 3 on avr platforms at this time. All other versions have produced bad code so this could just be a compiler issue. |
I've downgraded AVR-GCC to 8.3, but the compiled firmware still doesn't work except debounce = 0. |
thanks for the tag; i thought that boot-magic skipped matrix.c code entirely but that must have changed since the last time i checked... |
Hmm from my check:
So looks like it uses the regular keyboard scanning code. Another thing that changed was the default debounce algorithm, which moved from a #if DEBOUNCE > 0
static uint16_t debouncing_time;
void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed)
{
if (changed) {
debouncing = true;
debouncing_time = timer_read();
}
if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) {
for (int i = 0; i < num_rows; i++) {
cooked[i] = raw[i];
}
debouncing = false;
}
}
#else //no debouncing.
void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed)
{
for (int i = 0; i < num_rows; i++) {
cooked[i] = raw[i];
}
}
#endif The only things that comes to mind are
I don't have a spare keyboard (danggit) so i find these things hard to debug (if i change firmware on my keyboard to a non working version i'm kind of keyboardless...) are you familiar with |
@alex-ong
with
, the keyboard stopped booting and seemed to be stuck in |
In
line 28~42
Before |
Alright so we know the problem, how should we fix it?
Rewrite debounce api to support is_bootloader()? |
Temporarily, I just put |
Perhaps rewriting the debounce API to support is_bootloader() will prevent similar things from happening again. |
IMO the AVR |
Debounce having know about bootloader breaks encapsulation. I think we should look into things like the lufa init order to see any inconsistencies, for instance there is a qmk_firmware/tmk_core/protocol/lufa/lufa.c Line 1036 in 92f9b6c
|
@zvecr the ATmega32A and 328P use V-USB, not LUFA. |
@fauxpark oh I know. I was implying that we should compare the two for inconsistencies and potentially align them. |
@zvecr i was thinking something along the lines of That way you can feed it fake timestamps, though this is also hacky. That seems clunky though, especially for debounce algorithms that don't need the current_timestamp. I'm glad that we've figured out the problem and are now just deliberating on the best solution though. |
This is now fixed |
Fixed by #8198 |
Describe the Bug
I'm using bface board.
I found that bootmagic does not work with default debounce = 5.
However, bootmagic will work properly when I set debounce to 0.
System Information
Additional Context
my keymap rules.mk
The text was updated successfully, but these errors were encountered: