tests: Add two devices test

This commit is contained in:
sheinz 2016-08-19 01:23:26 +03:00
parent 5ace1c5bff
commit 33d695ec83
11 changed files with 277 additions and 10 deletions

View file

@ -23,5 +23,35 @@
*/
#include "test.h"
#include <string.h>
#include "task.h"
#include "esp/uart.h"
bool test_result = true;
void test_init(uint32_t timeout)
{
char buf[256];
int data_len = 0;
buf[data_len] = 0;
uart_set_baud(0, 115200);
while (true) {
int c = getchar();
if (c == EOF || c == '\n' || c == '\r') {
if (strcmp(buf, "START") == 0) {
break;
} else {
data_len = 0;
buf[data_len] = 0;
}
} else{
buf[data_len++] = c;
buf[data_len] = 0;
}
taskYIELD();
}
printf("TEST_INIT: TIMEOUT=%ds\n", timeout); \
}