A stack which works with or without an Mbed os library. Provides IPv4 or IPv6 with a full 1500 byte buffer.

Dependents:   oldheating gps motorhome heating

Committer:
andrewboyson
Date:
Fri Jul 19 17:48:06 2019 +0000
Revision:
151:bde6f7da1755
Parent:
133:a37eb35a03f1
Removed private key and certificate from semihost storage as found to be unreliable (though secure) and moved it into flash storage (reliable, simple, but visible on mbed.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewboyson 98:b977424ec7f7 1 #include <stdbool.h>
andrewboyson 98:b977424ec7f7 2 #include "gpio.h"
andrewboyson 98:b977424ec7f7 3 #include "net-jack-leds.h"
andrewboyson 98:b977424ec7f7 4 #include "mstimer.h"
andrewboyson 98:b977424ec7f7 5
andrewboyson 98:b977424ec7f7 6 #define BLINK_DURATION_MS 50
andrewboyson 98:b977424ec7f7 7
andrewboyson 98:b977424ec7f7 8 void JackLeds(bool phyLink, bool phySpeed, bool activity)
andrewboyson 98:b977424ec7f7 9 {
andrewboyson 98:b977424ec7f7 10 static int blinkTimer = 0;
andrewboyson 98:b977424ec7f7 11
andrewboyson 98:b977424ec7f7 12 if (activity) blinkTimer = MsTimerCount;
andrewboyson 133:a37eb35a03f1 13 if (MsTimerRelative(blinkTimer, BLINK_DURATION_MS))
andrewboyson 98:b977424ec7f7 14 {
andrewboyson 98:b977424ec7f7 15 if (phyLink) LED_GR_L_SET; else LED_GR_L_CLR;
andrewboyson 98:b977424ec7f7 16 if (phySpeed) LED_YE_R_SET; else LED_YE_R_CLR;
andrewboyson 98:b977424ec7f7 17 }
andrewboyson 98:b977424ec7f7 18 else
andrewboyson 98:b977424ec7f7 19 {
andrewboyson 98:b977424ec7f7 20 LED_GR_L_CLR;
andrewboyson 98:b977424ec7f7 21 LED_YE_R_CLR;
andrewboyson 98:b977424ec7f7 22 }
andrewboyson 98:b977424ec7f7 23 }
andrewboyson 98:b977424ec7f7 24
andrewboyson 98:b977424ec7f7 25 void JackInit()
andrewboyson 98:b977424ec7f7 26 {
andrewboyson 98:b977424ec7f7 27 LED_GR_L_DIR = 1; //Set the direction to 1 == output
andrewboyson 98:b977424ec7f7 28 LED_YE_R_DIR = 1; //Set the direction to 1 == output
andrewboyson 98:b977424ec7f7 29 }