[tuxdroid-svn] r940 - firmware/tuxup/trunk
Status: Beta
Brought to you by:
ks156
From: jaguarondi <c2m...@c2...> - 2008-03-18 06:39:23
|
Author: jaguarondi Date: 2008-03-18 07:39:22 +0100 (Tue, 18 Mar 2008) New Revision: 940 Modified: firmware/tuxup/trunk/main.c Log: * Tuxup now also recognizes the version number of the USB hex file. Modified: firmware/tuxup/trunk/main.c =================================================================== --- firmware/tuxup/trunk/main.c 2008-03-17 05:34:42 UTC (rev 939) +++ firmware/tuxup/trunk/main.c 2008-03-18 06:39:22 UTC (rev 940) @@ -192,9 +192,11 @@ while (fscanf(fs, " %s", word) != EOF) { - /* look for the address 0EF0 or 1EF0 and the C8 version command */ + /* look for the address 0EF0 (RF) or 1EF0 (tuxcore and tuxaudio) + * or just :0C (USB) and the C8 version command */ if (!strncmp(word, ":0C0EF000C8", 11) - || !strncmp(word, ":0C1DF000C8", 11)) + || !strncmp(word, ":0C1DF000C8", 11) + || (!strncmp(word, ":0C", 3) && !strncmp(word+7, "00C804", 6))) { /* get cpu number and version number */ strncpy(hex_nr, &word[11], 2); @@ -312,9 +314,27 @@ uint8_t send_data[5] = { 0x01, 0x01, 0x00, 0x00, 0xFF }; char tmp_string[PATH_MAX]; int ret; + version_bf_t version; printf("Programming %s in the USB CPU\n", filename); + /* Retrieving version number */ + if (check_hex_file(filename, &version)) + { + printf("[FAIL] Programming of '%s' failed, this file is not a correct" + " hex file for that CPU\n\n", filename); + return 1; + } + + if (version.cpu_nbr != FUXUSB_CPU_NUM) + { + printf("Unrecognized CPU number, %s doesn't appear to be compiled" + " for a CPU of tuxdroid.\n", filename); + return 1; + } + printf("Version %d.%d.%d\n", version.ver_major, version.ver_minor, + version.ver_update); + if (pretend) return 0; |