GDISP updates to match previous GDRIVER and multiple display updates

ugfx_release_2.6
inmarket 2014-09-17 09:34:08 +10:00
parent 16fbcdc0b5
commit 3a520359a0
4 changed files with 17 additions and 8 deletions

View File

@ -287,7 +287,7 @@ struct GDisplay {
};
typedef struct GDISPVMT {
GDriverVMT vmtdriver;
GDriverVMT d;
bool_t (*init)(GDisplay *g);
void (*deinit)(GDisplay *g);
void (*writestart)(GDisplay *g); // Uses p.x,p.y p.cx,p.cy
@ -617,7 +617,7 @@ typedef struct GDISPVMT {
#endif
// 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 _gdispDeInitDriver(GDriver *g);

View File

@ -569,7 +569,7 @@ void _gdispInit(void)
// GDISP_DRIVER_LIST is defined - create each driver instance
#if defined(GDISP_DRIVER_LIST)
{
int i;
unsigned i;
extern GDriverVMTList GDISP_DRIVER_LIST;
static const struct GDriverVMT const * dclist[] = {GDISP_DRIVER_LIST};
@ -579,7 +579,8 @@ void _gdispInit(void)
}
#elif GDISP_TOTAL_DISPLAYS > 1
{
int i;
unsigned i;
extern GDriverVMTList GDISPVMT_OnlyOne;
for(i = 0; i < GDISP_TOTAL_DISPLAYS; i++)
gdriverRegister(GDISPVMT_OnlyOne);
@ -622,7 +623,7 @@ void _gdispDeinit(void)
/* ToDo */
}
bool_t _gdispInitDriver(GDriver *g, int driverinstance, int systeminstance) {
bool_t _gdispInitDriver(GDriver *g, unsigned driverinstance, unsigned systeminstance) {
#define gd ((GDisplay *)g)
bool_t ret;
@ -694,10 +695,18 @@ void _gdispDeInitDriver(GDriver *g) {
#undef gd
}
GDisplay *gdispGetDisplay(unsigned display) {
return (GDisplay *)gdriverGetInstance(GDRIVER_TYPE_DISPLAY, display);
}
void gdispSetDisplay(GDisplay *g) {
if (g) GDISP = g;
}
unsigned gdispGetDisplayCount(void) {
return gdriverInstanceCount(GDRIVER_TYPE_DISPLAY);
}
coord_t gdispGGetWidth(GDisplay *g) { return g->g.Width; }
coord_t gdispGGetHeight(GDisplay *g) { return g->g.Height; }
powermode_t gdispGGetPowerMode(GDisplay *g) { return g->g.Powermode; }

View File

@ -219,7 +219,7 @@ color_t gdispContrastColor(color_t color);
*
* @api
*/
#define gdispGetDisplay(display) ((GDisplay *)gdriverGetInstance(GDRIVER_TYPE_DISPLAY, display))
GDisplay *gdispGetDisplay(unsigned 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
*/
#define gdispGetDisplayCount() gdriverInstanceCount(GDRIVER_TYPE_DISPLAY)
unsigned gdispGetDisplayCount(void);
/* Property Functions */

View File

@ -26,7 +26,7 @@
#endif
#if defined(GDISP_DRIVER_LIST)
#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
#ifndef GDISP_PIXELFORMAT
#error "GDISP Multiple Drivers: You must specify a value for GDISP_PIXELFORMAT when using GDISP_DRIVER_LIST"