Native SENT TPS input #5079

only:mre_f4
This commit is contained in:
rusefi 2023-03-01 15:47:37 -05:00
parent 68fee9905f
commit d7778b258d
2 changed files with 7 additions and 10 deletions

View File

@ -284,8 +284,7 @@ int sent_channel::GetMsg(uint32_t* rx) {
return 0;
}
int sent_channel::GetSignals(uint8_t *pStat, uint16_t *pSig0, uint16_t *pSig1)
{
int sent_channel::GetSignals(uint8_t *pStat, uint16_t *pSig0, uint16_t *pSig1) {
uint32_t rx;
int ret = GetMsg(&rx);
@ -594,7 +593,8 @@ static void printSentInfo() {
for (int i = 0; i < SENT_CHANNELS_NUM; i++) {
sent_channel &ch = channels[i];
efiPrintf("---- SENT ch %d ----", i);
const char * pinName = getBoardSpecificPinName(engineConfiguration->sentInputPins[i]);
efiPrintf("---- SENT ch %d ---- on %s", i, pinName);
ch.Info();
efiPrintf("--------------------");
}
@ -630,8 +630,7 @@ int getSentValues(size_t index, uint16_t *sig0, uint16_t *sig1) {
}
/* Should be called once */
void initSent(void)
{
void initSent(void) {
/* init interval mailbox */
chMBObjectInit(&sent_mb, sent_mb_buffer, SENT_MB_SIZE);

View File

@ -47,8 +47,7 @@ static ICUConfig icucfg[SENT_INPUT_COUNT] =
}
};
void startSent()
{
void startSent() {
for (int i = 0; i < SENT_INPUT_COUNT; i++) {
brain_input_pin_e sentPin = engineConfiguration->sentInputPins[i];
@ -63,7 +62,7 @@ void startSent()
if (getIcuParams(sentPin, &pinAF, &icu, &cfg->channel, &baseClock) != true) {
/* this pin has no ICU functionality, of ICU driver is not enabled for TIM on this pin */
/* throw error? */
firmwareError(OBD_PCM_Processor_Fault, "No ICU on selected SENT pin");
continue;
}
@ -75,8 +74,7 @@ void startSent()
}
}
void stopSent()
{
void stopSent() {
for (int i = 0; i < SENT_INPUT_COUNT; i++) {
brain_input_pin_e sentPin = activeConfiguration.sentInputPins[i];