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
link/jack.c@132:db2174b36a6d, 2019-03-20 (annotated)
- Committer:
- andrewboyson
- Date:
- Wed Mar 20 10:55:30 2019 +0000
- Revision:
- 132:db2174b36a6d
- Parent:
- 98:b977424ec7f7
- Child:
- 133:a37eb35a03f1
Updated clock library
Who changed what in which revision?
User | Revision | Line number | New 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 | 132:db2174b36a6d | 13 | if (MsTimerInterval(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 | } |