Fixed newly-introduced compile-breaking bugs in the network code.

This commit is contained in:
OBattler
2019-11-14 21:22:54 +01:00
parent aed984c265
commit 841a1f67da
4 changed files with 20 additions and 6 deletions

View File

@@ -99,7 +99,7 @@ static netcard_t net_cards[] = {
int network_type;
int network_ndev;
int network_card;
volatile int network_wait = 0;
static volatile int net_wait = 0;
char network_host[522];
netdev_t network_devs[32];
#ifdef ENABLE_NIC_LOG
@@ -221,7 +221,7 @@ network_attach(void *dev, uint8_t *mac, NETRXCB rx)
net_cards[network_card].rx = rx;
network_mac = mac;
network_wait = 0;
network_set_wait(0);
/* Create the network events. */
poll_data.wake_poll_thread = thread_create_event();
@@ -450,5 +450,19 @@ network_card_get_from_internal_name(char *s)
void
network_set_wait(int wait)
{
network_wait = wait;
network_wait(1);
net_wait = wait;
network_wait(0);
}
int
network_get_wait(void)
{
int ret;
network_wait(1);
ret = net_wait;
network_wait(0);
return ret;
}