]> git.karo-electronics.de Git - oswald.git/blobdiff - ui/oswald-ui.c
Some minor improvements.
[oswald.git] / ui / oswald-ui.c
index 29e15fd461cc2c7432f973a691aa445a5dca86ef..74d567623639739196deec588bf1c99278a9126d 100644 (file)
 
 static oswald_ui *ui_g;
 
-void hal_lcd_set_pixel(gint x, gint y, gboolean state)
+void hal_lcd_set_pixel(gint x, gint y, uint8_t state)
 {
        gint ix, iy;
 
        ix = x*2;
        iy = y*2;
 
+       // we double all pixel to get a bigger picture
        gdk_draw_point(GDK_DRAWABLE(ui_g->pixmap), state ? ui_g->darea->style->black_gc : ui_g->darea->style->white_gc, ix, iy);
        gdk_draw_point(GDK_DRAWABLE(ui_g->pixmap), state ? ui_g->darea->style->black_gc : ui_g->darea->style->white_gc, ix+1, iy);
        gdk_draw_point(GDK_DRAWABLE(ui_g->pixmap), state ? ui_g->darea->style->black_gc : ui_g->darea->style->white_gc, ix, iy+1);
@@ -119,7 +120,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 +446,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 +458,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,17 +478,25 @@ 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;
 }
 
+uint16_t hal_amblight_get_val(void)
+{
+        return 42;
+} 
+
 
 int main(int argc , char ** argv)
 {