Merge branch 'master' into newmouse

remotes/origin_old/ugfx_release_2.6
inmarket 2014-09-17 09:47:48 +10:00
commit 32eb6ff830
10 changed files with 29 additions and 21 deletions

View File

@ -161,7 +161,6 @@ static DECLARE_THREAD_FUNCTION(NetThread, param) {
SOCKET_TYPE listenfd, fdmax, i, clientfd; SOCKET_TYPE listenfd, fdmax, i, clientfd;
socklen_t len; socklen_t len;
int leni; int leni;
unsigned disp;
fd_set master, read_fds; fd_set master, read_fds;
struct sockaddr_in addr; struct sockaddr_in addr;
GDisplay * g; GDisplay * g;

View File

@ -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);

View File

@ -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; }

View File

@ -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 */

View File

@ -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"

View File

@ -34,9 +34,9 @@ void _gdriverDeinit(void) {
GDriver *gdriverRegister(const GDriverVMT *vmt) { GDriver *gdriverRegister(const GDriverVMT *vmt) {
GDriver *pd; GDriver * pd;
GDriver *dtail; GDriver * dtail;
int dinstance, sinstance; unsigned dinstance, sinstance;
// Loop to find the driver instance and the system instance numbers // Loop to find the driver instance and the system instance numbers
dinstance = sinstance = 0; dinstance = sinstance = 0;
@ -98,9 +98,9 @@ void gdriverUnRegister(GDriver *driver) {
gfxFree(driver); gfxFree(driver);
} }
GDriver *gdriverGetInstance(uint16_t type, int instance) { GDriver *gdriverGetInstance(uint16_t type, unsigned instance) {
GDriver *pd; GDriver *pd;
int sinstance; unsigned sinstance;
// Loop to find the system instance // Loop to find the system instance
sinstance = 0; sinstance = 0;
@ -114,9 +114,9 @@ GDriver *gdriverGetInstance(uint16_t type, int instance) {
return 0; return 0;
} }
int gdriverInstanceCount(uint16_t type) { unsigned gdriverInstanceCount(uint16_t type) {
GDriver *pd; GDriver *pd;
int sinstance; unsigned sinstance;
// Loop to count the system instances // Loop to count the system instances
sinstance = 0; sinstance = 0;

View File

@ -67,7 +67,7 @@ typedef struct GDriverVMT {
uint16_t type; // @< What type of driver this is uint16_t type; // @< What type of driver this is
uint16_t flags; // @< Flags for the driver. Meaning is specific to each driver type. uint16_t flags; // @< Flags for the driver. Meaning is specific to each driver type.
uint32_t objsize; // @< How big the runtime driver structure is uint32_t objsize; // @< How big the runtime driver structure is
bool_t (*init)(GDriver *driver, int driverinstance, int systeminstance); // @< Initialise the driver. Returns TRUE if OK. bool_t (*init)(GDriver *driver, unsigned driverinstance, unsigned systeminstance); // @< Initialise the driver. Returns TRUE if OK.
// driverinstance is the instance 0..n of this driver. // driverinstance is the instance 0..n of this driver.
// systeminstance is the instance 0..n of this type of device. // systeminstance is the instance 0..n of this type of device.
void (*postinit)(GDriver *driver); // @< Called once the driver is registered. void (*postinit)(GDriver *driver); // @< Called once the driver is registered.
@ -118,7 +118,7 @@ extern "C" {
* @param[in] type The type of driver to find * @param[in] type The type of driver to find
* @param[in] instance The instance (0..n) to find * @param[in] instance The instance (0..n) to find
*/ */
GDriver *gdriverGetInstance(uint16_t type, int instance); GDriver *gdriverGetInstance(uint16_t type, unsigned instance);
/** /**
* @brief Get the count of instances of a type of device * @brief Get the count of instances of a type of device
@ -128,7 +128,7 @@ extern "C" {
* *
* @param[in] type The type of driver to find * @param[in] type The type of driver to find
*/ */
int gdriverInstanceCount(uint16_t type); unsigned gdriverInstanceCount(uint16_t type);
/** /**
* @brief Get the next driver for a type of device * @brief Get the next driver for a type of device

View File

@ -14,7 +14,7 @@
#if GFX_USE_GFILE && GFILE_NEED_FATFS #if GFX_USE_GFILE && GFILE_NEED_FATFS
#include "gfile_fs.h" #include "gfile_fs.h"
#include "fatfs_wrapper.h" #include "gfile_fatfs_wrapper.h"
/******************************************************** /********************************************************
* The FAT file-system VMT * The FAT file-system VMT

View File

@ -14,7 +14,7 @@
#if GFX_USE_GFILE && GFILE_NEED_PETITFS #if GFX_USE_GFILE && GFILE_NEED_PETITFS
#include "gfile_fs.h" #include "gfile_fs.h"
#include "petitfs_wrapper.h" #include "gfile_petitfs_wrapper.h"
static bool_t petitfsExists(const char* fname); static bool_t petitfsExists(const char* fname);
static bool_t petitfsOpen(GFILE* f, const char* fname); static bool_t petitfsOpen(GFILE* f, const char* fname);

View File

@ -127,7 +127,7 @@
* @note PETITFS can only have one file open at a time. * @note PETITFS can only have one file open at a time.
*/ */
#ifndef GFILE_NEED_PETITFS #ifndef GFILE_NEED_PETITFS
#define GFILE_NEED_FATFS FALSE #define GFILE_NEED_PETITFS FALSE
#endif #endif
/** /**
* @brief Include the operating system's native file system * @brief Include the operating system's native file system