#Remove empty conditional blocks
Remove empty conditional blocks
Anytime you have a series of empty conditional blocks like this:
if (bcm2835_gpio_eds(B1)!=1) { } else{ }
You're better off removing it. It clutters the code, impedes readability and serves no purpose. Even if it's meant as some "TODO" it would be better if it were a comment instead of adding lines of code to scroll through and that exist in the compiler's evaluation.
Be consistent
###Be consistent OnOn the topic of readability, some places in your code your brackets are on the same line as the statement that precedes. While in others, the brackets are on the following line. This is the case even in the aforementioned code I quoted for a different reason.
Though there are C conventions whichever style you choose is up to you and what you find comfortable, but whatever that is: be consistent about it. Otherwise, It's distracting and adds additional noise that isn't conducive to digestion and understanding of the code which surrounds it. This also applies to your use of spacing and tabs.
Be consistent so the focus is on what tools you're using, and what you want to do rather than the several different ways you happen to hold your tools.