mirror of https://github.com/rusefi/wideband.git
Integrate with TS interface
This commit is contained in:
parent
627e920e93
commit
afa517e2d5
|
@ -9,6 +9,10 @@
|
|||
#include "port.h"
|
||||
#include "io_pins.h"
|
||||
|
||||
#if 1 /* tunerstudio */
|
||||
#include "livedata.h"
|
||||
#endif
|
||||
|
||||
// Stored results
|
||||
static float nernstAcHi = 0;
|
||||
static float nernstAcLo = 0;
|
||||
|
@ -151,6 +155,10 @@ static void SamplingThread(void*)
|
|||
}
|
||||
state = next_state;
|
||||
|
||||
/* tunerstudio */
|
||||
#if 1
|
||||
SamplingUpdateLiveData();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,12 @@
|
|||
#include "fault.h"
|
||||
#include "uart.h"
|
||||
|
||||
#include "tunerstudio.h"
|
||||
#include "tunerstudio_io.h"
|
||||
#include "wideband_board_config.h"
|
||||
|
||||
#if 0
|
||||
|
||||
static const UARTConfig uartCfg =
|
||||
{
|
||||
.txend1_cb = nullptr,
|
||||
|
@ -55,10 +61,35 @@ static void UartThread(void*)
|
|||
chThdSleepMilliseconds(50);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TS_PRIMARY_UART_PORT
|
||||
static UartTsChannel primaryChannel(TS_PRIMARY_UART_PORT);
|
||||
#endif
|
||||
|
||||
#ifdef TS_PRIMARY_SERIAL_PORT
|
||||
static SerialTsChannel primaryChannel(TS_PRIMARY_SERIAL_PORT);
|
||||
#endif
|
||||
|
||||
struct PrimaryChannelThread : public TunerstudioThread {
|
||||
PrimaryChannelThread() : TunerstudioThread("Primary TS Channel") { }
|
||||
|
||||
TsChannelBase* setupChannel() {
|
||||
primaryChannel.start(TS_PRIMARY_BAUDRATE);
|
||||
|
||||
return &primaryChannel;
|
||||
}
|
||||
};
|
||||
|
||||
static PrimaryChannelThread primaryChannelThread;
|
||||
|
||||
void InitUart()
|
||||
{
|
||||
#if 0
|
||||
uartStart(&UARTD1, &uartCfg);
|
||||
|
||||
chThdCreateStatic(waUartThread, sizeof(waUartThread), NORMALPRIO, UartThread, nullptr);
|
||||
#else
|
||||
primaryChannelThread.Start();
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue