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
- Committer:
- andrewboyson
- Date:
- 2020-04-02
- Revision:
- 167:3ba4e3c49631
- Parent:
- 133:a37eb35a03f1
File content as of revision 167:3ba4e3c49631:
#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 (MsTimerRelative(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
}