Skip to content

Commit

Permalink
ports/psoc6/modules/machine/machine_adcblock: Fixed NULL prt.
Browse files Browse the repository at this point in the history
Signed-off-by: enriquezgarc <[email protected]>
  • Loading branch information
jaenrig-ifx committed Aug 1, 2023
1 parent 169ea15 commit dfcbadf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ports/psoc6/modules/machine/machine_adcblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,10 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(machine_adcblock_connect_obj, 2, machine_adcbl
void adcblock_deinit(void) {

for (uint8_t i = 0; i < MAX_BLOCKS; i++) {
cyhal_adc_free(&adc_block[i]->adc_block_obj);
adc_block[i] = NULL;
if (adc_block[i] != NULL) {
cyhal_adc_free(&adc_block[i]->adc_block_obj);
adc_block[i] = NULL;
}
}

}
Expand Down

0 comments on commit dfcbadf

Please sign in to comment.