#include #include #include #include //#include #include "board.h" #include "mw.h" uint8_t cliMode; /* * Wrapper to test cli mode locally */ int main(int argc, char *argv[]) { setvbuf(stdin, NULL, _IONBF, 0); // fcntl(fileno(stdin), F_SETFL, O_NONBLOCK); system("stty raw -echo -ignbrk brkint"); cliMode = 0; cliProcess(); system("stty cooked echo"); exit(0); } void featureClear(uint32_t mask) { } void featureClearAll() { } void featureSet(uint32_t mask) { } void writeParams(void) { } void systemReset(bool toBootloader) { if (toBootloader) printf("Rebooting to bootloader...\r\n"); else printf("Rebooting...\r\n"); } uint8_t uartRead(void) { uint8_t c = 0; read(fileno(stdin), &c, 1); if (c == 3) { fprintf(stderr,"^C\r\n"); exit(1); } return c; } uint16_t uartAvailable(void) { int i = 1; // ioctl(fileno(stdin), FIONREAD, &i); return !!i; } void uartWrite(uint8_t ch) { write(fileno(stdout), &ch, 1); } void uartPrint(char *str) { write(fileno(stdout), str, strlen(str)); }