X-Git-Url: https://git.karo-electronics.de/?p=oswald.git;a=blobdiff_plain;f=ui%2Foswald_screens.c;h=ddca03c2a861c2aa4fc3d82aa8da2f24d50247d2;hp=a16bf398699d87ba692beef508fd3a18e2562558;hb=16600ff42846105227c8a3cbb4f2b818ca41811d;hpb=1553c23cf33de5d8a193ffc8c7014cf826fc9fd3 diff --git a/ui/oswald_screens.c b/ui/oswald_screens.c index a16bf39..ddca03c 100644 --- a/ui/oswald_screens.c +++ b/ui/oswald_screens.c @@ -3,20 +3,46 @@ #include "oswald.h" #include "oswald_main.h" #include "oswald_watch_faces.h" -#include "Fonts.h" -#include "LcdDisplay.h" +#include "oswald_graphics.h" #include "oswald_hal.h" #include "oswald_screens.h" -#include "timesetup_icon.xbm" -#include "stopwatch_icon.xbm" -#include "alarm_icon.xbm" -#include "startstopbutton_icon.xbm" -#include "lapsebutton_icon.xbm" -#include "upbutton_icon.xbm" -#include "downbutton_icon.xbm" -#include "Bluetooth_icon.xbm" +#include "LcdDisplay.h" +#include "Fonts.h" + +#if defined(__GNUC__) && (__MSP430X__ > 0) +__attribute__((__far__)) +#endif +#include "bitmaps/timesetup_icon.xbm" +#if defined(__GNUC__) && (__MSP430X__ > 0) +__attribute__((__far__)) +#endif +#include "bitmaps/stopwatch_icon.xbm" +#if defined(__GNUC__) && (__MSP430X__ > 0) +__attribute__((__far__)) +#endif +#include "bitmaps/alarm_icon.xbm" +#if defined(__GNUC__) && (__MSP430X__ > 0) +__attribute__((__far__)) +#endif +#include "bitmaps/startstopbutton_icon.xbm" +#if defined(__GNUC__) && (__MSP430X__ > 0) +__attribute__((__far__)) +#endif +#include "bitmaps/lapsebutton_icon.xbm" +#if defined(__GNUC__) && (__MSP430X__ > 0) +__attribute__((__far__)) +#endif +#include "bitmaps/upbutton_icon.xbm" +#if defined(__GNUC__) && (__MSP430X__ > 0) +__attribute__((__far__)) +#endif +#include "bitmaps/downbutton_icon.xbm" +#if defined(__GNUC__) && (__MSP430X__ > 0) +__attribute__((__far__)) +#endif +#include "bitmaps/Bluetooth_icon.xbm" typedef struct { @@ -87,17 +113,20 @@ static accelscreen_data_t accel_screen = { void draw_accel_screen(accel_data_t *accel_data) { hal_lcd_clear_display(); - SetFont(MetaWatch16); - WriteLcdString(2, 2, "X:"); - WriteLcdNumber(20, 2, accel_data->x); - WriteLcdString(2, 18, "Y:"); - WriteLcdNumber(20, 18, accel_data->y); - WriteLcdString(2, 34, "Z:"); - WriteLcdNumber(20, 34, accel_data->z); - WriteLcdString(2, 54, "Light:"); - WriteLcdNumber(40, 54, accel_data->z); + oswald_write_string(0, 2, FONT_7x12b, "X:"); + oswald_write_number(20, 2, FONT_7x12b, accel_data->x); + oswald_write_string(0, 18, FONT_7x12b, "Y:"); + oswald_write_number(20, 18, FONT_7x12b, accel_data->y); +#if 0 + oswald_write_string(0, 34, FONT_8x12, "Z:"); + oswald_write_number(20, 34, FONT_8x12, accel_data->z); + oswald_write_string(0, 54, FONT_12x16, "Light:"); + oswald_write_number(50, 54, FONT_12x16, accel_data->z); + + oswald_write_string(0, 70, FONT_12x20, "23:59"); +#endif hal_lcd_update_display(); } @@ -136,8 +165,7 @@ static datetime_setup_data_t dt_setup_screen = { void draw_datetime_setup_screen(datetime_setup_data_t *sdata) { hal_lcd_clear_display(); -// SetFont(MetaWatch16); -// WriteLcdString(2, 2, "Set"); + oswald_draw_bitmap(36, 0, timesetup_icon_width, timesetup_icon_height, timesetup_icon_bits); oswald_draw_bitmap(81, 6, upbutton_icon_width, upbutton_icon_height, upbutton_icon_bits); @@ -154,14 +182,7 @@ void draw_datetime_setup_screen(datetime_setup_data_t *sdata) WriteLcdCharacter(31, 30, (OswaldClk.minute / 10)); WriteLcdCharacter(43, 30, (OswaldClk.minute % 10)); } -/* - WriteLcdCharacter(55, 20, TIME_CHARACTER_COLON_INDEX); - if ((sdata->pos == 2 && sdata->on) || sdata->pos != 2) { - WriteLcdCharacter(60, 20, (OswaldClk.second / 10)); - WriteLcdCharacter(72, 20, (OswaldClk.second % 10)); - } -*/ SetFont(MetaWatch16); if ((sdata->pos == 2 && sdata->on) || sdata->pos != 2) { WriteLcdCharacter(59, 36, 0x30 + (OswaldClk.second / 10));