2024-05-03 01:53 AM
Hi everybody,
I have a lot of the same warnings, but the compilation is ok! I would still like to try to solve them
in my main.c in this line :
st7567_Write_Number2(100, 27, D_seconde, Number_microsoftSansSerif_14pt, INFO_Number_microsoftSansSerif_14pt);
the error is :
../Core/Src/main.c:465:90: warning: passing argument 5 of 'st7567_Write_Number2' from incompatible pointer type [-Wincompatible-pointer-types]
465 | st7567_Write_Number2(100, 27, D_seconde, Number_microsoftSansSerif_14pt, INFO_Number_microsoftSansSerif_14pt);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| uint32_t (*)[3] {aka long unsigned int (*)[3]}
In file included from ../Core/Src/main.c:25:
../Core/Inc/st7567_driver.h:24:66: note: expected 'uint32_t *' {aka 'long unsigned int *'} but argument is of type 'uint32_t (*)[3]' {aka 'long unsigned int (*)[3]'}
24 | void st7567_Write_Number2(uint8_t, uint8_t , uint8_t, uint8_t *, uint32_t*);
| ^~~~~~~~~
The declaration of my fucntion is in the st7567_driver.h
void st7567_Write_Text (uint8_t, uint8_t , char *, uint8_t *, uint32_t *);
void st7567_Write_Number(uint8_t, uint8_t , char *, uint8_t *, uint32_t *);
void st7567_Write_Number2(uint8_t, uint8_t , uint8_t, uint8_t *, uint32_t*);
void st7567_Draw_Image(uint8_t, uint8_t , uint8_t, uint8_t, uint8_t *);
The declaration of my font is located in a font.h
#ifndef INC_FONT_H_
#define INC_FONT_H_
extern uint8_t microsoftSansSerif_10pt[];
extern uint32_t INFO_microsoftSansSerif_10pt[][3];
extern uint8_t microsoftSansSerif_18pt[];
extern uint32_t INFO_microsoftSansSerif_18pt[][3];
extern uint8_t Number_microsoftSansSerif_28pt[];
extern uint32_t INFO_Number_microsoftSansSerif_28pt[9][3];
extern uint8_t Number_microsoftSansSerif_22pt[];
extern uint32_t INFO_Number_microsoftSansSerif_22pt[9][3];
extern uint8_t Number_microsoftSansSerif_14pt[];
extern uint32_t INFO_Number_microsoftSansSerif_14pt[9][3];
#endif /* INC_FONT_H_ */
And my fucntion look like this :
void st7567_Write_Number2(uint8_t x, uint8_t y, uint8_t Number, uint8_t* ptr_Font, uint32_t* ptr_Info)
{
uint32_t Width = 0;
uint32_t Height = 0;
uint8_t caract = 0;
uint8_t Retenue = 0;
uint16_t temporaire = 0;
uint32_t Start_Char=0; // Indique l'adresse de depart du caractère dans le tableau
uint8_t Start_page = 0 ; // indique la page de départ
uint8_t Offset_Y =0 ; // calcul l'offset par rapport à la page de départ
uint8_t Offset_X = 0; // Créer le décalage entre chaque caractère
caract = Number ; // La place du caractere dans le tableau
Width = *(ptr_Info + (caract*3)); // Largeur du caractere dans le tableau
Height = *(ptr_Info + (caract*3)+1); // hautreur du caractere dans le tableau
Start_Char = *(ptr_Info + (caract*3)+2); // l'endroti ou commence le caractere dans le tableau
And my font look like this :
/* Character bitmaps for Microsoft Sans Serif 14pt */
const uint8_t Number_microsoftSansSerif_14pt[] =
{
/* @0 '0' (10 pixels wide) */
0x00, 0xF8, 0xFE, 0xFF, 0x07, 0x03, 0x07, 0xFF, 0xFE, 0xF8,
0x00, 0x07, 0x1F, 0x3F, 0x38, 0x30, 0x38, 0x3F, 0x1F, 0x07,
/* @20 '1' (10 pixels wide) */
0x00, 0x00, 0x0C, 0x0C, 0x0E, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x3F, 0x3F, 0x00, 0x00,
/* @40 '2' (10 pixels wide) */
0x00, 0x0C, 0x0E, 0x0F, 0x07, 0x03, 0xC7, 0xFF, 0xFE, 0x3C,
0x00, 0x30, 0x38, 0x3C, 0x3E, 0x37, 0x33, 0x31, 0x30, 0x30,
/* @60 '3' (10 pixels wide) */
0x00, 0x0C, 0x0E, 0x0F, 0xC7, 0xC3, 0xE7, 0xFF, 0xBE, 0x1C,
0x00, 0x0C, 0x1C, 0x3C, 0x38, 0x30, 0x39, 0x3F, 0x1F, 0x0F,
/* @80 '4' (10 pixels wide) */
0x00, 0x80, 0xE0, 0xF8, 0x7C, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
0x07, 0x07, 0x07, 0x06, 0x06, 0x3F, 0x3F, 0x3F, 0x06, 0x06,
/* @100 '5' (10 pixels wide) */
0x00, 0xF0, 0xFF, 0xFF, 0x6F, 0x63, 0xE3, 0xE3, 0xC3, 0x80,
0x00, 0x0C, 0x1C, 0x3C, 0x38, 0x30, 0x38, 0x3F, 0x1F, 0x0F,
/* @120 '6' (10 pixels wide) */
0x00, 0xF8, 0xFE, 0xFF, 0xEF, 0x63, 0xE3, 0xE7, 0xC6, 0x84,
0x00, 0x07, 0x1F, 0x3F, 0x38, 0x30, 0x38, 0x3F, 0x1F, 0x0F,
/* @140 '7' (10 pixels wide) */
0x00, 0x03, 0x03, 0x03, 0x03, 0xC3, 0xFB, 0xFF, 0x3F, 0x07,
0x00, 0x00, 0x00, 0x30, 0x3E, 0x3F, 0x1F, 0x01, 0x00, 0x00,
/* @160 '8' (10 pixels wide) */
0x00, 0x1C, 0x3E, 0xFF, 0xE3, 0xC3, 0xE3, 0xFF, 0x3E, 0x1C,
0x00, 0x0E, 0x1F, 0x3F, 0x39, 0x30, 0x39, 0x3F, 0x1F, 0x0E,
/* @180 '9' (10 pixels wide) */
0x00, 0x7C, 0xFE, 0xFF, 0xC7, 0x83, 0xC7, 0xFF, 0xFE, 0xF8,
0x00, 0x08, 0x18, 0x39, 0x31, 0x31, 0x3D, 0x3F, 0x1F, 0x07,
};
/* Character descriptors for Microsoft Sans Serif 14pt */
/* { [Char width in bits], [Char height in bits], [Offset into microsoftSansSerif_14ptCharBitmaps in bytes] } */
uint32_t INFO_Number_microsoftSansSerif_14pt[10][3] =
{
{10, 14, 0}, /* 0 */
{10, 14, 20}, /* 1 */
{10, 14, 40}, /* 2 */
{10, 14, 60}, /* 3 */
{10, 14, 80}, /* 4 */
{10, 14, 100}, /* 5 */
{10, 14, 120}, /* 6 */
{10, 14, 140}, /* 7 */
{10, 14, 160}, /* 8 */
{10, 14, 180} /* 9 */
};
I know I must be making a declaration error somewhere, but I can't find my mistake.
Thank you for reading me !