Skip to content

Commit a1dd0bb

Browse files
authored
Fixes Deinit functions
1 parent ccedb0b commit a1dd0bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cores/esp32/esp32-hal-periman.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ bool perimanSetPinBus(uint8_t pin, peripheral_bus_type_t type, void * bus){
2929
log_e("Invalid type: %u", (unsigned int)type);
3030
return false;
3131
}
32-
if(type > ESP32_BUS_TYPE_GPIO && bus == NULL){
32+
if(type >= ESP32_BUS_TYPE_GPIO && bus == NULL){
3333
log_e("Bus is NULL");
3434
return false;
3535
}
@@ -39,7 +39,7 @@ bool perimanSetPinBus(uint8_t pin, peripheral_bus_type_t type, void * bus){
3939
log_i("Bus already set");
4040
return true;
4141
}
42-
if(obus != NULL){
42+
if(obus != NULL && type > ESP32_BUS_TYPE_INIT){
4343
if(deinit_functions[otype] == NULL){
4444
log_e("Bus does not have deinit function set");
4545
return false;

0 commit comments

Comments
 (0)