Skip to content

Commit e8d8eb0

Browse files
committed
Fix pgmspace casting
1 parent 4756777 commit e8d8eb0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1212
### Deprecated
1313

1414
### Removed
15-
* Unnecessary board changes during unit tests no longer happen
15+
- Unnecessary board changes during unit tests no longer happen
1616

1717
### Fixed
18+
- Proper casting for `pgm_read_byte`
1819

1920
### Security
2021

cpp/arduino/avr/pgmspace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ out.each { |l| puts d(l) }
4242
#define pgm_read_ptr_far(x) (x)
4343

4444

45-
#define pgm_read_byte(x) (x)
45+
#define pgm_read_byte(addr) (*(const uint8_t *)(addr))
4646
#define pgm_read_word(x) (x)
4747
#define pgm_read_dword(x) (x)
4848
#define pgm_read_float(x) (x)

0 commit comments

Comments
 (0)