Skip to content

Commit 1acecc8

Browse files
kl27z_microbit: Reduce board ID 100us timer delay to account for overhead.
1 parent 9ba34e2 commit 1acecc8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

source/board/microbitv2/microbitv2.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ static mb_version_t read_brd_rev_id(void) {
161161
tpmIsrFlag = false;
162162

163163
// 2. Charge capacitor for 100us
164-
/* Set timer period 100us*/
165-
TPM_SetTimerPeriod(TPM0, USEC_TO_COUNT(100U, tpm_source_clock));
164+
/* Set timer period slightly below 100us to account for overheads */
165+
TPM_SetTimerPeriod(TPM0, USEC_TO_COUNT(98U, tpm_source_clock));
166166
// Drive BRD_REV_ID pin to high
167167
GPIO_PortSet(PIN_BOARD_REV_ID_GPIO, PIN_BOARD_REV_ID);
168168
// Add a ~100us delay
@@ -195,8 +195,7 @@ static mb_version_t read_brd_rev_id(void) {
195195
board_version = BOARD_VERSION_2_DEF;
196196
}
197197

198-
return BOARD_VERSION_2_0;
199-
//return board_version;
198+
return board_version;
200199
}
201200

202201
#elif defined(INTERFACE_NRF52820)

0 commit comments

Comments
 (0)