Skip to content

Commit 9622071

Browse files
author
Alfred Lorber
committed
EEPROM.cc: Added asserts for NULL pointer to aid in debugging
1 parent c599962 commit 9622071

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/EEPROM.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,20 @@ EEPROMMock* EEPROMMockInstance() {
1111
}
1212

1313
void releaseEEPROMMock() {
14+
assert (p_EEPROMMock != NULL);
1415
if (p_EEPROMMock) {
1516
delete p_EEPROMMock;
1617
p_EEPROMMock = NULL;
1718
}
1819
}
1920

2021
uint8_t EEPROM_::read(int a) {
22+
assert (p_EEPROMMock != NULL);
2123
return p_EEPROMMock->read(a);
2224
}
2325

2426
void EEPROM_::write(int a, uint8_t b) {
27+
assert (p_EEPROMMock != NULL);
2528
p_EEPROMMock->write(a, b);
2629
}
2730

0 commit comments

Comments
 (0)