only:milliseconds are evil, use timer
This commit is contained in:
parent
f28884363e
commit
32bcf469dc
|
@ -309,7 +309,8 @@ int detectHellenBoardId() {
|
||||||
int boardId = -1;
|
int boardId = -1;
|
||||||
#if defined( HELLEN_BOARD_ID_PIN_1) && !defined(HW_HELLEN_SKIP_BOARD_TYPE)
|
#if defined( HELLEN_BOARD_ID_PIN_1) && !defined(HW_HELLEN_SKIP_BOARD_TYPE)
|
||||||
efiPrintf("Starting Hellen Board ID detection...");
|
efiPrintf("Starting Hellen Board ID detection...");
|
||||||
efitick_t beginNt = getTimeNowNt();
|
Timer t;
|
||||||
|
t.reset();
|
||||||
|
|
||||||
const int numPins = 2;
|
const int numPins = 2;
|
||||||
Gpio rPins[numPins] = { HELLEN_BOARD_ID_PIN_1, HELLEN_BOARD_ID_PIN_2};
|
Gpio rPins[numPins] = { HELLEN_BOARD_ID_PIN_1, HELLEN_BOARD_ID_PIN_2};
|
||||||
|
@ -366,8 +367,7 @@ int detectHellenBoardId() {
|
||||||
palSetPadMode(getBrainPinPort(rPins[k]), getBrainPinIndex(rPins[k]), PAL_MODE_RESET);
|
palSetPadMode(getBrainPinPort(rPins[k]), getBrainPinIndex(rPins[k]), PAL_MODE_RESET);
|
||||||
}
|
}
|
||||||
|
|
||||||
efitick_t endNt = getTimeNowNt();
|
float elapsed_Ms = t.getElapsedSeconds() * 1000;
|
||||||
int elapsed_Ms = US2MS(NT2US(endNt - beginNt));
|
|
||||||
|
|
||||||
// Check that all resistors were actually detected
|
// Check that all resistors were actually detected
|
||||||
bool allRValid = true;
|
bool allRValid = true;
|
||||||
|
@ -382,7 +382,7 @@ int detectHellenBoardId() {
|
||||||
boardId = -1;
|
boardId = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
efiPrintf("* RESULT: BoardId = %d, R1 = %.0f, R2 = %.0f (Elapsed time: %d ms)", boardId, R[0], R[1], elapsed_Ms);
|
efiPrintf("* RESULT: BoardId = %d, R1 = %.0f, R2 = %.0f (Elapsed time: %.1f ms)", boardId, R[0], R[1], elapsed_Ms);
|
||||||
#endif /* HELLEN_BOARD_ID_PIN_1 */
|
#endif /* HELLEN_BOARD_ID_PIN_1 */
|
||||||
return boardId;
|
return boardId;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue