GDISP updates to match previous GDRIVER and multiple display updates
This commit is contained in:
parent
16fbcdc0b5
commit
3a520359a0
4 changed files with 17 additions and 8 deletions
|
@ -287,7 +287,7 @@ struct GDisplay {
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct GDISPVMT {
|
typedef struct GDISPVMT {
|
||||||
GDriverVMT vmtdriver;
|
GDriverVMT d;
|
||||||
bool_t (*init)(GDisplay *g);
|
bool_t (*init)(GDisplay *g);
|
||||||
void (*deinit)(GDisplay *g);
|
void (*deinit)(GDisplay *g);
|
||||||
void (*writestart)(GDisplay *g); // Uses p.x,p.y p.cx,p.cy
|
void (*writestart)(GDisplay *g); // Uses p.x,p.y p.cx,p.cy
|
||||||
|
@ -617,7 +617,7 @@ typedef struct GDISPVMT {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Routines needed by the general driver VMT
|
// Routines needed by the general driver VMT
|
||||||
bool_t _gdispInitDriver(GDriver *g, int driverinstance, int systeminstance);
|
bool_t _gdispInitDriver(GDriver *g, unsigned driverinstance, unsigned systeminstance);
|
||||||
void _gdispPostInitDriver(GDriver *g);
|
void _gdispPostInitDriver(GDriver *g);
|
||||||
void _gdispDeInitDriver(GDriver *g);
|
void _gdispDeInitDriver(GDriver *g);
|
||||||
|
|
||||||
|
|
|
@ -569,7 +569,7 @@ void _gdispInit(void)
|
||||||
// GDISP_DRIVER_LIST is defined - create each driver instance
|
// GDISP_DRIVER_LIST is defined - create each driver instance
|
||||||
#if defined(GDISP_DRIVER_LIST)
|
#if defined(GDISP_DRIVER_LIST)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned i;
|
||||||
|
|
||||||
extern GDriverVMTList GDISP_DRIVER_LIST;
|
extern GDriverVMTList GDISP_DRIVER_LIST;
|
||||||
static const struct GDriverVMT const * dclist[] = {GDISP_DRIVER_LIST};
|
static const struct GDriverVMT const * dclist[] = {GDISP_DRIVER_LIST};
|
||||||
|
@ -579,7 +579,8 @@ void _gdispInit(void)
|
||||||
}
|
}
|
||||||
#elif GDISP_TOTAL_DISPLAYS > 1
|
#elif GDISP_TOTAL_DISPLAYS > 1
|
||||||
{
|
{
|
||||||
int i;
|
unsigned i;
|
||||||
|
extern GDriverVMTList GDISPVMT_OnlyOne;
|
||||||
|
|
||||||
for(i = 0; i < GDISP_TOTAL_DISPLAYS; i++)
|
for(i = 0; i < GDISP_TOTAL_DISPLAYS; i++)
|
||||||
gdriverRegister(GDISPVMT_OnlyOne);
|
gdriverRegister(GDISPVMT_OnlyOne);
|
||||||
|
@ -622,7 +623,7 @@ void _gdispDeinit(void)
|
||||||
/* ToDo */
|
/* ToDo */
|
||||||
}
|
}
|
||||||
|
|
||||||
bool_t _gdispInitDriver(GDriver *g, int driverinstance, int systeminstance) {
|
bool_t _gdispInitDriver(GDriver *g, unsigned driverinstance, unsigned systeminstance) {
|
||||||
#define gd ((GDisplay *)g)
|
#define gd ((GDisplay *)g)
|
||||||
bool_t ret;
|
bool_t ret;
|
||||||
|
|
||||||
|
@ -694,10 +695,18 @@ void _gdispDeInitDriver(GDriver *g) {
|
||||||
#undef gd
|
#undef gd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GDisplay *gdispGetDisplay(unsigned display) {
|
||||||
|
return (GDisplay *)gdriverGetInstance(GDRIVER_TYPE_DISPLAY, display);
|
||||||
|
}
|
||||||
|
|
||||||
void gdispSetDisplay(GDisplay *g) {
|
void gdispSetDisplay(GDisplay *g) {
|
||||||
if (g) GDISP = g;
|
if (g) GDISP = g;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned gdispGetDisplayCount(void) {
|
||||||
|
return gdriverInstanceCount(GDRIVER_TYPE_DISPLAY);
|
||||||
|
}
|
||||||
|
|
||||||
coord_t gdispGGetWidth(GDisplay *g) { return g->g.Width; }
|
coord_t gdispGGetWidth(GDisplay *g) { return g->g.Width; }
|
||||||
coord_t gdispGGetHeight(GDisplay *g) { return g->g.Height; }
|
coord_t gdispGGetHeight(GDisplay *g) { return g->g.Height; }
|
||||||
powermode_t gdispGGetPowerMode(GDisplay *g) { return g->g.Powermode; }
|
powermode_t gdispGGetPowerMode(GDisplay *g) { return g->g.Powermode; }
|
||||||
|
|
|
@ -219,7 +219,7 @@ color_t gdispContrastColor(color_t color);
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
#define gdispGetDisplay(display) ((GDisplay *)gdriverGetInstance(GDRIVER_TYPE_DISPLAY, display))
|
GDisplay *gdispGetDisplay(unsigned display);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the current default display to the specified display
|
* @brief Set the current default display to the specified display
|
||||||
|
@ -241,7 +241,7 @@ void gdispSetDisplay(GDisplay *g);
|
||||||
*
|
*
|
||||||
* @note Displays are numbered from 0 to @p gdispGetDisplayCount() - 1
|
* @note Displays are numbered from 0 to @p gdispGetDisplayCount() - 1
|
||||||
*/
|
*/
|
||||||
#define gdispGetDisplayCount() gdriverInstanceCount(GDRIVER_TYPE_DISPLAY)
|
unsigned gdispGetDisplayCount(void);
|
||||||
|
|
||||||
/* Property Functions */
|
/* Property Functions */
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#endif
|
#endif
|
||||||
#if defined(GDISP_DRIVER_LIST)
|
#if defined(GDISP_DRIVER_LIST)
|
||||||
#if GDISP_TOTAL_DISPLAYS != 1
|
#if GDISP_TOTAL_DISPLAYS != 1
|
||||||
#error "GDISP Multiple Drivers: You can't specify both GDISP_TOTAL_DISPLAYS and GDISP_DRIVER_LIST
|
#error "GDISP Multiple Drivers: You can't specify both GDISP_TOTAL_DISPLAYS and GDISP_DRIVER_LIST"
|
||||||
#endif
|
#endif
|
||||||
#ifndef GDISP_PIXELFORMAT
|
#ifndef GDISP_PIXELFORMAT
|
||||||
#error "GDISP Multiple Drivers: You must specify a value for GDISP_PIXELFORMAT when using GDISP_DRIVER_LIST"
|
#error "GDISP Multiple Drivers: You must specify a value for GDISP_PIXELFORMAT when using GDISP_DRIVER_LIST"
|
||||||
|
|
Loading…
Add table
Reference in a new issue