X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=ao-tools%2Fao-sky-flash%2Fsky_serial.c;h=e56ab9238176b45047a8b0dd4345f8641ad93b54;hb=63a44b9c169d042fb1a3997620477e7f00bb0918;hp=7230bf8c194a9dbc48f367ea737637363978f877;hpb=b26e837a6f18641aae9372aab22168849ff10812;p=fw%2Faltos diff --git a/ao-tools/ao-sky-flash/sky_serial.c b/ao-tools/ao-sky-flash/sky_serial.c index 7230bf8c..e56ab923 100644 --- a/ao-tools/ao-sky-flash/sky_serial.c +++ b/ao-tools/ao-sky-flash/sky_serial.c @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define _BSD_SOURCE +#define _DEFAULT_SOURCE 1 #include #include #include @@ -97,11 +98,10 @@ skytraq_open(const char *path) #define US_PER_CHAR (1000000 / BPS) int -skytraq_write(int fd, const char *data, int len) +skytraq_write(int fd, const void *d, int len) { - const char *d = data; + const char *data = d; int r; - int us; skytraq_dbg_printf (0, "%4d: ", len); if (len < 70) @@ -115,7 +115,6 @@ skytraq_write(int fd, const char *data, int len) r = write(fd, data, this_time); if (r <= 0) return r; - us = r * US_PER_CHAR; usleep(r * US_PER_CHAR); data += r; len -= r; @@ -131,7 +130,7 @@ skytraq_setcomm(int fd, int baudrate) int i; uint8_t cksum; - int target_baudrate; + int target_baudrate = 0; switch(baudrate) { case 4800: