Skip to content

Commit

Permalink
chg: Code refactor - Remove LoadImage and CreateImage !minor
Browse files Browse the repository at this point in the history
  • Loading branch information
lcgamboa committed Jan 29, 2024
1 parent 5782b4b commit 8423dc3
Show file tree
Hide file tree
Showing 41 changed files with 332 additions and 273 deletions.
107 changes: 25 additions & 82 deletions src/boards/board_Breadboard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ cboard_Breadboard::cboard_Breadboard(void) {
Proc = "PIC18F4620"; // default microcontroller if none defined in preferences
ReadMaps(); // Read input and output board maps

micbmp = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() + "boards/Common/ic40.svg", Scale, 1);
micbmp = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/ic40.svg").c_str(), Scale, 1, 0}});
}

// Destructor called once on board destruction
Expand Down Expand Up @@ -709,60 +710,18 @@ int cboard_Breadboard::MInit(const char* processor, const char* fname, float fre
break;
}

int bmp = PICSimLab.LoadImageFile(
PICSimLab.GetSharePath() + "boards/Common/ic" + std::to_string(MGetPinCount()) + ".svg", Scale, 1);
int bmp = PICSimLab.CanvasCmd(
{CC_LOADIMAGE,
.LoadImage{(PICSimLab.GetSharePath() + "boards/Common/ic" + std::to_string(MGetPinCount()) + ".svg").c_str(),
Scale, 1, 0}});

if (bmp < 0) {
bmp = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() +
"boards/Common/"
"ic6.svg",
Scale, 1);
printf(
"pi"
"cs"
"im"
"la"
"b:"
" I"
"C "
"pa"
"ck"
"ag"
"e "
"wi"
"th"
" %"
"i "
"pi"
"ns"
" n"
"ot"
" f"
"ou"
"nd"
"!"
"\n",
MGetPinCount());
printf(
"pi"
"cs"
"im"
"la"
"b:"
" %"
"s "
"no"
"t "
"fo"
"un"
"d!"
"\n",
(const char*)(PICSimLab.GetSharePath() +
"boards/"
"Common/"
"ic" +
std::to_string(MGetPinCount()) + ".svg")
.c_str());
bmp = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/ic6.svg").c_str(), Scale, 1, 0}});
printf("picsimlab: IC package with %i pins not found!\n", MGetPinCount());
printf("picsimlab: %s not found!\n",
(const char*)(PICSimLab.GetSharePath() + "boards/Common/ic" + std::to_string(MGetPinCount()) + ".svg")
.c_str());
}

if (micbmp)
Expand Down Expand Up @@ -1192,38 +1151,22 @@ void cboard_Breadboard::SetScale(double scale) {
int bmp = -1;

if (MGetPinCount()) {
bmp = PICSimLab.LoadImageFile(
PICSimLab.GetSharePath() + "boards/Common/ic" + std::to_string(MGetPinCount()) + ".svg", Scale, 1);
bmp = PICSimLab.CanvasCmd(
{CC_LOADIMAGE,
.LoadImage{
(PICSimLab.GetSharePath() + "boards/Common/ic" + std::to_string(MGetPinCount()) + ".svg").c_str(),
Scale, 1, 0}});
if (bmp < 0) {
bmp = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() +
"boards/Common/"
"ic6.svg",
Scale, 1);
printf(
"picsimlab: IC "
"package with %i "
"pins not "
"found!\n",
MGetPinCount());
printf(
"picsimlab: %s not "
"found!\n",
(const char*)(PICSimLab.GetSharePath() +
"boar"
"ds/"
"Comm"
"on/"
"ic" +
std::to_string(MGetPinCount()) +
".sv"
"g")
.c_str());
bmp = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/ic6.svg").c_str(), Scale, 1, 0}});
printf("picsimlab: IC package with %i pins not found!\n", MGetPinCount());
printf("picsimlab: %s not found!\n", (const char*)(PICSimLab.GetSharePath() + "boards/Common/ic" +
std::to_string(MGetPinCount()) + ".svg")
.c_str());
}
} else {
bmp = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() +
"boards/Common/"
"ic40.svg",
Scale, 1);
bmp = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/ic40.svg").c_str(), Scale, 1, 0}});
}
if (micbmp >= 0)
PICSimLab.CanvasCmd({CC_FREEBITMAP, .FreeBitmap{micbmp}});
Expand Down
12 changes: 8 additions & 4 deletions src/boards/board_McLab2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,10 @@ cboard_McLab2::cboard_McLab2(void) {
PICSimLab.UpdateGUI(COOLER, GT_GAUGE, GA_ADD, (void*)"Cooler");
PICSimLab.UpdateGUI(TEMP, GT_LABEL, GA_ADD, (void*)"Temp: 00.0C");

vent[0] = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() + "boards/Common/VT1.svg");
vent[1] = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() + "boards/Common/VT2.svg");
vent[0] = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/VT1.svg").c_str(), 1.0, 0, 0}});
vent[1] = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/VT2.svg").c_str(), 1.0, 0, 0}});

snprintf(mi2c_tmp_name, 200, "%s/picsimlab-XXXXXX", (const char*)lxGetTempDir("PICSimLab").c_str());
close(mkstemp(mi2c_tmp_name));
Expand Down Expand Up @@ -205,8 +207,10 @@ void cboard_McLab2::SetScale(double scale) {
if (vent[0] >= 0) {
PICSimLab.CanvasCmd({CC_FREEBITMAP, .FreeBitmap{vent[0]}});
PICSimLab.CanvasCmd({CC_FREEBITMAP, .FreeBitmap{vent[1]}});
vent[0] = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() + "boards/Common/VT1.svg", Scale);
vent[1] = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() + "boards/Common/VT2.svg", Scale);
vent[0] = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/VT1.svg").c_str(), Scale, 0, 0}});
vent[1] = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/VT2.svg").c_str(), Scale, 0, 0}});
}
}
}
Expand Down
24 changes: 16 additions & 8 deletions src/boards/board_PICGenios.cc
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,14 @@ cboard_PICGenios::cboard_PICGenios(void) {
heater_pwr = 0;
cooler_pwr = 0;

vent[0] = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() + "boards/Common/VT1.svg");
vent[1] = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() + "boards/Common/VT2.svg");
lcdbmp[0] = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() + "boards/Common/lcd2.svg");
lcdbmp[1] = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() + "boards/Common/lcd4.svg");
vent[0] = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/VT1.svg").c_str(), 1.0, 0, 0}});
vent[1] = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/VT2.svg").c_str(), 1.0, 0, 0}});
lcdbmp[0] = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/lcd2.svg").c_str(), 1.0, 0, 0}});
lcdbmp[1] = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/lcd4.svg").c_str(), 1.0, 0, 0}});

lcd_init(&lcd, 16, 2, this);
mi2c_init(&mi2c, 4);
Expand Down Expand Up @@ -319,10 +323,14 @@ void cboard_PICGenios::SetScale(double scale) {
PICSimLab.CanvasCmd({CC_FREEBITMAP, .FreeBitmap{lcdbmp[0]}});
PICSimLab.CanvasCmd({CC_FREEBITMAP, .FreeBitmap{lcdbmp[1]}});

vent[0] = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() + "boards/Common/VT1.svg", Scale);
vent[1] = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() + "boards/Common/VT2.svg", Scale);
lcdbmp[0] = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() + "boards/Common/lcd2.svg", Scale);
lcdbmp[1] = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() + "boards/Common/lcd4.svg", Scale);
vent[0] = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/VT1.svg").c_str(), Scale, 0, 0}});
vent[1] = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/VT2.svg").c_str(), Scale, 0, 0}});
lcdbmp[0] = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/lcd2.svg").c_str(), Scale, 0, 0}});
lcdbmp[1] = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/lcd4.svg").c_str(), Scale, 0, 0}});
}
}
}
Expand Down
12 changes: 8 additions & 4 deletions src/boards/board_RemoteTCP.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ cboard_RemoteTCP::cboard_RemoteTCP(void) {
Proc = "Ripes"; // default microcontroller if none defined in preferences
ReadMaps(); // Read input and output board maps

micbmp = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() + "boards/Common/ic48.svg", Scale, 1);
micbmp = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/ic48.svg").c_str(), Scale, 1, 0}});

// TODO define pins

Expand Down Expand Up @@ -224,11 +225,14 @@ int cboard_RemoteTCP::MInit(const char* processor, const char* fname, float freq

ret = bsim_remote::MInit(processor, fname, freq);

int bmp = PICSimLab.LoadImageFile(
PICSimLab.GetSharePath() + "boards/Common/ic" + std::to_string(MGetPinCount()) + ".svg", Scale, 1);
int bmp = PICSimLab.CanvasCmd(
{CC_LOADIMAGE,
.LoadImage{(PICSimLab.GetSharePath() + "boards/Common/ic" + std::to_string(MGetPinCount()) + ".svg").c_str(),
Scale, 1, 0}});

if (bmp < 0) {
bmp = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() + "boards/Common/ic6.svg", Scale, 1);
bmp = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/ic6.svg").c_str(), Scale, 1, 0}});
printf("picsimlab: IC package with %i pins not found!\n", MGetPinCount());
printf("picsimlab: %s not found!\n",
(const char*)(PICSimLab.GetSharePath() + "boards/Common/ic" + std::to_string(MGetPinCount()) + ".svg")
Expand Down
21 changes: 14 additions & 7 deletions src/boards/board_gpboard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ unsigned short cboard_gpboard::GetOutputId(char* name) {
cboard_gpboard::cboard_gpboard(void) {
Proc = "pic16f628a"; // default microcontroller if none defined in preferences
ReadMaps(); // Read input and output board maps
micbmp = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() + "boards/Common/ic40.svg", Scale, 1);
micbmp = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/ic40.svg").c_str(), Scale, 1, 0}});
serialfd = INVALID_SERIAL;
}

Expand Down Expand Up @@ -350,11 +351,14 @@ int cboard_gpboard::MInit(const char* processor, const char* fname, float freq)
Proc = "pic16f628a";
}

int bmp = PICSimLab.LoadImageFile(
PICSimLab.GetSharePath() + "boards/Common/ic" + std::to_string(MGetPinCount()) + ".svg", Scale, 1);
int bmp = PICSimLab.CanvasCmd(
{CC_LOADIMAGE,
.LoadImage{(PICSimLab.GetSharePath() + "boards/Common/ic" + std::to_string(MGetPinCount()) + ".svg").c_str(),
Scale, 1, 0}});

if (bmp < 0) {
bmp = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() + "boards/Common/ic6.svg", Scale, 1);
bmp = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/ic6.svg").c_str(), Scale, 1, 0}});
printf(
"picsimlab: IC package with %i pins not "
"found!\n",
Expand All @@ -377,11 +381,14 @@ void cboard_gpboard::SetScale(double scale) {

Scale = scale;

int bmp = PICSimLab.LoadImageFile(
PICSimLab.GetSharePath() + "boards/Common/ic" + std::to_string(MGetPinCount()) + ".svg", Scale, 1);
int bmp = PICSimLab.CanvasCmd(
{CC_LOADIMAGE,
.LoadImage{(PICSimLab.GetSharePath() + "boards/Common/ic" + std::to_string(MGetPinCount()) + ".svg").c_str(),
Scale, 1, 0}});

if (bmp < 0) {
bmp = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() + "boards/Common/ic6.svg", Scale, 1);
bmp = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/ic6.svg").c_str(), Scale, 1, 0}});
printf(
"picsimlab: IC package with %i pins not "
"found!\n",
Expand Down
21 changes: 14 additions & 7 deletions src/boards/board_uCboard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ unsigned short cboard_uCboard::GetOutputId(char* name) {
cboard_uCboard::cboard_uCboard(void) {
Proc = "C51"; // default microcontroller if none defined in preferences
ReadMaps(); // Read input and output board maps
micbmp = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() + "boards/Common/ic40.svg", Scale, 1);
micbmp = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/ic40.svg").c_str(), Scale, 1, 0}});
serialfd = INVALID_SERIAL;
}

Expand Down Expand Up @@ -365,11 +366,14 @@ int cboard_uCboard::MInit(const char* processor, const char* fname, float freq)
Proc = "C51";
}

int bmp = PICSimLab.LoadImageFile(
PICSimLab.GetSharePath() + "boards/Common/ic" + std::to_string(MGetPinCount()) + ".svg", Scale, 1);
int bmp = PICSimLab.CanvasCmd(
{CC_LOADIMAGE,
.LoadImage{(PICSimLab.GetSharePath() + "boards/Common/ic" + std::to_string(MGetPinCount()) + ".svg").c_str(),
Scale, 1, 0}});

if (bmp < 0) {
bmp = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() + "boards/Common/ic6.svg", Scale, 1);
bmp = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/ic6.svg").c_str(), Scale, 1, 0}});
printf(
"picsimlab: IC package with %i pins not "
"found!\n",
Expand All @@ -392,11 +396,14 @@ void cboard_uCboard::SetScale(double scale) {

Scale = scale;

int bmp = PICSimLab.LoadImageFile(
PICSimLab.GetSharePath() + "boards/Common/ic" + std::to_string(MGetPinCount()) + ".svg", Scale, 1);
int bmp = PICSimLab.CanvasCmd(
{CC_LOADIMAGE,
.LoadImage{(PICSimLab.GetSharePath() + "boards/Common/ic" + std::to_string(MGetPinCount()) + ".svg").c_str(),
Scale, 1, 0}});

if (bmp < 0) {
bmp = PICSimLab.LoadImageFile(PICSimLab.GetSharePath() + "boards/Common/ic6.svg", Scale, 1);
bmp = PICSimLab.CanvasCmd(
{CC_LOADIMAGE, .LoadImage{(PICSimLab.GetSharePath() + "boards/Common/ic6.svg").c_str(), Scale, 1, 0}});
printf(
"picsimlab: IC package with %i pins not "
"found!\n",
Expand Down
2 changes: 1 addition & 1 deletion src/devices/lcd_hd44780.cc
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ void lcd_on(lcd_t* lcd, int onoff) {
lcd_rst(lcd);
}

void lcd_draw(lcd_t* lcd, void (*CanvasCmd)(CanvasCmd_t), float x1, float y1, float w1, float h1, int picpwr) {
void lcd_draw(lcd_t* lcd, CanvasCmd_ft CanvasCmd, float x1, float y1, float w1, float h1, int picpwr) {
int l, c, x, y;
int loff = 0;
float w;
Expand Down
2 changes: 1 addition & 1 deletion src/devices/lcd_hd44780.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ void lcd_rst(lcd_t* lcd);
void lcd_init(lcd_t* lcd, unsigned char cnum, unsigned char lnum, board* pboard_);
void lcd_end(lcd_t* lcd);
void lcd_on(lcd_t* lcd, int onoff);
void lcd_draw(lcd_t* lcd, void (*CanvasCmd)(CanvasCmd_t), float x1, float y1, float w1, float h1, int picpwr);
void lcd_draw(lcd_t* lcd, CanvasCmd_ft CanvasCmd, float x1, float y1, float w1, float h1, int picpwr);

#endif
2 changes: 1 addition & 1 deletion src/devices/lcd_ili9341.cc
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ unsigned short lcd_ili9341_8_io(lcd_ili9341_t* lcd, const unsigned char** pins_v
return lcd->out;
}

void lcd_ili9341_draw(lcd_ili9341_t* lcd, void (*CanvasCmd)(CanvasCmd_t), const int x1, const int y1, const int w1,
void lcd_ili9341_draw(lcd_ili9341_t* lcd, CanvasCmd_ft CanvasCmd, const int x1, const int y1, const int w1,
const int h1, const int picpwr) {
unsigned short x, y;
unsigned char r, g, b;
Expand Down
2 changes: 1 addition & 1 deletion src/devices/lcd_ili9341.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void lcd_ili9341_update(lcd_ili9341_t* lcd);
unsigned char lcd_ili9341_SPI_io(lcd_ili9341_t* lcd, const unsigned char** pins_value);
unsigned short lcd_ili9341_8_io(lcd_ili9341_t* lcd, const unsigned char** pins_value);

void lcd_ili9341_draw(lcd_ili9341_t* lcd, void (*CanvasCmd)(CanvasCmd_t), const int x1, const int y1, const int w1,
void lcd_ili9341_draw(lcd_ili9341_t* lcd, CanvasCmd_ft CanvasCmd, const int x1, const int y1, const int w1,
const int h1, const int picpwr);

#endif // LCD_ILI9341
2 changes: 1 addition & 1 deletion src/devices/lcd_pcd8544.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ unsigned char lcd_pcd8544_io(lcd_pcd8544_t* lcd, unsigned char din, unsigned cha
return 1;
}

void lcd_pcd8544_draw(lcd_pcd8544_t* lcd, void (*CanvasCmd)(CanvasCmd_t), int x1, int y1, int w1, int h1, int picpwr) {
void lcd_pcd8544_draw(lcd_pcd8544_t* lcd, CanvasCmd_ft CanvasCmd, int x1, int y1, int w1, int h1, int picpwr) {
unsigned char x, y, z;

if (lcd->e) {
Expand Down
2 changes: 1 addition & 1 deletion src/devices/lcd_pcd8544.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ void lcd_pcd8544_update(lcd_pcd8544_t* lcd);
unsigned char lcd_pcd8544_io(lcd_pcd8544_t* lcd, unsigned char din, unsigned char clk, unsigned char ncs,
unsigned char nrst, unsigned char dc);

void lcd_pcd8544_draw(lcd_pcd8544_t* lcd, void (*CanvasCmd)(CanvasCmd_t), int x1, int y1, int w1, int h1, int picpwr);
void lcd_pcd8544_draw(lcd_pcd8544_t* lcd, CanvasCmd_ft CanvasCmd, int x1, int y1, int w1, int h1, int picpwr);

#endif // LCD_PCD8544
2 changes: 1 addition & 1 deletion src/devices/lcd_pcf8833.cc
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ unsigned char lcd_pcf8833_io(lcd_pcf8833_t* lcd, unsigned char pdat, unsigned ch
return 1;
}

void lcd_pcf8833_draw(lcd_pcf8833_t* lcd, void (*CanvasCmd)(CanvasCmd_t), int x1, int y1, int w1, int h1, int picpwr) {
void lcd_pcf8833_draw(lcd_pcf8833_t* lcd, CanvasCmd_ft CanvasCmd, int x1, int y1, int w1, int h1, int picpwr) {
unsigned char x, y;

// canvas->Rectangle (1, x1, y1, w1, h1);//erase all
Expand Down
2 changes: 1 addition & 1 deletion src/devices/lcd_pcf8833.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ void lcd_pcf8833_update(lcd_pcf8833_t* lcd);
unsigned char lcd_pcf8833_io(lcd_pcf8833_t* lcd, unsigned char pdat, unsigned char clk, unsigned char ncs,
unsigned char nrst);

void lcd_pcf8833_draw(lcd_pcf8833_t* lcd, void (*CanvasCmd)(CanvasCmd_t), int x1, int y1, int w1, int h1, int picpwr);
void lcd_pcf8833_draw(lcd_pcf8833_t* lcd, CanvasCmd_ft CanvasCmd, int x1, int y1, int w1, int h1, int picpwr);

#endif // LCD_PCF8833
2 changes: 1 addition & 1 deletion src/devices/lcd_ssd1306.cc
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ unsigned char lcd_ssd1306_I2C_io(lcd_ssd1306_t* lcd, unsigned char sda, unsigned
return ret;
}

void lcd_ssd1306_draw(lcd_ssd1306_t* lcd, void (*CanvasCmd)(CanvasCmd_t), int x1, int y1, int w1, int h1, int picpwr) {
void lcd_ssd1306_draw(lcd_ssd1306_t* lcd, CanvasCmd_ft CanvasCmd, int x1, int y1, int w1, int h1, int picpwr) {
unsigned char x, y, z;

lcd->update = 0;
Expand Down
Loading

0 comments on commit 8423dc3

Please sign in to comment.