3 ms·
Very similar to programming micro controllers, a lot of setting registers to arbitrary values to toggle certain bits high or low to enable/disable device functi
by simonbarker87 2y ago
Very similar to programming micro controllers, a lot of setting registers to arbitrary values to toggle certain bits high or low to enable/disable device functionality or set some interrupt or other. You needed the data sheet as well as the code to work out what was going on.
- denysvitali 2y agoOh yes, a good example is setting a magic value to a registry [1] to make sure your microcontroller (in my case, an ESP32-S3) wouldn't reboot because of the watchdog. At first, I was confused on the behavior - after reading the datasheet and setting the magic value, it all made sense. I'm pretty sure it will look like wizardry to the next person looking at the magic value alone. Thankfully code comments are a thing, but magic values are still magic values. [1]: https://github.com/tinygo-org/tinygo/pull/3937/files#diff-8f484e3d04c062bab1a6569baf9d302ec506c49b9ae9b30f98b53254bac13d97R41 https://github.com/tinygo-org/tinygo/pull/3937/files#diff-8f...