Kaynağa Gözat

Replaced some literal constants with defines

Replaced calculation to centre bitmap with fixed values.
Saved 20 bytes.
AnHardt 9 yıl önce
ebeveyn
işleme
c20606b8d7
2 değiştirilmiş dosya ile 10 ekleme ve 4 silme
  1. 3
    1
      Marlin/DOGMbitmaps.h
  2. 7
    3
      Marlin/dogm_lcd_implementation.h

+ 3
- 1
Marlin/DOGMbitmaps.h Dosyayı Görüntüle

1
 // BitMap for splashscreen
1
 // BitMap for splashscreen
2
 // Generated with: http://www.digole.com/tools/PicturetoC_Hex_converter.php
2
 // Generated with: http://www.digole.com/tools/PicturetoC_Hex_converter.php
3
-// Please note that using the high-res version takes about 0.5KB of 
3
+// Please note that using the high-res version takes 402Bytes of PROGMEM. 
4
+//#define START_BMPHIGH
5
+
4
 #ifdef START_BMPHIGH
6
 #ifdef START_BMPHIGH
5
   #define START_BMPWIDTH      112
7
   #define START_BMPWIDTH      112
6
   #define START_BMPHEIGHT      38
8
   #define START_BMPHEIGHT      38

+ 7
- 3
Marlin/dogm_lcd_implementation.h Dosyayı Görüntüle

109
 	
109
 	
110
   // Show splashscreen
110
   // Show splashscreen
111
   int offx = (u8g.getWidth() - START_BMPWIDTH) / 2;
111
   int offx = (u8g.getWidth() - START_BMPWIDTH) / 2;
112
-  int offy = (u8g.getHeight() - 18 - START_BMPHEIGHT) / 2;
113
-  int txtX = (u8g.getWidth() - (sizeof(STRING_SPLASH) - 1)*6) / 2; // 6 is fontwidth in pixel
114
-  int txtY = u8g.getHeight() - 10;
112
+  #ifdef START_BMPHIGH
113
+    int offy = 0;
114
+  #else
115
+    int offy = DOG_CHAR_HEIGHT;
116
+  #endif
117
+  int txtX = (u8g.getWidth() - (sizeof(STRING_SPLASH) - 1)*DOG_CHAR_WIDTH) / 2;
118
+  int txtY = u8g.getHeight() - DOG_CHAR_HEIGHT;
115
 	u8g.firstPage();
119
 	u8g.firstPage();
116
 	do {
120
 	do {
117
 	  u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);
121
 	  u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);

Loading…
İptal
Kaydet