Which one of the following is preferrable and why when writing C macro?
Type 1
#define I2C_START() I2C_WAIT_IDLE(); SSP1CON2bits.SEN = 1
Type 2
#define I2C_START() \
do \
{ \
I2C_WAIT_IDLE(); \
SSP1CON2bits.SEN = 1; \
}while(0)
One of my colleagues prefers Type 1 while I prefer Type 2. So when both of us work in a project, both of the types are seen throughout the project.