diff options
Diffstat (limited to 'boot.c')
-rw-r--r-- | boot.c | 58 |
1 files changed, 2 insertions, 56 deletions
@@ -20,49 +20,10 @@ #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> -#include <termios.h> #include <stdlib.h> -#include <sahara.h> -#include <i9305.h> - -int configure_tty(int *tty_fd, time_t timeout_sec, long int timeout_usec) -{ - int tty_dev; - struct termios termios; - struct timeval timeout; - fd_set fds; - int rc; - - tty_dev = open(TTY_DEVICE, O_RDWR | O_SYNC); - if (tty_dev < 0) { - printf("failed to open modem tty device\n"); - return -1; - } else { - printf("opened modem tty device\n"); - } - - tcgetattr(tty_dev, &termios); - cfmakeraw(&termios); - cfsetispeed(&termios, B9600); - cfsetospeed(&termios, B9600); - tcsetattr(tty_dev, TCSANOW, &termios); - - FD_ZERO(&fds); - FD_SET(tty_dev, &fds); - timeout.tv_sec = timeout_sec; - timeout.tv_usec = timeout_usec; - - rc = select(tty_dev+1, &fds, NULL, NULL, &timeout); - if (rc <= 0) { - printf("failed waiting to read\n"); - return -1; - } - - *tty_fd = tty_dev; - - return 0; -} +#include "sahara.h" +#include "i9305.h" int main() { @@ -132,20 +93,5 @@ int main() else printf("error: cdc-wdm device does not exist\n"); - printf("\nconfiguring EFS sync\n"); - - rc = configure_tty(&tty_dev, 0, 500000); - if (rc < 0) { - printf("failed to configure serial interface\n"); - } - - while (1) { - rc = handle_memory_debug(tty_dev); - if (rc < 0) { - printf("error during modem operation\n"); - return -1; - } - } - return 0; } |