Pārlūkot izejas kodu

Revert some const changes (for now)

Scott Lahteine 6 gadus atpakaļ
vecāks
revīzija
0946cbcdca

+ 7
- 7
Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp Parādīt failu

866
 };
866
 };
867
 
867
 
868
 /* return v1 - v2 */
868
 /* return v1 - v2 */
869
-static int hd44780_charmap_compare(const hd44780_charmap_t * const v1, const hd44780_charmap_t * const v2) {
869
+static int hd44780_charmap_compare(hd44780_charmap_t * v1, hd44780_charmap_t * v2) {
870
   return (v1->uchar < v2->uchar) ? -1 : (v1->uchar > v2->uchar) ? 1 : 0;
870
   return (v1->uchar < v2->uchar) ? -1 : (v1->uchar > v2->uchar) ? 1 : 0;
871
 }
871
 }
872
 
872
 
873
-static int pf_bsearch_cb_comp_hd4map_pgm(void *userdata, const size_t idx, const void * const data_pin) {
873
+static int pf_bsearch_cb_comp_hd4map_pgm(void *userdata, size_t idx, void * data_pin) {
874
   hd44780_charmap_t localval;
874
   hd44780_charmap_t localval;
875
   hd44780_charmap_t *p_hd44780_charmap = (hd44780_charmap_t *)userdata;
875
   hd44780_charmap_t *p_hd44780_charmap = (hd44780_charmap_t *)userdata;
876
   memcpy_P(&localval, p_hd44780_charmap + idx, sizeof(localval));
876
   memcpy_P(&localval, p_hd44780_charmap + idx, sizeof(localval));
883
 
883
 
884
 // return < 0 on error
884
 // return < 0 on error
885
 // return the advanced cols
885
 // return the advanced cols
886
-int lcd_put_wchar_max(const wchar_t c, pixel_len_t max_length) {
886
+int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) {
887
 
887
 
888
   // find the HD44780 internal ROM first
888
   // find the HD44780 internal ROM first
889
   int ret;
889
   int ret;
938
  *
938
  *
939
  * Draw a UTF-8 string
939
  * Draw a UTF-8 string
940
  */
940
  */
941
-static int lcd_put_u8str_max_cb(const char * const utf8_str, uint8_t (*cb_read_byte)(uint8_t * str), pixel_len_t max_length) {
941
+static int lcd_put_u8str_max_cb(const char * utf8_str, uint8_t (*cb_read_byte)(uint8_t * str), pixel_len_t max_length) {
942
   pixel_len_t ret = 0;
942
   pixel_len_t ret = 0;
943
   uint8_t *p = (uint8_t *)utf8_str;
943
   uint8_t *p = (uint8_t *)utf8_str;
944
   while (ret < max_length) {
944
   while (ret < max_length) {
950
   return (int)ret;
950
   return (int)ret;
951
 }
951
 }
952
 
952
 
953
-int lcd_put_u8str_max(const char * const utf8_str, pixel_len_t max_length) {
953
+int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length) {
954
   return lcd_put_u8str_max_cb(utf8_str, read_byte_ram, max_length);
954
   return lcd_put_u8str_max_cb(utf8_str, read_byte_ram, max_length);
955
 }
955
 }
956
 
956
 
957
-int lcd_put_u8str_max_P(PGM_P const utf8_str_P, pixel_len_t max_length) {
957
+int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length) {
958
   return lcd_put_u8str_max_cb(utf8_str_P, read_byte_rom, max_length);
958
   return lcd_put_u8str_max_cb(utf8_str_P, read_byte_rom, max_length);
959
 }
959
 }
960
 
960
 
961
 #if ENABLED(DEBUG_LCDPRINT)
961
 #if ENABLED(DEBUG_LCDPRINT)
962
 
962
 
963
-  int test_hd44780_charmap(hd44780_charmap_t *data, const size_t size, const char * const name, const bool flg_show_contents) {
963
+  int test_hd44780_charmap(hd44780_charmap_t *data, size_t size, char *name, char flg_show_contents) {
964
     int ret;
964
     int ret;
965
     size_t idx = 0;
965
     size_t idx = 0;
966
     hd44780_charmap_t preval = {0, 0, 0};
966
     hd44780_charmap_t preval = {0, 0, 0};

+ 3
- 3
Marlin/src/lcd/dogm/lcdprint_u8g.cpp Parādīt failu

28
 
28
 
29
 // return < 0 on error
29
 // return < 0 on error
30
 // return the advanced pixels
30
 // return the advanced pixels
31
-int lcd_put_wchar_max(const wchar_t c, pixel_len_t max_length) {
31
+int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) {
32
   if (c < 256) {
32
   if (c < 256) {
33
     u8g.print((char)c);
33
     u8g.print((char)c);
34
     return u8g_GetFontBBXWidth(u8g.getU8g());
34
     return u8g_GetFontBBXWidth(u8g.getU8g());
41
   return ret;
41
   return ret;
42
 }
42
 }
43
 
43
 
44
-int lcd_put_u8str_max(const char * const utf8_str, pixel_len_t max_length) {
44
+int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length) {
45
   unsigned int x = u8g.getPrintCol(),
45
   unsigned int x = u8g.getPrintCol(),
46
                y = u8g.getPrintRow(),
46
                y = u8g.getPrintRow(),
47
                ret = uxg_DrawUtf8Str(u8g.getU8g(), x, y, utf8_str, max_length);
47
                ret = uxg_DrawUtf8Str(u8g.getU8g(), x, y, utf8_str, max_length);
49
   return ret;
49
   return ret;
50
 }
50
 }
51
 
51
 
52
-int lcd_put_u8str_max_P(PGM_P const utf8_str_P, pixel_len_t max_length) {
52
+int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length) {
53
   unsigned int x = u8g.getPrintCol(),
53
   unsigned int x = u8g.getPrintCol(),
54
                y = u8g.getPrintRow(),
54
                y = u8g.getPrintRow(),
55
                ret = uxg_DrawUtf8StrP(u8g.getU8g(), x, y, utf8_str_P, max_length);
55
                ret = uxg_DrawUtf8StrP(u8g.getU8g(), x, y, utf8_str_P, max_length);

+ 6
- 6
Marlin/src/lcd/dogm/u8g_fontutf8.cpp Parādīt failu

42
 }
42
 }
43
 
43
 
44
 /*"data_list[idx] - *data_pin"*/
44
 /*"data_list[idx] - *data_pin"*/
45
-static int pf_bsearch_cb_comp_fntifo_pgm(void *userdata, const size_t idx, void *data_pin) {
45
+static int pf_bsearch_cb_comp_fntifo_pgm (void *userdata, size_t idx, void *data_pin) {
46
   uxg_fontinfo_t *fntinfo = (uxg_fontinfo_t*)userdata;
46
   uxg_fontinfo_t *fntinfo = (uxg_fontinfo_t*)userdata;
47
   uxg_fontinfo_t localval;
47
   uxg_fontinfo_t localval;
48
   memcpy_P(&localval, fntinfo + idx, sizeof(localval));
48
   memcpy_P(&localval, fntinfo + idx, sizeof(localval));
103
  *
103
  *
104
  * Get the screen pixel width of a ROM UTF-8 string
104
  * Get the screen pixel width of a ROM UTF-8 string
105
  */
105
  */
106
-static void fontgroup_drawstring(font_group_t *group, const font_t *fnt_default, const char * const utf8_msg, read_byte_cb_t cb_read_byte, void * userdata, fontgroup_cb_draw_t cb_draw_ram) {
106
+static void fontgroup_drawstring(font_group_t *group, const font_t *fnt_default, const char *utf8_msg, read_byte_cb_t cb_read_byte, void * userdata, fontgroup_cb_draw_t cb_draw_ram) {
107
   uint8_t *p = (uint8_t*)utf8_msg;
107
   uint8_t *p = (uint8_t*)utf8_msg;
108
   for (;;) {
108
   for (;;) {
109
     wchar_t val = 0;
109
     wchar_t val = 0;
196
  *
196
  *
197
  * Draw a UTF-8 string at the specified position
197
  * Draw a UTF-8 string at the specified position
198
  */
198
  */
199
-unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const char * const utf8_msg, pixel_len_t max_width) {
199
+unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const char *utf8_msg, pixel_len_t max_width) {
200
   struct _uxg_drawu8_data_t data;
200
   struct _uxg_drawu8_data_t data;
201
   font_group_t *group = &g_fontgroup_root;
201
   font_group_t *group = &g_fontgroup_root;
202
   const font_t *fnt_default = uxg_GetFont(pu8g);
202
   const font_t *fnt_default = uxg_GetFont(pu8g);
230
  *
230
  *
231
  * Draw a ROM UTF-8 string at the specified position
231
  * Draw a ROM UTF-8 string at the specified position
232
  */
232
  */
233
-unsigned int uxg_DrawUtf8StrP(u8g_t *pu8g, unsigned int x, unsigned int y, PGM_P const utf8_msg, pixel_len_t max_width) {
233
+unsigned int uxg_DrawUtf8StrP(u8g_t *pu8g, unsigned int x, unsigned int y, PGM_P utf8_msg, pixel_len_t max_width) {
234
   struct _uxg_drawu8_data_t data;
234
   struct _uxg_drawu8_data_t data;
235
   font_group_t *group = &g_fontgroup_root;
235
   font_group_t *group = &g_fontgroup_root;
236
   const font_t *fnt_default = uxg_GetFont(pu8g);
236
   const font_t *fnt_default = uxg_GetFont(pu8g);
273
  *
273
  *
274
  * Get the screen pixel width of a UTF-8 string
274
  * Get the screen pixel width of a UTF-8 string
275
  */
275
  */
276
-int uxg_GetUtf8StrPixelWidth(u8g_t *pu8g, const char * const utf8_msg) {
276
+int uxg_GetUtf8StrPixelWidth(u8g_t *pu8g, const char *utf8_msg) {
277
   struct _uxg_drawu8_data_t data;
277
   struct _uxg_drawu8_data_t data;
278
   font_group_t *group = &g_fontgroup_root;
278
   font_group_t *group = &g_fontgroup_root;
279
   const font_t *fnt_default = uxg_GetFont(pu8g);
279
   const font_t *fnt_default = uxg_GetFont(pu8g);
299
  *
299
  *
300
  * Get the screen pixel width of a ROM UTF-8 string
300
  * Get the screen pixel width of a ROM UTF-8 string
301
  */
301
  */
302
-int uxg_GetUtf8StrPixelWidthP(u8g_t *pu8g, PGM_P const utf8_msg) {
302
+int uxg_GetUtf8StrPixelWidthP(u8g_t *pu8g, PGM_P utf8_msg) {
303
   struct _uxg_drawu8_data_t data;
303
   struct _uxg_drawu8_data_t data;
304
   font_group_t *group = &g_fontgroup_root;
304
   font_group_t *group = &g_fontgroup_root;
305
   const font_t *fnt_default = uxg_GetFont(pu8g);
305
   const font_t *fnt_default = uxg_GetFont(pu8g);

+ 4
- 4
Marlin/src/lcd/dogm/u8g_fontutf8.h Parādīt failu

28
 
28
 
29
 unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, wchar_t ch, pixel_len_t max_length);
29
 unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, wchar_t ch, pixel_len_t max_length);
30
 
30
 
31
-unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const char * const utf8_msg, pixel_len_t max_length);
32
-unsigned int uxg_DrawUtf8StrP(u8g_t *pu8g, unsigned int x, unsigned int y, PGM_P const utf8_msg, pixel_len_t max_length);
31
+unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const char *utf8_msg, pixel_len_t max_length);
32
+unsigned int uxg_DrawUtf8StrP(u8g_t *pu8g, unsigned int x, unsigned int y, PGM_P utf8_msg, pixel_len_t max_length);
33
 
33
 
34
-int uxg_GetUtf8StrPixelWidth(u8g_t *pu8g, const char * const utf8_msg);
35
-int uxg_GetUtf8StrPixelWidthP(u8g_t *pu8g, PGM_P const utf8_msg);
34
+int uxg_GetUtf8StrPixelWidth(u8g_t *pu8g, const char *utf8_msg);
35
+int uxg_GetUtf8StrPixelWidthP(u8g_t *pu8g, PGM_P utf8_msg);
36
 
36
 
37
 #define uxg_GetFont(puxg) ((puxg)->font)
37
 #define uxg_GetFont(puxg) ((puxg)->font)

+ 5
- 5
Marlin/src/lcd/lcdprint.h Parādīt failu

22
 
22
 
23
 int lcd_glyph_height(void);
23
 int lcd_glyph_height(void);
24
 
24
 
25
-int lcd_put_wchar_max(const wchar_t c, pixel_len_t max_length);
25
+int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length);
26
 
26
 
27
 /**
27
 /**
28
  * @brief Draw a UTF-8 string
28
  * @brief Draw a UTF-8 string
34
  *
34
  *
35
  * Draw a UTF-8 string
35
  * Draw a UTF-8 string
36
  */
36
  */
37
-int lcd_put_u8str_max(const char * const utf8_str, pixel_len_t max_length);
37
+int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length);
38
 
38
 
39
 /**
39
 /**
40
  * @brief Draw a ROM UTF-8 string
40
  * @brief Draw a ROM UTF-8 string
46
  *
46
  *
47
  * Draw a ROM UTF-8 string
47
  * Draw a ROM UTF-8 string
48
  */
48
  */
49
-int lcd_put_u8str_max_P(PGM_P const utf8_str_P, pixel_len_t max_length);
49
+int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length);
50
 
50
 
51
 void lcd_moveto(const uint8_t col, const uint8_t row);
51
 void lcd_moveto(const uint8_t col, const uint8_t row);
52
 
52
 
53
 void lcd_put_int(const int i);
53
 void lcd_put_int(const int i);
54
 
54
 
55
-inline int lcd_put_u8str_P(PGM_P const str) { return lcd_put_u8str_max_P(str, PIXEL_LEN_NOLIMIT); }
55
+inline int lcd_put_u8str_P(PGM_P str) { return lcd_put_u8str_max_P(str, PIXEL_LEN_NOLIMIT); }
56
 
56
 
57
-inline int lcd_put_u8str(const char * const str) { return lcd_put_u8str_max(str, PIXEL_LEN_NOLIMIT); }
57
+inline int lcd_put_u8str(const char* str) { return lcd_put_u8str_max(str, PIXEL_LEN_NOLIMIT); }
58
 
58
 
59
 inline int lcd_put_wchar(const wchar_t c) { return lcd_put_wchar_max(c, PIXEL_LEN_NOLIMIT); }
59
 inline int lcd_put_wchar(const wchar_t c) { return lcd_put_wchar_max(c, PIXEL_LEN_NOLIMIT); }

Notiek ielāde…
Atcelt
Saglabāt