-
Notifications
You must be signed in to change notification settings - Fork 3
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
ports/psoc6: Adding deinit to pin and adc machine classes. #95
Conversation
Signed-off-by: enriquezgarc <enriquezgarcia.external@infineon.com>
b9648c8
to
87a90d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good to me!
Just a concern - if a physical pin deinit is done in respective module (for example let's say ADC), then again deiniting it from main has an additional affect? Currently does it check if module using the phy pin has already deinited and if not only then do from also main,c or is it not needed to consider that?
adcblock_deinit(); | ||
mod_pin_deinit(); | ||
mod_adc_block_deinit(); | ||
mod_pin_phy_deinit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it matter the order in which you de-init?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really. But pin_phy_deinit() is actually redundant, as the others should have taken care of that.
@@ -23,6 +23,39 @@ const adc_block_channel_pin_map_t adc_block_pin_map[] = { | |||
/******************************************************************************/ | |||
// MicroPython bindings for machine.ADC | |||
|
|||
// Private helper function to get channel number for provided pin | |||
int16_t _get_adc_channel_number_for_pin(uint32_t pin) { | |||
for (int i = 0; i < (sizeof(adc_block_pin_map) / sizeof(adc_block_pin_map[0])); i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adc_block_pin_map has "PIN_P10_0". This needs to be changed no as the definition is no more available or?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we have to check that according to how we integrate that part :)
The module deinit when soft reseting will take care of deiniting every instance that was not deinited explicitly. |
Signed-off-by: enriquezgarc <enriquezgarcia.external@infineon.com>
Signed-off-by: enriquezgarc <enriquezgarcia.external@infineon.com>
Signed-off-by: enriquezgarc <enriquezgarcia.external@infineon.com>
Signed-off-by: enriquezgarc <enriquezgarcia.external@infineon.com>
Signed-off-by: enriquezgarc <enriquezgarcia.external@infineon.com>
Signed-off-by: enriquezgarc <enriquezgarcia.external@infineon.com>
Signed-off-by: enriquezgarc <enriquezgarcia.external@infineon.com>
By creating this pull request you agree to the terms in CONTRIBUTING.md.
https://github.com/Infineon/.github/blob/master/CONTRIBUTING.md
--- DO NOT DELETE ANYTHING ABOVE THIS LINE ---
CONTRIBUTING.md also tells you what to expect in the PR process.
This PR will change the destination branch after #94 is merged. Please, review the other one first.
Description