Confused by "if" statement in bootloader


hello,

still learning. trying understand bootloader code. understand registers are, don't understand going on in "if" statement. comparing value of 2 bytes, if equal returns true?

ch = mcusr;  
mcusr = 0;

if ((ch & _bv(wdrf))) app_start();

thanks,

-ren

no, "bitwise and" operator ("&"), typically used isolate particular bit of register.  in case, can read whole segment "if wdrf bit in mcusr register non-zero, start application."


Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Confused by "if" statement in bootloader


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums