Comments (6)
Yeah! I was meaning to reply on reddit, but this is much better :)
By default, I believe Timer 1 Timer 0 is always running, so you should be able to grab TCNT1
TCNT0
to use for that. You could also set up 0 1, 3, or 4 as well! There's some nice info on the timers here - the chip on the PCB/Teensy 2.0 is the Atmega32u4 if you need to find any specific info about it.
This is pretty awesome, though - let us know what happens!
from qmk_firmware.
Timer0 is already in use in tmk code maybe not the best idea to use it.
See timer_avr.h and timer.c in tmk_core/common/avr.
from qmk_firmware.
Sorry, that's the one I meant! I believe it's safe to read from TCNT0
without affecting anything that's going on.
from qmk_firmware.
I'm grabbing the bottom 8 bits of TCNT1, and am finding it populated, for what it's worth.
I shut off my linear congruential RNG bit, and just used values from TCNT1, and was getting decently variable keystrokes, so it seems as though TCNT1 is being turned on.
With the combination of both RNGs (linear congruential, and XOR in bits from the counter), I'm certainly getting stuff looking random.
Here's some digits... 471074697342030825391029594704832
Here's some letters... xczqlozosvuslrmxcsbctuwtujsszbrwdzieoeegxssvqvecegszwaavkf
Looking good! Thanks, very helpful!
from qmk_firmware.
That's great! Feel free to open a PR when you get things finalised :)
from qmk_firmware.
Was looking at your code cbbrowne and wondered where you put the timer init, looks like Timer1 is used by the backlight sleep code. But as you only need a read (thought you wanted to tailor the timer as well) you could have use Timer0 as well I guess. Sorry for the misunderstanding and noise guys.
from qmk_firmware.
Related Issues (20)
- [Bug] Wrong keycode used to change volume on sofle's via keymap HOT 2
- [Bug] Bottom row of Corne Keyboard issues HOT 1
- [Bug] warning:The official repository does not seem to be configured as git remote "upstream". HOT 12
- [Feature Request] Custom keycodes and axies for joysticks HOT 1
- [help] QMK Doc‘s “Flashing DFU Bootloader” cannot flash APM32。 HOT 1
- [Feature Request] Add Left Control and Alt key HOT 2
- [Bug] Most rules in 50-qmk.rules are missing MODE and GROUP for non-systemd distros HOT 4
- Keys are held down and keep repeating after waking from sleep.
- [Bug] If 4 rotary encoders are specified, all rotary encoders will stop responding. HOT 6
- [Bug] Caps Word get reset by normal press with interrupting character on long press HOT 2
- [Feature Request] Password manager/generator functionality HOT 1
- [Bug] Capslock randomly trigger while typing with Sofle V2 HOT 1
- Rotary Encoders - Microsoft flight simulator - MSFS Heading, Speed, Altitude Control HOT 2
- Strange behaviour of macros with lily58 HOT 1
- Compilation of TAP DANCE fails (code compiled previously). HOT 2
- Updating STENO code from an older QMK version
- qmk msys can not convert to get file uf2, fatal error HOT 1
- [Bug] Different response of keyboard depending on key pressing speed in succesion .
- [Bug] Idobao ID75 V3 (Drop) Issue with RGB Matrix
- [Bug] xd75 doesn't build on head HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qmk_firmware.