fixed the bug, caused by partly inited units trying to de-init pins

This commit is contained in:
2018-01-02 16:49:30 +01:00
parent 39ad4a8d28
commit 64592c3bb6
5 changed files with 30 additions and 22 deletions
+4 -2
View File
@@ -125,8 +125,10 @@ static void Npx_deInit(Unit *unit)
{
struct priv *priv = unit->data;
// configure the pin as analog
LL_GPIO_SetPinMode(priv->port, priv->ll_pin, LL_GPIO_MODE_ANALOG);
if (unit->status == E_SUCCESS) {
// configure the pin as analog
LL_GPIO_SetPinMode(priv->port, priv->ll_pin, LL_GPIO_MODE_ANALOG);
}
// Release all resources
rsc_teardown(unit);