Blink Link and Activity LED

Hi,

I’ve found the function in the NET+OS API reference NALedBlink() which is used to blink LEDs on my ConnectME 9210.

So far, the only LED I can get to blink is the green activity one at the network socket on the device itself, using BIT_2 as the ‘leds’ parameter of the function.

The problem with this is that any other network activity overrides the NALedBlink function and because of this, the LED appears to only blink with network activity, even though the NALedBlink function is still working.

Is there any way to temporarily disable this LED from its network activity function so as the effect of NALedBlink is visible?
And also, is it possible to use the other ‘link’ LED on the device with the NALedBlink function? I couldn’t find the parameter for it.

Thanks

The Link LED is tied to the Ethernet PHY, so you won’t be able to use it as a custom LED.

If you want to, only temporairly, disable the Ethernet blink LED you’d need to modify the ethernet driver in src/bsp/devices/common/ethernet/eth_netos.c : naEthLEDMarkActivity and put something around the call to “NALedOn(LED_ETHERNET);”

i.E. maybe something like (where my_custom_eth_disable is declared in root.c in global space, and is initially set to zero):

extern int my_custom_eth_disable;

void naEthLEDMarkActivity(void)
{
if(!my_custom_eth_disable)
{
NALedOn(LED_ETHERNET);
eth_activity_ttl = ETH_ACTIVITY_TTL;
}
}

I’m a bit confused with your post.
So should I, modify src/bsp/devices/common/ethernet/eth_netos.c and change it to:

extern int my_custom_eth_disable;

void naEthLEDMarkActivity(void)
{
if(!my_custom_eth_disable)
{
NALedOn(LED_ETHERNET);
eth_activity_ttl = ETH_ACTIVITY_TTL;
}
}

and then in root.c I will be able to acess the variable my_custom_eth_disable?

Are there any other includes I would need to place in root.c?

It sounds like you got it.

In root.c all you need is:

int my_custom_eth_disable = 0;

and then just change the my_custom_eth_disable to 1 to stop the LED from working.