diff options
| author | Selene ToyKeeper | 2017-06-18 06:39:41 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2017-06-18 06:39:41 -0600 |
| commit | 28f1c7a089d86b8beed3237a8aa40c19744315db (patch) | |
| tree | a050a582d397276e4f2b4c45089802334dc51775 /tk-random.h | |
| parent | fixed tiny25 BOGOMIPS value (diff) | |
| parent | merged trunk (diff) | |
| download | anduril-28f1c7a089d86b8beed3237a8aa40c19744315db.tar.gz anduril-28f1c7a089d86b8beed3237a8aa40c19744315db.tar.bz2 anduril-28f1c7a089d86b8beed3237a8aa40c19744315db.zip | |
Merged the crescendo (ramping-clicky UI) branch.
Applied tk-delay.h changes everywhere I could find a need for it.
Diffstat (limited to 'tk-random.h')
| -rw-r--r-- | tk-random.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tk-random.h b/tk-random.h index d559659..b2ff296 100644 --- a/tk-random.h +++ b/tk-random.h @@ -22,7 +22,10 @@ uint8_t pgm_rand() { static uint16_t offset = 255; - offset = (offset + 1) & 0x3ff | 0x0100; + // loop through ROM space, but avoid the first 256 bytes + // because the beginning tends to have a big ramp which + // doesn't look very random at all + offset = ((offset + 1) & 0x3ff) | 0x0100; return pgm_read_byte(offset); } |
