Skip to content

Commit 4cf86dd

Browse files
committed
fix: Cygnet 3V3 Regulator Init
1 parent a91a1a2 commit 4cf86dd

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

variants/STM32L4xx/L433C(B-C)(T-U)_L443CC(T-U)/variant_CYGNET.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,20 @@ WEAK void initVariant(void)
109109
{
110110
__HAL_RCC_GPIOH_CLK_ENABLE();
111111
GPIO_InitTypeDef GPIO_InitStruct = {};
112-
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
113112
GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
114-
/* PH0 is ENABLE_3V3, PH1 is DISCHARGE_3V3 */
115-
GPIO_InitStruct.Pin = GPIO_PIN_0 | GPIO_PIN_1;
113+
114+
/* PH0 is ENABLE_3V3 */
115+
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
116+
GPIO_InitStruct.Pin = GPIO_PIN_0;
117+
HAL_GPIO_Init(GPIOH, &GPIO_InitStruct);
118+
119+
/* PH1 is DISCHARGE_3V3 */
120+
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD;
121+
GPIO_InitStruct.Pin = GPIO_PIN_1;
116122
HAL_GPIO_Init(GPIOH, &GPIO_InitStruct);
117123

118124
/* Enable 3V3 regulator and disable discharging */
119-
HAL_GPIO_WritePin(GPIOH, GPIO_InitStruct.Pin, GPIO_PIN_SET);
125+
HAL_GPIO_WritePin(GPIOH, (GPIO_PIN_0 | GPIO_PIN_1), GPIO_PIN_SET);
120126
}
121127
}
122128

0 commit comments

Comments
 (0)