Skip to content

Cypress: Add implementation of free() for gpio #11830

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions targets/TARGET_Cypress/TARGET_PSOC6/cy_analogin_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ uint16_t analogin_read_u16(analogin_t *obj)
return cyhal_adc_read_u16(&(obj->hal_adc_channel));
}

void analogin_free(analogin_t *obj)
{
cyhal_adc_channel_free(&(obj->hal_adc_channel));
cyhal_adc_free(obj->hal_adc);
}

const PinMap *analogin_pinmap(void)
{
return PinMap_ADC;
Expand Down
5 changes: 5 additions & 0 deletions targets/TARGET_Cypress/TARGET_PSOC6/cy_gpio_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ void gpio_dir(gpio_t *obj, PinDirection direction)
apply_config(obj);
}

void gpio_free(gpio_t *obj)
{
cyhal_gpio_free(obj->pin);
}

#ifdef __cplusplus
}
#endif
6 changes: 6 additions & 0 deletions targets/TARGET_Cypress/TARGET_PSOC6/cy_i2c_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,12 @@ void i2c_abort_asynch(i2c_t *obj)
}
}

void i2c_free(i2c_t *obj)
{
struct i2c_s *i2c = cy_get_i2c(obj);
cyhal_i2c_free(&i2c->hal_i2c);
}

#endif

#ifdef __cplusplus
Expand Down