diff options
| author | Selene ToyKeeper | 2017-03-26 15:18:03 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2017-03-26 15:18:03 -0600 |
| commit | 651b2c8bdc72364f7602db356f21d2a061f82ebf (patch) | |
| tree | 07667e2b1b834db0c6db847aa156b3d83513b801 | |
| parent | Made tk-delay.h allow use of both _delay_ms() and _delay_4ms(). (diff) | |
| download | anduril-651b2c8bdc72364f7602db356f21d2a061f82ebf.tar.gz anduril-651b2c8bdc72364f7602db356f21d2a061f82ebf.tar.bz2 anduril-651b2c8bdc72364f7602db356f21d2a061f82ebf.zip | |
Fixed a compiler warning about 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); } |
