stm32f1xx-hal
                                
                                 stm32f1xx-hal copied to clipboard
                                
                                    stm32f1xx-hal copied to clipboard
                            
                            
                            
                        Use modify instead of write for clearing sr1
As per the discussion in #282
This seems better, but it also leaves the possibility of some flags not being cleared if multiple flags are raised at the same time. Is that something that can even happen, and how should we deal with it then?
CC: @Disasm
I think that all errors should be additionally cleared before a transaction begins.
I think this code is not optimal. You read sr1 twice. Before comparison and when do modify.
Updated the PR with the suggested changes, status flags should now be cleared before starting a new transaction, and only the error we actually noted is cleared.
I hope the unsafe I had to add is correct, writing to read only registers should have no effect.
We also don't have a way to read more than one error flag, perhaps that's something we should add at some point