Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: oldheating gps motorhome heating
link/jack.c@167:3ba4e3c49631, 2020-04-02 (annotated)
- Committer:
- andrewboyson
- Date:
- Thu Apr 02 19:08:25 2020 +0000
- Revision:
- 167:3ba4e3c49631
- Parent:
- 133:a37eb35a03f1
Modified resolution cache ajaxs to include the index
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 | } |