- disable usb vport

- uart drv for stm32f4
This commit is contained in:
tkl
2016-07-25 15:23:31 +02:00
parent f37cceafb8
commit 466f6fab86
12 changed files with 266 additions and 16 deletions

View File

@@ -27,14 +27,30 @@ void task1(void *arg)
while(1) {
sleep_ms(1000);
gpio_toggle(&led_1);
uart_write(&uart_1, "Hello world\r\n", 13);
}
}
char rx_buf[80];
void task2(void *arg)
{
while(1) {
int i = uart_read(&uart_1, rx_buf, 80);
if(i > 0) {
uart_write(&uart_1, rx_buf, i);
}
}
}
stack_t tc_2_stack[STACK_SIZE];
struct thread_context tc_2;
int main(void)
{
board_init();
sys_tick_init(&timer_1);
uart_open(&uart_1);
thread_create(&tc_1, tc_1_stack, STACK_SIZE, task1, NULL, THREAD_PRIO_LOW);
thread_create(&tc_2, tc_2_stack, STACK_SIZE, task2, NULL, THREAD_PRIO_LOW);
schedule_start();