Fix alarm not confirmable, enhance GTK simulation diplay for charge state,
authorNils Faerber <nils.faerber@kernelconcepts.de>
Mon, 6 May 2013 11:12:37 +0000 (13:12 +0200)
committerNils Faerber <nils.faerber@kernelconcepts.de>
Mon, 6 May 2013 11:12:37 +0000 (13:12 +0200)
fix RTC time handling

ui/oswald-ui.c
ui/oswald_screens.c

index 29e15fd..5cb5437 100644 (file)
@@ -119,7 +119,7 @@ void hal_accelerometer_enable(void)
 
 void hal_accelerometer_disable(void)
 {
-       g_printerr("accel enable\n");
+       g_printerr("accel disable\n");
        gtk_widget_set_sensitive(ui_g->x_sc, FALSE);
        gtk_widget_set_sensitive(ui_g->y_sc, FALSE);
        gtk_widget_set_sensitive(ui_g->z_sc, FALSE);
@@ -445,8 +445,10 @@ void hal_get_rtc(clock_state *rtc)
        rtc->minute = mtime.tm_min;
        rtc->second = mtime.tm_sec;
        rtc->day = mtime.tm_mday;
+       rtc->wday = mtime.tm_wday;
        rtc->month = (mtime.tm_mon + 1);
        rtc->year = (mtime.tm_year + 1900);
+       
 }
 
 void hal_set_rtc(const clock_state *rtc, boolean set_set)
@@ -455,6 +457,10 @@ void hal_set_rtc(const clock_state *rtc, boolean set_set)
 
 void hal_get_power_state(power_state *pwr)
 {
+       pwr->source = POWER_SOURCE_EXTERNAL;
+       pwr->charge_state = POWER_CHARGER_CHARGING;
+       pwr->percent = 50;
+       pwr->level = 3242; // mV
 }
 
 static boolean BacklightState = FALSE;
@@ -471,15 +477,18 @@ boolean hal_lcd_get_backlight(void)
        return BacklightState;
 }
 
+static boolean VibrationState = FALSE;
 
 /* sets the vibration motor on/off, on=TRUE, off=FALSE */
 void hal_vibration_set_state(boolean state)
 {
+       g_print("turn vibration %s\n", state ? "on" : "off");
+       VibrationState = state;
 }
 
 boolean hal_vibration_get_state(void)
 {
-       return FALSE;
+       return VibrationState;
 }
 
 
index c079e44..b6f5f05 100644 (file)
@@ -853,8 +853,7 @@ event_ret_t alarm_handle_events(uint16_t event, void *data)
                        break;
                case EVENT_USER_BUTTONS:
                        dbg_out("button event %d\n", *(int *)data);
-                       // hal_lcd_set_backlight(FALSE);
-                       return EVENT_RET_HANDLED;
+                       return EVENT_RET_UNHANDLED;
                        break;
                case EVENT_HALF_SEC_TIMER:
                        hal_lcd_set_backlight(!hal_lcd_get_backlight());