aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2015-10-12 22:45:04 -0600
committerSelene ToyKeeper2015-10-12 22:45:04 -0600
commite9bfbbbe4d4853d127019260fafc2620b13f3a1f (patch)
tree90b638e6fc198e55be1bf3fc548dff9c4548b7ed
parentOops, forgot to add tk-random header. (diff)
downloadanduril-e9bfbbbe4d4853d127019260fafc2620b13f3a1f.tar.gz
anduril-e9bfbbbe4d4853d127019260fafc2620b13f3a1f.tar.bz2
anduril-e9bfbbbe4d4853d127019260fafc2620b13f3a1f.zip
Made pgm_rand() more erratic (beginning of PROGMEM is boring for this purpose),
made random strobe smaller and better-looking.
-rw-r--r--tk-random.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/tk-random.h b/tk-random.h
index db6c939..d559659 100644
--- a/tk-random.h
+++ b/tk-random.h
@@ -21,8 +21,9 @@
*/
uint8_t pgm_rand() {
- static uint8_t *offset = 0;
- return pgm_read_byte(offset++);
+ static uint16_t offset = 255;
+ offset = (offset + 1) & 0x3ff | 0x0100;
+ return pgm_read_byte(offset);
}
#endif // TK_RANDOM_H
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.