Просмотр исходного кода

[2.0.x] Fix problems compiling with Arduino IDE (#10441)

* Fix problems compiling u8glib utf8 support on Arduino
* Change header in auto-generated font data
* Change include in font gen scripts
Chris Pepper 7 лет назад
Родитель
Сommit
744bcaee61
34 измененных файлов: 52 добавлений и 52 удалений
  1. 1
    1
      Marlin/src/lcd/dogm/dogm_font_data_ISO10646_1.h
  2. 1
    1
      Marlin/src/lcd/dogm/language_data_an.h
  3. 1
    1
      Marlin/src/lcd/dogm/language_data_bg.h
  4. 1
    1
      Marlin/src/lcd/dogm/language_data_ca.h
  5. 1
    1
      Marlin/src/lcd/dogm/language_data_cz.h
  6. 1
    1
      Marlin/src/lcd/dogm/language_data_da.h
  7. 1
    1
      Marlin/src/lcd/dogm/language_data_de.h
  8. 1
    1
      Marlin/src/lcd/dogm/language_data_el-gr.h
  9. 1
    1
      Marlin/src/lcd/dogm/language_data_el.h
  10. 1
    1
      Marlin/src/lcd/dogm/language_data_en.h
  11. 1
    1
      Marlin/src/lcd/dogm/language_data_es.h
  12. 1
    1
      Marlin/src/lcd/dogm/language_data_eu.h
  13. 1
    1
      Marlin/src/lcd/dogm/language_data_fi.h
  14. 1
    1
      Marlin/src/lcd/dogm/language_data_fr.h
  15. 1
    1
      Marlin/src/lcd/dogm/language_data_gl.h
  16. 1
    1
      Marlin/src/lcd/dogm/language_data_hr.h
  17. 1
    1
      Marlin/src/lcd/dogm/language_data_it.h
  18. 1
    1
      Marlin/src/lcd/dogm/language_data_jp-kana.h
  19. 1
    1
      Marlin/src/lcd/dogm/language_data_nl.h
  20. 1
    1
      Marlin/src/lcd/dogm/language_data_pl.h
  21. 1
    1
      Marlin/src/lcd/dogm/language_data_pt-br.h
  22. 1
    1
      Marlin/src/lcd/dogm/language_data_pt.h
  23. 1
    1
      Marlin/src/lcd/dogm/language_data_ru.h
  24. 1
    1
      Marlin/src/lcd/dogm/language_data_sk.h
  25. 1
    1
      Marlin/src/lcd/dogm/language_data_test.h
  26. 1
    1
      Marlin/src/lcd/dogm/language_data_tr.h
  27. 1
    1
      Marlin/src/lcd/dogm/language_data_uk.h
  28. 1
    1
      Marlin/src/lcd/dogm/language_data_zh_CN.h
  29. 1
    1
      Marlin/src/lcd/dogm/language_data_zh_TW.h
  30. 0
    1
      Marlin/src/lcd/fontutils.cpp
  31. 21
    17
      Marlin/src/lcd/u8g_fontutf8.cpp
  32. 1
    1
      Marlin/src/lcd/u8g_fontutf8.h
  33. 0
    3
      buildroot/share/fonts/genallfont.sh
  34. 1
    1
      buildroot/share/fonts/uxggenpages.sh

+ 1
- 1
Marlin/src/lcd/dogm/dogm_font_data_ISO10646_1.h Просмотреть файл

@@ -20,7 +20,7 @@
20 20
  *
21 21
  */
22 22
 
23
-#include <clib/u8g.h>
23
+#include <U8glib.h>
24 24
 
25 25
 #if defined(__AVR__) && ENABLED(NOT_EXTENDED_ISO10646_1_5X7)
26 26
   // reduced font (only sysmbols 1 - 127) - saves about 1278 bytes of FLASH

+ 1
- 1
Marlin/src/lcd/dogm/language_data_an.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 #define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data}
8 8
 static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {

+ 1
- 1
Marlin/src/lcd/dogm/language_data_bg.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 const u8g_fntpgm_uint8_t fontpage_8_144_149[96] U8G_FONT_SECTION("fontpage_8_144_149") = {
8 8
   0x00,0x06,0x0a,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x90,0x95,0x00,0x07,0xff,0x00,

+ 1
- 1
Marlin/src/lcd/dogm/language_data_ca.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 #define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data}
8 8
 static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {

+ 1
- 1
Marlin/src/lcd/dogm/language_data_cz.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 const u8g_fntpgm_uint8_t fontpage_2_140_141[49] U8G_FONT_SECTION("fontpage_2_140_141") = {
8 8
   0x00,0x06,0x0a,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8c,0x8d,0x00,0x0b,0x00,0x00,

+ 1
- 1
Marlin/src/lcd/dogm/language_data_da.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 #define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data}
8 8
 static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {

+ 1
- 1
Marlin/src/lcd/dogm/language_data_de.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 #define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data}
8 8
 static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {

+ 1
- 1
Marlin/src/lcd/dogm/language_data_el-gr.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 const u8g_fntpgm_uint8_t fontpage_7_136_136[31] U8G_FONT_SECTION("fontpage_7_136_136") = {
8 8
   0x00,0x06,0x0a,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x00,0x08,0x00,0x00,

+ 1
- 1
Marlin/src/lcd/dogm/language_data_el.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 const u8g_fntpgm_uint8_t fontpage_7_136_136[31] U8G_FONT_SECTION("fontpage_7_136_136") = {
8 8
   0x00,0x06,0x0a,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x00,0x08,0x00,0x00,

+ 1
- 1
Marlin/src/lcd/dogm/language_data_en.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 #define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data}
8 8
 static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {

+ 1
- 1
Marlin/src/lcd/dogm/language_data_es.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 #define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data}
8 8
 static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {

+ 1
- 1
Marlin/src/lcd/dogm/language_data_eu.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 #define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data}
8 8
 static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {

+ 1
- 1
Marlin/src/lcd/dogm/language_data_fi.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 #define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data}
8 8
 static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {

+ 1
- 1
Marlin/src/lcd/dogm/language_data_fr.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 #define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data}
8 8
 static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {

+ 1
- 1
Marlin/src/lcd/dogm/language_data_gl.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 #define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data}
8 8
 static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {

+ 1
- 1
Marlin/src/lcd/dogm/language_data_hr.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 const u8g_fntpgm_uint8_t fontpage_2_135_135[32] U8G_FONT_SECTION("fontpage_2_135_135") = {
8 8
   0x00,0x06,0x0a,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x87,0x87,0x00,0x09,0x00,0x00,

+ 1
- 1
Marlin/src/lcd/dogm/language_data_it.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 #define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data}
8 8
 static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {

+ 1
- 1
Marlin/src/lcd/dogm/language_data_jp-kana.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 const u8g_fntpgm_uint8_t fontpage_97_161_164[61] U8G_FONT_SECTION("fontpage_97_161_164") = {
8 8
   0x00,0x06,0x0a,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa1,0xa4,0x00,0x06,0x00,0x00,

+ 1
- 1
Marlin/src/lcd/dogm/language_data_nl.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 #define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data}
8 8
 static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {

+ 1
- 1
Marlin/src/lcd/dogm/language_data_pl.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 const u8g_fntpgm_uint8_t fontpage_2_133_133[31] U8G_FONT_SECTION("fontpage_2_133_133") = {
8 8
   0x00,0x06,0x0a,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x85,0x85,0x00,0x06,0xfe,0x00,

+ 1
- 1
Marlin/src/lcd/dogm/language_data_pt-br.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 #define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data}
8 8
 static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {

+ 1
- 1
Marlin/src/lcd/dogm/language_data_pt.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 #define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data}
8 8
 static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {

+ 1
- 1
Marlin/src/lcd/dogm/language_data_ru.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 const u8g_fntpgm_uint8_t fontpage_8_144_152[135] U8G_FONT_SECTION("fontpage_8_144_152") = {
8 8
   0x00,0x06,0x0a,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x90,0x98,0x00,0x07,0xff,0x00,

+ 1
- 1
Marlin/src/lcd/dogm/language_data_sk.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 const u8g_fntpgm_uint8_t fontpage_2_140_143[80] U8G_FONT_SECTION("fontpage_2_140_143") = {
8 8
   0x00,0x06,0x0a,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x8c,0x8f,0x00,0x0b,0x00,0x00,

+ 1
- 1
Marlin/src/lcd/dogm/language_data_test.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 const u8g_fntpgm_uint8_t fontpage_8_128_255[1255] U8G_FONT_SECTION("fontpage_8_128_255") = {
8 8
   0x00,0x06,0x0a,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0x00,0x08,0xff,0x00,

+ 1
- 1
Marlin/src/lcd/dogm/language_data_tr.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 const u8g_fntpgm_uint8_t fontpage_2_159_159[34] U8G_FONT_SECTION("fontpage_2_159_159") = {
8 8
   0x00,0x06,0x0a,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9f,0x9f,0x00,0x09,0xfe,0x00,

+ 1
- 1
Marlin/src/lcd/dogm/language_data_uk.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 const u8g_fntpgm_uint8_t fontpage_8_134_134[30] U8G_FONT_SECTION("fontpage_8_134_134") = {
8 8
   0x00,0x06,0x0a,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x86,0x86,0x00,0x07,0x00,0x00,

+ 1
- 1
Marlin/src/lcd/dogm/language_data_zh_CN.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 const u8g_fntpgm_uint8_t fontpage_69_191_191[41] U8G_FONT_SECTION("fontpage_69_191_191") = {
8 8
   0x00,0x06,0x0a,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbf,0xbf,0x00,0x0a,0x00,0x00,

+ 1
- 1
Marlin/src/lcd/dogm/language_data_zh_TW.h Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 /* This file is generated automatically, any changes to the file may be REPLACED by future processing. */
3 3
 /* Please turn to the tools call this script to change the contents! */
4 4
 
5
-#include <clib/u8g.h>
5
+#include <U8glib.h>
6 6
 
7 7
 const u8g_fntpgm_uint8_t fontpage_69_191_191[41] U8G_FONT_SECTION("fontpage_69_191_191") = {
8 8
   0x00,0x06,0x0a,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbf,0xbf,0x00,0x0a,0x00,0x00,

+ 0
- 1
Marlin/src/lcd/fontutils.cpp Просмотреть файл

@@ -7,7 +7,6 @@
7 7
  * @copyright GPL/BSD
8 8
  */
9 9
 
10
-#include "../inc/MarlinConfigPre.h"
11 10
 #include "../inc/MarlinConfig.h"
12 11
 
13 12
 #if ENABLED(ULTRA_LCD)

Marlin/src/lcd/u8g_fontutf8.c → Marlin/src/lcd/u8g_fontutf8.cpp Просмотреть файл

@@ -7,25 +7,27 @@
7 7
  * @copyright GPL/BSD
8 8
  */
9 9
 
10
+#include "../inc/MarlinConfig.h"
11
+
12
+#if ENABLED(ULTRA_LCD)
13
+
10 14
 #include <string.h>
11 15
 #include "fontutils.h"
12 16
 #include "u8g_fontutf8.h"
13 17
 
14 18
 ////////////////////////////////////////////////////////////
15
-#define font_t void
19
+typedef void font_t;
16 20
 
17 21
 #ifndef PSTR
18 22
 #define PSTR(a) a
19 23
 
20
-void *
21
-memcpy_from_rom(void *dest, const void * rom_src, size_t sz)
22
-{
24
+void* memcpy_from_rom(void *dest, const void * rom_src, size_t sz) {
23 25
   uint8_t * p;
24 26
   uint8_t * s;
25 27
 
26 28
   FU_ASSERT(NULL != dest);
27
-  p = dest;
28
-  s = rom_src;
29
+  p = (uint8_t*)dest;
30
+  s = (uint8_t*)rom_src;
29 31
   uint8_t c;
30 32
   while ((p - (uint8_t *)dest) < sz) {
31 33
     *p = pgm_read_byte(s);
@@ -79,7 +81,7 @@ static int pf_bsearch_cb_comp_fntifo_pgm (void *userdata, size_t idx, void *data
79 81
   uxg_fontinfo_t *fntinfo = (uxg_fontinfo_t*)userdata;
80 82
   uxg_fontinfo_t localval;
81 83
   memcpy_from_rom(&localval, fntinfo + idx, sizeof(localval));
82
-  return fontinfo_compare(&localval, data_pin);
84
+  return fontinfo_compare(&localval, (uxg_fontinfo_t*)data_pin);
83 85
 }
84 86
 
85 87
 typedef struct _font_group_t {
@@ -95,7 +97,7 @@ static int fontgroup_init(font_group_t * root, const uxg_fontinfo_t * fntinfo, i
95 97
 }
96 98
 
97 99
 static const font_t* fontgroup_find(font_group_t * root, wchar_t val) {
98
-  uxg_fontinfo_t vcmp = {val / 128, val % 128 + 128, val % 128 + 128, 0, 0};
100
+  uxg_fontinfo_t vcmp = {(uint16_t)(val / 128), (uint8_t)(val % 128 + 128), (uint8_t)(val % 128 + 128), 0, 0};
99 101
   size_t idx = 0;
100 102
 
101 103
   if (val < 256) return NULL;
@@ -178,11 +180,11 @@ struct _uxg_drawu8_data_t {
178 180
 };
179 181
 
180 182
 static int fontgroup_cb_draw_u8g (void *userdata, const font_t *fnt_current, const char *msg) {
181
-  struct _uxg_drawu8_data_t * pdata = userdata;
183
+  struct _uxg_drawu8_data_t * pdata = (_uxg_drawu8_data_t*)userdata;
182 184
 
183 185
   FU_ASSERT(NULL != userdata);
184 186
   if (pdata->fnt_prev != fnt_current) {
185
-    u8g_SetFont(pdata->pu8g, fnt_current);
187
+    u8g_SetFont(pdata->pu8g, (const u8g_fntpgm_uint8_t*)fnt_current);
186 188
     //u8g_SetFontPosBottom(pdata->pu8g);
187 189
     pdata->fnt_prev = fnt_current;
188 190
   }
@@ -225,7 +227,7 @@ unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, wchar_t
225 227
   data.max_width = max_width;
226 228
   data.fnt_prev = NULL;
227 229
   fontgroup_drawwchar(group, fnt_default, ch, (void*)&data, fontgroup_cb_draw_u8g);
228
-  u8g_SetFont(pu8g, fnt_default);
230
+  u8g_SetFont(pu8g, (const u8g_fntpgm_uint8_t*)fnt_default);
229 231
 
230 232
   return data.adv;
231 233
 }
@@ -259,7 +261,7 @@ unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const
259 261
   data.max_width = max_width;
260 262
   data.fnt_prev = NULL;
261 263
   fontgroup_drawstring(group, fnt_default, utf8_msg, strlen(utf8_msg), read_byte_ram, (void*)&data, fontgroup_cb_draw_u8g);
262
-  u8g_SetFont(pu8g, fnt_default);
264
+  u8g_SetFont(pu8g, (const u8g_fntpgm_uint8_t*)fnt_default);
263 265
 
264 266
   return data.adv;
265 267
 }
@@ -296,18 +298,18 @@ unsigned int uxg_DrawUtf8StrP(u8g_t *pu8g, unsigned int x, unsigned int y, const
296 298
   TRACE("call fontgroup_drawstring");
297 299
   fontgroup_drawstring(group, fnt_default, utf8_msg, my_strlen_P(utf8_msg), read_byte_rom, (void*)&data, fontgroup_cb_draw_u8g);
298 300
   TRACE("restore font");
299
-  u8g_SetFont(pu8g, fnt_default);
301
+  u8g_SetFont(pu8g, (const u8g_fntpgm_uint8_t*)fnt_default);
300 302
 
301 303
   TRACE("return %d", data.adv);
302 304
   return data.adv;
303 305
 }
304 306
 
305 307
 static int fontgroup_cb_draw_u8gstrlen(void *userdata, const font_t *fnt_current, const char *msg) {
306
-  struct _uxg_drawu8_data_t * pdata = userdata;
308
+  struct _uxg_drawu8_data_t * pdata = (_uxg_drawu8_data_t*)userdata;
307 309
 
308 310
   FU_ASSERT(NULL != userdata);
309 311
   if (pdata->fnt_prev != fnt_current) {
310
-    u8g_SetFont(pdata->pu8g, fnt_current);
312
+    u8g_SetFont(pdata->pu8g, (const u8g_fntpgm_uint8_t*)fnt_current);
311 313
     u8g_SetFontPosBottom(pdata->pu8g);
312 314
     pdata->fnt_prev = fnt_current;
313 315
   }
@@ -339,7 +341,7 @@ int uxg_GetUtf8StrPixelWidth(u8g_t *pu8g, const char *utf8_msg) {
339 341
   data.pu8g = pu8g;
340 342
   data.adv = 0;
341 343
   fontgroup_drawstring(group, fnt_default, utf8_msg, strlen(utf8_msg), read_byte_ram, (void*)&data, fontgroup_cb_draw_u8gstrlen);
342
-  u8g_SetFont(pu8g, fnt_default);
344
+  u8g_SetFont(pu8g, (const u8g_fntpgm_uint8_t*)fnt_default);
343 345
 
344 346
   return data.adv;
345 347
 }
@@ -367,6 +369,8 @@ int uxg_GetUtf8StrPixelWidthP(u8g_t *pu8g, const char *utf8_msg) {
367 369
   data.pu8g = pu8g;
368 370
   data.adv = 0;
369 371
   fontgroup_drawstring(group, fnt_default, utf8_msg, my_strlen_P(utf8_msg), read_byte_rom, (void*)&data, fontgroup_cb_draw_u8gstrlen);
370
-  u8g_SetFont(pu8g, fnt_default);
372
+  u8g_SetFont(pu8g, (const u8g_fntpgm_uint8_t*)fnt_default);
371 373
   return data.adv;
372 374
 }
375
+
376
+#endif // ENABLED(ULTRA_LCD)

+ 1
- 1
Marlin/src/lcd/u8g_fontutf8.h Просмотреть файл

@@ -9,7 +9,7 @@
9 9
 #ifndef _UXG_FONTUTF8_H
10 10
 #define _UXG_FONTUTF8_H 1
11 11
 
12
-#include <clib/u8g.h>
12
+#include <U8glib.h>
13 13
 #include "fontutils.h"
14 14
 
15 15
 #ifdef __cplusplus

+ 0
- 3
buildroot/share/fonts/genallfont.sh Просмотреть файл

@@ -101,10 +101,7 @@ EOF
101 101
 
102 102
 #endif
103 103
 EOF
104
-    sed -e 's|#include "u8g.h"|#include <clib/u8g.h>|' -i tmp3.h
105 104
 
106 105
     cd ..
107 106
     mv ${DN_WORK}/tmp3.h src/lcd/dogm/dogm_font_data_ISO10646_1.h
108 107
 fi
109
-
110
-

+ 1
- 1
buildroot/share/fonts/uxggenpages.sh Просмотреть файл

@@ -154,7 +154,7 @@ echo "/* Generated by $0 */" >> fontutf8-data.h
154 154
 echo "/* This file is generated automatically, any changes to the file may be REPLACED by future processing. */" >> fontutf8-data.h
155 155
 echo "/* Please turn to the tools call this script to change the contents! */" >> fontutf8-data.h
156 156
 echo "" >> fontutf8-data.h
157
-echo "#include <u8g.h>" >> fontutf8-data.h
157
+echo "#include <U8glib.h>" >> fontutf8-data.h
158 158
 #echo "#include \"fontutf8u8g.h\"" >> fontutf8-data.h
159 159
 echo "" >> fontutf8-data.h
160 160
 cat tmpa >> fontutf8-data.h

Загрузка…
Отмена
Сохранить