DISTORTEC / distortos

object-oriented C++ RTOS for microcontrollers
https://distortos.org/
Mozilla Public License 2.0
434 stars 67 forks source link

Combined interrupts for USART4 and USART5 #34

Closed CezaryGapinski closed 7 years ago

CezaryGapinski commented 7 years ago

Some of the microcontrollers (like in STM32L0's familly) have common interrupt for USART4 and USART5. Patch to fix thiss issue is here: https://github.com/CezaryGapinski/distortos/commit/484cca388ef287ba487c4fe44bbe78a6cefc6648

Change is on my develop branch for STM32L0, but I think that will be easy to get "cherry-pick" from this commit to the new branch direct from "master" branch, but I would like to ask you what do you thinking about that changes?

FreddieChopin commented 7 years ago

Please ignore what I wrote before (;

FreddieChopin commented 7 years ago

I think the change is OK. We don't have to cherry-pick it to the master now - it can stay in your STM32L0 branch and get merged together with the rest of the changes. Unless you want to make your branch shorter? Just let me know if you do and I'll cherry-pick this patch in the evening.

CezaryGapinski commented 7 years ago

There is no problem to leave it on my branch. I would like just change the sequence of last two commits and put "Add support for USARTv2 to STM32L0's Kconfig menus" on "Add combined interrupts for USART4-5 in USARTv2". That is more logic sequence in my opinion, because then select CHIP_STM32_USARTV2_USART4_USART5_COMBINED_INTERRUPT if CHIP_STM32L07 || CHIP_STM32L08 condition in Kconfig-stm32ChipFamilyChoices won't cause confusion and is the result of previous changes.

I tested the USART driver with your test program and looks like it also works fine ;).

FreddieChopin commented 7 years ago

Sure, change the order to make the sequence of changes more logical - it would be indeed wrong (or at least very confusing) to implement in first commit something which depends on the code introduced in second commit.