enc28j60: Prevent enc28j60_read() from running before init
This is a precaution in case enc28j60-ip64-driver.c is skipped. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
This commit is contained in:
parent
b4c32954a6
commit
6b76ead49c
|
@ -589,6 +589,10 @@ enc28j60_read(uint8_t *buffer, uint16_t bufsize)
|
||||||
uint8_t status[2];
|
uint8_t status[2];
|
||||||
uint8_t length[2];
|
uint8_t length[2];
|
||||||
|
|
||||||
|
if(!initialized) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
err = 0;
|
err = 0;
|
||||||
|
|
||||||
setregbank(EPKTCNT_BANK);
|
setregbank(EPKTCNT_BANK);
|
||||||
|
|
Loading…
Reference in a new issue