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

Revision:
98:b977424ec7f7
Child:
132:db2174b36a6d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/link/jack.c	Thu Jan 03 17:23:38 2019 +0000
@@ -0,0 +1,29 @@
+#include <stdbool.h>
+#include "gpio.h"
+#include "net-jack-leds.h"
+#include "mstimer.h"
+
+#define BLINK_DURATION_MS 50
+
+void JackLeds(bool phyLink, bool phySpeed, bool activity)
+{
+    static int blinkTimer = 0;
+    
+    if (activity) blinkTimer = MsTimerCount;
+    if (MsTimerHasElapsed(blinkTimer, BLINK_DURATION_MS))
+    {
+        if (phyLink)  LED_GR_L_SET; else LED_GR_L_CLR;
+        if (phySpeed) LED_YE_R_SET; else LED_YE_R_CLR;
+    }
+    else
+    {
+        LED_GR_L_CLR;
+        LED_YE_R_CLR;
+    }
+}
+
+void JackInit()
+{
+    LED_GR_L_DIR = 1; //Set the direction to 1 == output
+    LED_YE_R_DIR = 1; //Set the direction to 1 == output
+}
\ No newline at end of file