diff options
| author | Selene ToyKeeper | 2015-10-12 22:45:04 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2015-10-12 22:45:04 -0600 |
| commit | e9bfbbbe4d4853d127019260fafc2620b13f3a1f (patch) | |
| tree | 90b638e6fc198e55be1bf3fc548dff9c4548b7ed /tk-random.h | |
| parent | Oops, forgot to add tk-random header. (diff) | |
| download | anduril-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.
Diffstat (limited to 'tk-random.h')
| -rw-r--r-- | tk-random.h | 5 |
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 |
