added light sensor configuration to 1boot

This commit is contained in:
schneider 2011-12-20 01:30:24 +01:00
parent 5f584adb82
commit f10cc6798e
1 changed files with 27 additions and 0 deletions

View File

@ -21,6 +21,15 @@ static const struct MENU submenu_privacy={ "Privacy?", {
{NULL,NULL} {NULL,NULL}
}}; }};
static void yellow();
static void green();
static const char colors[][12] = {"0-yellow","1-green"};
bool color_set;
static const struct MENU submenu_color={ "r0ket color?", {
{ colors[0], &yellow},
{ colors[1], &green},
{NULL,NULL}
}};
void ram(void){ void ram(void){
@ -28,10 +37,16 @@ void ram(void){
menuflags|=(MENU_JUSTONCE|MENU_BIG); menuflags|=(MENU_JUSTONCE|MENU_BIG);
screen_intro(); screen_intro();
while (again) { while (again) {
color_set = false;
while (!color_set) {
handleMenu(&submenu_color);
}
privacy_set = false; privacy_set = false;
while (!privacy_set) { while (!privacy_set) {
handleMenu(&submenu_privacy); handleMenu(&submenu_privacy);
} }
input("Nickname?", GLOBAL(nickname), 32, 127, MAXNICK-1); input("Nickname?", GLOBAL(nickname), 32, 127, MAXNICK-1);
getInputWaitRelease(); getInputWaitRelease();
again = screen_overview(); again = screen_overview();
@ -41,6 +56,18 @@ void ram(void){
saveConfig(); saveConfig();
}; };
static void green() {
GLOBAL(daytrig) = 155;
GLOBAL(daytrighyst) = 10;
color_set = true;
}
static void yellow() {
GLOBAL(daytrig) = 160;
GLOBAL(daytrighyst) = 15;
color_set = true;
}
static void privacy0() { static void privacy0() {
set_privacy(0); set_privacy(0);
} }