led driver
This commit is contained in:
@@ -21,10 +21,17 @@ struct thread_context tc_1;
|
||||
|
||||
void task1(void *arg)
|
||||
{
|
||||
char rd = '0';
|
||||
open(&led_4);
|
||||
write(&led_4, 0, 1);
|
||||
write(&led_4, &rd, 1);
|
||||
while(1) {
|
||||
sleep_ms(1000);
|
||||
read(&led_4, &rd, 1);
|
||||
if(rd == '0')
|
||||
rd = '1';
|
||||
else
|
||||
rd = '0';
|
||||
write(&led_4, &rd, 1);
|
||||
write(&uart_1, "Driver test\r\n", 13);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user