aboutsummaryrefslogtreecommitdiff
path: root/tk-random.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-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