Rockbox mail archiveSubject: Re: Question on Config block/user_settings
Re: Question on Config block/user_settings
From: Björn Stenberg <bjorn_at_haxx.se>
Date: Fri, 25 Apr 2003 09:33:41 +0200
c s wrote:
> is the only requirement that
> the value of a bool variable be zero OR non-zero (as
> opposed to zero OR one).
Yes. True and false is defined as !0 and 0. This is valid for all C code, not just boolean variables.
> Is there an error
> in the settings code or am I missing something?
Looks good to me:
Save - The caption boolean is converted to bit 1 of byte 0xAE:
config_block[0xae] = (unsigned char)
((global_settings.fade_on_stop & 1) |
((global_settings.caption_backlight & 1) << 1));
Load - Bit 1 of byte 0xAE is converted to the caption boolean:
global_settings.caption_backlight = config_block[0xae] & 2;
-- BjörnReceived on 2003-04-25