Ported from master to next:

#1489: TRACE() output intercepted and shown in Companion (shortcut F6)
#1270: simple Trainer Simulator (shortcut F5)
#1466: telemetry simulator (shorcut F5)
This commit is contained in:
Damjan Adamic
2015-01-04 20:07:39 +01:00
parent a2dc0040b0
commit bb921a0a7f
39 changed files with 865 additions and 96 deletions
+5 -5
View File
@@ -159,7 +159,7 @@ void simuSetKey(uint8_t key, bool state)
void simuSetTrim(uint8_t trim, bool state)
{
// printf("trim=%d state=%d\n", trim, state); fflush(stdout);
// TRACE("trim=%d state=%d", trim, state);
switch (trim) {
TRIM_CASE(0, GPIO_TRIM_LH_L, PIN_TRIM_LH_L)
@@ -176,7 +176,7 @@ void simuSetTrim(uint8_t trim, bool state)
// TODO use a better numbering to allow google tests to work on Taranis
void simuSetSwitch(uint8_t swtch, int8_t state)
{
// printf("swtch=%d state=%d\n", swtch, state); fflush(stdout);
// TRACE("swtch=%d state=%d", swtch, state);
switch (swtch) {
#if defined(PCBTARANIS) && defined(REV9E)
SWITCH_3_CASE(0, GPIO_PIN_SW_A_L, GPIO_PIN_SW_A_H, PIN_SW_A_L, PIN_SW_A_H)
@@ -443,7 +443,7 @@ void eeprom_read_block (void *pointer_ram, const void *pointer_eeprom, size_t si
assert(size);
if (fp) {
// printf("EEPROM read (pos=%d, size=%d)\n", pointer_eeprom, size); fflush(stdout);
// TRACE("EEPROM read (pos=%d, size=%d)", pointer_eeprom, size);
if (fseek(fp, (long)pointer_eeprom, SEEK_SET)==-1) perror("error in fseek");
if (fread(pointer_ram, size, 1, fp) <= 0) perror("error in fread");
}
@@ -458,7 +458,7 @@ void eeWriteBlockCmp(const void *pointer_ram, uint16_t pointer_eeprom, size_t si
assert(size);
if (fp) {
// printf("EEPROM write (pos=%d, size=%d)\n", pointer_eeprom, size); fflush(stdout);
// TRACE("EEPROM write (pos=%d, size=%d)", pointer_eeprom, size);
if (fseek(fp, (long)pointer_eeprom, SEEK_SET)==-1) perror("error in fseek");
if (fwrite(pointer_ram, size, 1, fp) <= 0) perror("error in fwrite");
}
@@ -623,7 +623,7 @@ FRESULT f_readdir (DIR * rep, FILINFO * fil)
FRESULT f_mkfs (const TCHAR *path, BYTE, UINT)
{
printf("Format SD...\n"); fflush(stdout);
TRACE("Format SD...");
return FR_OK;
}