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

Initial whitefox support #987

Merged
merged 10 commits into from
Jan 15, 2017
2 changes: 1 addition & 1 deletion keyboards/whitefox/chconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
* @details Frequency of the system timer that drives the system ticks. This
* setting also defines the system tick time unit.
*/
#define CH_CFG_ST_FREQUENCY 1000
#define CH_CFG_ST_FREQUENCY 100000

/**
* @brief Time delta constant for the tick-less mode.
Expand Down
2 changes: 1 addition & 1 deletion keyboards/whitefox/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ uint8_t matrix_scan(void)
case 8: palSetPad(GPIOC, 11); break;
}

wait_us(1); // need wait to settle pin state
wait_us(10); // need wait to settle pin state
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest that you change this to 20 us, like it's on the Ergodox. It probably works with 10us right now, but if you spawn other threads, it might stop working. 20us is still very fast, as you can do a full scan in 9 * 20us = 180us. For a comparison, the Ergodox Ez takets 3.15 ms, so it's still 7.5 times faster than that.

I don't know the exact reason why the delay has to be at minimum two ticks, but I suspsect it's due to how the context switching is implemented internally in ChibiOS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good catch. I missed that change.


// read col data: { PTD0, PTD1, PTD4, PTD5, PTD6, PTD7, PTC1, PTC2 }
data = ((palReadPort(GPIOC) & 0x06UL) << 5) |
Expand Down