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] custom firmware compiling for doio kb28 keeps giving errors with quantum/encoder.h and quantum/util.h HOT 10
- Entering Royal Kludge RK G68 bootloader HOT 7
- [Bug] `./util/docker_build.sh` should not require `docker-machine` HOT 2
- Unrecognized after re-plugging, thick line unknown USB device (device descriptor request failed) HOT 1
- I would like to remove the like_jis keymap. HOT 2
- How to map the joystick to several buttons? HOT 1
- Rotery encoder missing inputs on fast rotation
- Removing layer related functionality HOT 2
- How to add a new keyboard to QMK? HOT 1
- STM32F4 Stuck after waking up in Stop mode
- [Feature Request] Can you add uart_stop () and uart_start() functions to serial drivers? HOT 1
- [Feature Request] Overload key, but only if last normal key press happened n time ago
- Need your help with the keyboard of the informer 213 terminal HOT 1
- [Feature Request] Multi-touch zoom and "smart zoom" HOT 3
- [Bug] keyboard unresponsive after sleep
- [Bug] Holding KC_RSFT does not work when Auto Shift is active (it gets released before next keypress) HOT 1
- stm32f103
- [DOC] RGB Matrix - Add blurb and sample to get RGB struct in proper GRB/RGB/BGR orde HOT 2
- [Bug] Macros are not working properly on Ubuntu 22.04 LTS HOT 4
- [Bug] QMK macros not working on Ubuntu HOT 1
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.