Skip to content

Commit

Permalink
MHP30: GD32 doesnt implement analog mode (#1845)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralim authored Dec 19, 2023
1 parent 9d2f90b commit 8ea79e3
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions source/Core/BSP/MHP30/BSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,15 +292,9 @@ void setPlatePullup(bool pullingUp) {
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Pin = PLATE_SENSOR_PULLUP_Pin;
GPIO_InitStruct.Pull = GPIO_NOPULL;
if (pullingUp) {
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
HAL_GPIO_WritePin(PLATE_SENSOR_PULLUP_GPIO_Port, PLATE_SENSOR_PULLUP_Pin, GPIO_PIN_SET);
} else {
// Hi-z
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
HAL_GPIO_WritePin(PLATE_SENSOR_PULLUP_GPIO_Port, PLATE_SENSOR_PULLUP_Pin, GPIO_PIN_RESET);
}
GPIO_InitStruct.Mode = pullingUp ? GPIO_MODE_OUTPUT_PP : GPIO_MODE_INPUT;
HAL_GPIO_Init(PLATE_SENSOR_PULLUP_GPIO_Port, &GPIO_InitStruct);
HAL_GPIO_WritePin(PLATE_SENSOR_PULLUP_GPIO_Port, PLATE_SENSOR_PULLUP_Pin, pullingUp ? GPIO_PIN_SET : GPIO_PIN_RESET);
}

void performTipMeasurementStep(bool start) {
Expand Down

0 comments on commit 8ea79e3

Please sign in to comment.