[tuxdroid-svn] r223 - svnlook: warning: cannot set LC_CTYPE locale svnlook: warning: environment va
Status: Beta
Brought to you by:
ks156
From: svnlook:warning@affinitic.be:cannot s. L. l. <c2m...@c2...> - 2007-04-03 20:15:20
|
Author: svnlook: warning: cannot set LC_CTYPE locale Date: svnlook: warning: environment variable LANG is EN New Revision: 223 Modified: firmware/tuxdefs/commands.h firmware/tuxup/trunk/main.c Log: jaguarondi 2007-04-03 22:15:14 +0200 (Tue, 03 Apr 2007) 261 - UPD: Added a version_bf_t type equal to the previous version_t with the bitfied, this is more convenient to use inside a single program. - UPD: when an hex file isn't found, exit after the access error instead of reporting that the hex file is not supported. svnlook: warning: cannot set LC_CTYPE locale svnlook: warning: environment variable LANG is EN svnlook: warning: please check that your locale name is correct Modified: firmware/tuxdefs/commands.h =================================================================== --- firmware/tuxdefs/commands.h 2007-04-03 18:28:01 UTC (rev 222) +++ firmware/tuxdefs/commands.h 2007-04-03 20:15:14 UTC (rev 223) @@ -92,9 +92,27 @@ #define INFO_FUXUSB_CMD 0x06 #define VERSION_CMD 0xC8 +/* + * This version_bf_t type can't be used to send the bytes over a channel as the + * order of the bits in the bitfield may be freely rearranged by GCC. + */ typedef struct { uint8_t version_cmd; + uint8_t cpu_nbr :3; /* 3 lower bits are the CPU number */ + uint8_t ver_major :5; /* 5 higher bits are the major version number */ + uint8_t ver_minor; + uint8_t ver_update; +} version_bf_t; + +/* + * This version_t type should be used to send the bytes over a channel such as + * USB or TCP-IP. Use the macros to set or retrieve values of the cpu_ver_maj + * byte. + */ +typedef struct +{ + uint8_t version_cmd; uint8_t cpu_ver_maj; /* 3 lower bits are the CPU number, 5 higher bits are the major version number */ uint8_t ver_minor; uint8_t ver_update; Modified: firmware/tuxup/trunk/main.c =================================================================== --- firmware/tuxup/trunk/main.c 2007-04-03 18:28:01 UTC (rev 222) +++ firmware/tuxup/trunk/main.c 2007-04-03 20:15:14 UTC (rev 223) @@ -171,7 +171,7 @@ * from the hex file and returns 0 if the hex file has a cpu and version * numbers, 1 otherwise. */ -int check_hex_file(char *filename, version_t* version) +int check_hex_file(char *filename, version_bf_t* version) { FILE *fs = NULL; char word[80]; @@ -180,8 +180,8 @@ hex_nr[2]=(char)'\0'; if ((fs = fopen(filename, "r")) == NULL) { - fprintf(stderr, "Unable to open file '%s' for reading", filename); - return 1; + fprintf(stderr, "Unable to open file '%s' for reading\n", filename); + exit(1); } while( fscanf( fs, " %s", word)!=EOF) @@ -205,7 +205,7 @@ int prog_flash(char *filename) { - version_t version; + version_bf_t version; uint8_t cpu_i2c_addr; /* Connect the dongle. */ |