Skip to content

Commit

Permalink
Native SENT TPS input #5079
Browse files Browse the repository at this point in the history
only:mre_f4
  • Loading branch information
rusefillc committed Mar 1, 2023
1 parent 68fee99 commit d7778b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
9 changes: 4 additions & 5 deletions firmware/hw_layer/drivers/sent/sent.cpp
Expand Up @@ -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);

Expand Down Expand Up @@ -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("--------------------");
}
Expand Down Expand Up @@ -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);

Expand Down
8 changes: 3 additions & 5 deletions firmware/hw_layer/drivers/sent/sent_hw_icu.cpp
Expand Up @@ -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];

Expand All @@ -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;
}

Expand All @@ -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];

Expand Down

0 comments on commit d7778b2

Please sign in to comment.