]> git.karo-electronics.de Git - oswald.git/blobdiff - ui/oswald-ui.c
Fix alarm not confirmable, enhance GTK simulation diplay for charge state,
[oswald.git] / ui / oswald-ui.c
index 29e15fd461cc2c7432f973a691aa445a5dca86ef..5cb5437508220080144a635f78c348f17b27b350 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;
 }