led driver

This commit is contained in:
tkl
2016-07-27 16:28:46 +02:00
parent cdb315da32
commit f4bc903172
2 changed files with 9 additions and 2 deletions

View File

@@ -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);
}
}