Infineon / XMC-for-Arduino

Integration of Infineon's XMC microcontrollers into the Arduino IDE.
Other
106 stars 67 forks source link

GPIO Init after USIC CH Start #237

Closed 9Volts9er closed 1 year ago

9Volts9er commented 1 year ago

Put the GPIO_Init() after CH_Start for SPI, I2C and HardwareSerial in order to avoid false pulses as described in issue #234

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 ---

Description With this PR the GPIO_Init() functions are moved after XMC_CH_Start() of I2C, SPI and HardwareSerial. This solves the issue #234 with wrong pulses output on the communication lines. Also in the respective end() functions

Related Issue

234

9Volts9er commented 1 year ago

See also PR #238

techpaul commented 1 year ago

Only thing missed is that SPI has THREE pins you forgot to move the SCLK pin init call in HW_SPI.cpp

9Volts9er commented 1 year ago

Ah, you are absolutely right of course, I've overlooked this. With the latest commit I moved also the GPIO_Init() of the SCLK pin below the SPI_CH_Start(). So this should be fine now.

boramonideep commented 1 year ago

Thanks @9Volts9er for the code changes and @techpaul for the review.