parent
8ac616e8db
commit
ea936f00e1
2 changed files with 10 additions and 3 deletions
|
|
@ -39,6 +39,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <LwipEthernet.h>
|
||||
|
||||
#include "enc28j60.h"
|
||||
|
||||
|
|
@ -696,6 +697,8 @@ uint16_t ENC28J60::phyread(uint8_t reg) {
|
|||
|
||||
bool ENC28J60::isLinked() {
|
||||
// ( https://github.com/JAndrassy/EthernetENC/tree/master/src/utility/enc28j60.h )
|
||||
|
||||
return !!(phyread(MACSTAT2) & 0x400);
|
||||
ethernet_arch_lwip_begin();
|
||||
auto ret = !!(phyread(MACSTAT2) & 0x400);
|
||||
ethernet_arch_lwip_end();
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include <stdint.h>
|
||||
#include <Arduino.h>
|
||||
#include <SPI.h>
|
||||
#include <LwipEthernet.h>
|
||||
|
||||
class Wiznet5500 {
|
||||
public:
|
||||
|
|
@ -83,7 +84,10 @@ public:
|
|||
@return true when physical link is up
|
||||
*/
|
||||
bool isLinked() {
|
||||
return wizphy_getphylink() == PHY_LINK_ON;
|
||||
ethernet_arch_lwip_begin();
|
||||
auto ret = wizphy_getphylink() == PHY_LINK_ON;
|
||||
ethernet_arch_lwip_end();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue