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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ uint32_t readKeys()
|
||||
result |= 0x02 << KEY_MENU;
|
||||
#endif
|
||||
|
||||
// printf("readKeys(): %x => %x\n", x, result); fflush(stdout);
|
||||
// TRACE("readKeys(): %x => %x", x, result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -181,8 +181,10 @@ uint32_t telemetryTransmitPending()
|
||||
|
||||
void telemetryPortInit(uint32_t baudrate)
|
||||
{
|
||||
#if !defined(SIMU)
|
||||
UART2_Configure(baudrate, Master_frequency);
|
||||
startPdcUsartReceive();
|
||||
#endif
|
||||
}
|
||||
|
||||
void telemetryTransmitBuffer(uint8_t * buffer, uint32_t size)
|
||||
|
||||
@@ -41,7 +41,7 @@ struct t_voice Voice ;
|
||||
void pushPrompt(uint16_t value)
|
||||
{
|
||||
#ifdef SIMU
|
||||
printf("playFile(\"%04d.ad4\")\n", value); fflush(stdout);
|
||||
TRACE("playFile(\"%04d.ad4\")", value);
|
||||
#endif
|
||||
|
||||
struct t_voice *vptr;
|
||||
|
||||
@@ -72,7 +72,7 @@ uint32_t readKeys()
|
||||
if (d & PIN_BUTTON_EXIT)
|
||||
result |= 0x02 << KEY_EXIT;
|
||||
|
||||
// printf("readKeys(): %x %x => %x\n", d, e, result); fflush(stdout);
|
||||
// TRACE("readKeys(): %x %x => %x", d, e, result);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -112,7 +112,7 @@ uint32_t readTrims()
|
||||
if (~c & PIN_TRIM_RH_R)
|
||||
result |= 0x80; // RH_R
|
||||
|
||||
// printf("readTrims(): %x %x => %x\n", c, e, result); fflush(stdout);
|
||||
// TRACE("readTrims(): %x %x => %x", c, e, result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user