On Fri, 2019-03-08 at 07:26 -0300, Isaac M. Bavaresco wrote: > The 'while' you mentioned in the code is indeed just an empty loop and th= e > braces around the following block are justisleading. Bad code but not muc= h > different than a lot around. I find that sort of thing horribly misleading. When I have an empty loop I always put the semicolon on its own line. The extra set of braces makes it even more misleading. But then, C is often referred to as a "write-only language" because nobody can read it. Apparently the author wanted to prove that point. I would have said: // for interrupt based if (*pflag =3D=3D I2C1_MESSAGE_PENDING) { // Block while master busy while(i2c1_state !=3D S_MASTER_IDLE) ; // force the task to run since we know that the queue has // something that needs to be sent PIR1bits.SSP1IF =3D true; }=20 --McD --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .