drivers/lcd: ssd1306: separate lcd_dev_s setup to separate object. g_oleddev takes 1 KiB because framebuffer and was allocated to .data section because of lcd_dev_s function pointer setup. Move lcd_dev_s setup out, so that g_oleddev goes to .bss and avoid wasting ROM.
This commit is contained in:
parent
89cc4741ac
commit
a099506b1b
@ -221,28 +221,29 @@ static const struct lcd_planeinfo_s g_planeinfo =
|
||||
.bpp = SSD1306_DEV_BPP, /* Bits-per-pixel */
|
||||
};
|
||||
|
||||
/* This is the outside visible interface for the OLED driver */
|
||||
|
||||
static const struct lcd_dev_s g_oleddev_dev =
|
||||
{
|
||||
/* LCD Configuration */
|
||||
|
||||
.getvideoinfo = ssd1306_getvideoinfo,
|
||||
.getplaneinfo = ssd1306_getplaneinfo,
|
||||
|
||||
/* LCD RGB Mapping -- Not supported */
|
||||
/* Cursor Controls -- Not supported */
|
||||
|
||||
/* LCD Specific Controls */
|
||||
|
||||
.getpower = ssd1306_getpower,
|
||||
.setpower = ssd1306_setpower,
|
||||
.getcontrast = ssd1306_getcontrast,
|
||||
.setcontrast = ssd1306_setcontrast,
|
||||
};
|
||||
|
||||
/* This is the OLED driver instance (only a single device is supported for now) */
|
||||
|
||||
static struct ssd1306_dev_s g_oleddev =
|
||||
{
|
||||
.dev =
|
||||
{
|
||||
/* LCD Configuration */
|
||||
|
||||
.getvideoinfo = ssd1306_getvideoinfo,
|
||||
.getplaneinfo = ssd1306_getplaneinfo,
|
||||
|
||||
/* LCD RGB Mapping -- Not supported */
|
||||
/* Cursor Controls -- Not supported */
|
||||
|
||||
/* LCD Specific Controls */
|
||||
|
||||
.getpower = ssd1306_getpower,
|
||||
.setpower = ssd1306_setpower,
|
||||
.getcontrast = ssd1306_getcontrast,
|
||||
.setcontrast = ssd1306_setcontrast,
|
||||
},
|
||||
};
|
||||
static struct ssd1306_dev_s g_oleddev;
|
||||
|
||||
/**************************************************************************************
|
||||
* Private Functions
|
||||
@ -1035,6 +1036,8 @@ FAR struct lcd_dev_s *ssd1306_initialize(FAR struct i2c_master_s *dev,
|
||||
{
|
||||
FAR struct ssd1306_dev_s *priv = &g_oleddev;
|
||||
|
||||
priv->dev = g_oleddev_dev;
|
||||
|
||||
DEBUGASSERT(dev && devno == 0);
|
||||
|
||||
priv->on = false;
|
||||
|
Loading…
Reference in New Issue
Block a user