I have a line of code here and I am trying to determine how the variable value is being calculated:
value |= gpio_get_value(IOMUX_TO_GPIO(MX51_PIN_EIM_A24)) ? 0 : 1;
I understand that a |= b; is just syntactic sugar for a = a | b; but what is happening with the mod operation at the end of the line? I am not sure what ? 0 : 1 is doing.
So value is being set to 0 or 1 by the 0 : 1 and not by the state of the gpio pin? In other words, it seems to be detecting if the pin exists and if it does it sets the value to a 1 and if it does not then it sets the value to 0, does that sound right?