[tuxdroid-svn] r621 - in firmware: fuxrf/trunk tuxrf/trunk
Status: Beta
Brought to you by:
ks156
From: jaguarondi <c2m...@c2...> - 2007-10-16 15:53:32
|
Author: jaguarondi Date: 2007-10-16 17:53:29 +0200 (Tue, 16 Oct 2007) New Revision: 621 Modified: firmware/fuxrf/trunk/device.c firmware/fuxrf/trunk/prot.c firmware/tuxrf/trunk/prot.c Log: * Increased the number of attempts to get a command through the RF, otherwise it fails at initialization. This needs some debugging. Modified: firmware/fuxrf/trunk/device.c =================================================================== --- firmware/fuxrf/trunk/device.c 2007-10-16 15:48:28 UTC (rev 620) +++ firmware/fuxrf/trunk/device.c 2007-10-16 15:53:29 UTC (rev 621) @@ -11,11 +11,20 @@ #include "version.h" /* + * Configuration + */ +/* Bootloader can be included with the program. */ +#define BOOTLOADER 1 +/* Include version numbers. */ +#define VERSIONING 1 + +/* * Version number */ #define CPU_NUMBER FUXRF_CPU_NUM /* sound CPU */ +#if (VERSIONING) /* XXX Add the linker script to have fixed version positions once the project will compile with latest gcc under linux. */ const author_t author __attribute__ ((section(".version"))) = { @@ -29,10 +38,8 @@ { VERSION_CMD, CPU_VER_JOIN(CPU_NUMBER, VER_MAJOR), VER_MINOR, VER_UPDATE, }; +#endif -/* Bootloader can be included with the program */ -#define BOOTLOADER 1 - #if (BOOTLOADER) #include "bootloader.h" #endif Modified: firmware/fuxrf/trunk/prot.c =================================================================== --- firmware/fuxrf/trunk/prot.c 2007-10-16 15:48:28 UTC (rev 620) +++ firmware/fuxrf/trunk/prot.c 2007-10-16 15:53:29 UTC (rev 621) @@ -200,7 +200,7 @@ *(pbuffer_tx + 23 + i) = commandBuffer[i]; *(pbuffer_tx + 17) |= 0x08; // Update header commandCmpt++; - if (commandCmpt == 25) + if (commandCmpt == 255) commandStatus = 0x03; // Command fail } else Modified: firmware/tuxrf/trunk/prot.c =================================================================== --- firmware/tuxrf/trunk/prot.c 2007-10-16 15:48:28 UTC (rev 620) +++ firmware/tuxrf/trunk/prot.c 2007-10-16 15:53:29 UTC (rev 621) @@ -98,7 +98,7 @@ if (*(prf_buffer_rx + 1) & 0x20) // Go out sleep { eeprom_write_byte(&ee_sleepMode, 0xFF); // Cancel the sleep mode - DDRD &= ~0x40; // Configure PORTD.6 as output + DDRD &= ~0x40; // Configure PORTD.6 as output XXX sounds like bugs here PORTD |= 0x40; // Send signal to wake up over CPU _delay_ms(300); // Wait 300 msec PORTD &= ~0x40; // Stop sending signal of wake up @@ -269,11 +269,15 @@ } commandBuffer[3] = 0x01; // RF ACK } + commandBuffer[3] = commandCmpt; /* XXX DEBUG add the number of attempts + before the command gets through */ for (i = 0; i < 4; i++) // Copy command into the frame *(pbuffer_tx + 23 + i) = commandBuffer[i]; *(pbuffer_tx + 17) |= 0x08; // Update header commandCmpt++; - if (commandCmpt == 25) + if (commandCmpt == 255) /* XXX changed to 255 otherwise this fails too + quickly when initializing, need some + debugging */ commandStatus = 0x03; // Command fail } else |