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@140:9000ea70b220, 2019-04-10 (annotated)
- Committer:
- andrewboyson
- Date:
- Wed Apr 10 10:07:06 2019 +0000
- Revision:
- 140:9000ea70b220
- Parent:
- 133:a37eb35a03f1
Added ajax functions to AR4, AR6, NR4, NR6 modules
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 | 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 | } |