Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7217

Device Tree • Re: bool parameters, config.txt and dtparam

$
0
0
Device Tree source compiles into a simple binary format that lacks type information - it's just arrays of bytes, and it's up to the reader to place an interpretation on it. Only properties which are being interpreted as booleans treat present (and usually empty) as true and absent as false. An empty property could also be interpreted as a zero-length array.

For integer and properties, "y", "yes", "on", "true" and "down" evaluate to 1, "n", "no", "off" and "false" evaluate to 0, and "up" is 2 (for the pull direction on a GPIO). For boolean properties, follow the integer conversions above, then non-zero becomes true and zero becomes false. Finally, if no value is assigned to an integer or boolean property, the default value of 1/true is assumed.

Statistics: Posted by PhilE — Fri Apr 25, 2025 8:31 am



Viewing all articles
Browse latest Browse all 7217