Commit 343ce440 authored by Frater's avatar Frater
Browse files

Update LED.MD

parent 29f09200
......@@ -46,4 +46,35 @@ void SetLed(unsigned char ledid,unsigned char status)
SetLed(LED_1_GREEN, LED_STATUS_ON);
```
Notes:
In the CP's drivers, the LED were addressed in a funny ways:
```
int _SetLedState(int led,int state)
{
char led_id;
int ret;
char cmdRed [3];
char cmdGreen [3];
ret = -1;
if (led - 1U < 3)
{
led_id = (char)led * '\x02';
cmdRed[2] = (led_id + -1) * '\x10' | (byte)state & 1;
cmdGreen[2] = (led_id + -2) * '\x10' | (byte)((uint)state >> 1) & 1;
cmdGreen[0] = '\x1b';
cmdGreen[1] = 'L';
cmdRed[0] = '\x1b';
cmdRed[1] = 'L';
SendCommand(fd,cmdGreen,3);
SendCommand(fd,cmdRed,3);
ret = 0;
}
return ret;
}
```
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment