Merge branch 'master' of https://bitbucket.org/Tectu/ugfx
This commit is contained in:
commit
8252747a36
6 changed files with 28 additions and 7 deletions
|
@ -1,4 +1,7 @@
|
|||
#include "../../../gfx.h"
|
||||
#undef Red
|
||||
#undef Green
|
||||
#undef Blue
|
||||
#include "stm32f746g_discovery_sdram.h"
|
||||
#include "stm32f7xx_hal_rcc.h"
|
||||
#include "stm32f7xx_hal_dma.h"
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
#include "../../../gfx.h"
|
||||
#undef Red
|
||||
#undef Green
|
||||
#undef Blue
|
||||
#include "stm32f7xx.h"
|
||||
|
||||
#if !defined (HSE_VALUE)
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
#include "../../../gfx.h"
|
||||
#undef Red
|
||||
#undef Green
|
||||
#undef Blue
|
||||
#include "stm32f7xx_hal.h"
|
||||
|
||||
#if GFX_USE_OS_CHIBIOS
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
#include "gfx.h"
|
||||
#undef Red
|
||||
#undef Green
|
||||
#undef Blue
|
||||
#include "stm32f7_i2c.h"
|
||||
|
||||
/*
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#error "GOS: CH_USE_SEMAPHORES must be defined in chconf.h"
|
||||
#endif
|
||||
|
||||
#elif CH_KERNEL_MAJOR == 3
|
||||
#elif (CH_KERNEL_MAJOR == 3) || (CH_KERNEL_MAJOR == 4)
|
||||
|
||||
#if !CH_CFG_USE_MUTEXES
|
||||
#error "GOS: CH_CFG_USE_MUTEXES must be defined in chconf.h"
|
||||
|
@ -42,7 +42,7 @@ void _gosInit(void)
|
|||
halInit();
|
||||
chSysInit();
|
||||
}
|
||||
#elif CH_KERNEL_MAJOR == 3
|
||||
#elif (CH_KERNEL_MAJOR == 3) || (CH_KERNEL_MAJOR == 4)
|
||||
if (!chThdGetSelfX()) {
|
||||
halInit();
|
||||
chSysInit();
|
||||
|
@ -102,7 +102,7 @@ void gfxSemInit(gfxSem *psem, semcount_t val, semcount_t limit)
|
|||
|
||||
#if CH_KERNEL_MAJOR == 2
|
||||
chSemInit(&psem->sem, val);
|
||||
#elif CH_KERNEL_MAJOR == 3
|
||||
#elif (CH_KERNEL_MAJOR == 3) || (CH_KERNEL_MAJOR == 4)
|
||||
chSemObjectInit(&psem->sem, val);
|
||||
#endif
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ bool_t gfxSemWait(gfxSem *psem, delaytime_t ms)
|
|||
case TIME_INFINITE: chSemWait(&psem->sem); return TRUE;
|
||||
default: return chSemWaitTimeout(&psem->sem, MS2ST(ms)) != RDY_TIMEOUT;
|
||||
}
|
||||
#elif CH_KERNEL_MAJOR == 3
|
||||
#elif (CH_KERNEL_MAJOR == 3) || (CH_KERNEL_MAJOR == 4)
|
||||
switch(ms) {
|
||||
case TIME_IMMEDIATE: return chSemWaitTimeout(&psem->sem, TIME_IMMEDIATE) != MSG_TIMEOUT;
|
||||
case TIME_INFINITE: chSemWait(&psem->sem); return TRUE;
|
||||
|
@ -158,7 +158,11 @@ gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, threadpriority_
|
|||
{
|
||||
if (!stackarea) {
|
||||
if (!stacksz) stacksz = 256;
|
||||
#if (CH_KERNEL_MAJOR == 2) || (CH_KERNEL_MAJOR == 3)
|
||||
return chThdCreateFromHeap(0, stacksz, prio, (tfunc_t)fn, param);
|
||||
#elif CH_KERNEL_MAJOR == 4
|
||||
return chThdCreateFromHeap(0, stacksz, "ugfx", prio, (tfunc_t)fn, param);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!stacksz)
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#if !defined(TRUE)
|
||||
#define TRUE -1
|
||||
#endif
|
||||
#if CH_KERNEL_MAJOR == 3
|
||||
#if (CH_KERNEL_MAJOR == 3) || (CH_KERNEL_MAJOR == 4)
|
||||
typedef char bool_t;
|
||||
#endif
|
||||
|
||||
|
@ -66,7 +66,7 @@ typedef tprio_t threadpriority_t;
|
|||
|
||||
typedef Mutex gfxMutex;
|
||||
typedef Thread* gfxThreadHandle;
|
||||
#elif CH_KERNEL_MAJOR == 3
|
||||
#elif (CH_KERNEL_MAJOR == 3) || (CH_KERNEL_MAJOR == 4)
|
||||
#undef DECLARE_THREAD_STACK
|
||||
#define DECLARE_THREAD_STACK(a, b) THD_WORKING_AREA(a, b)
|
||||
|
||||
|
@ -95,7 +95,7 @@ extern "C" {
|
|||
#define gfxMutexExit(pmutex) chMtxUnlock()
|
||||
#define gfxExit() chSysHalt()
|
||||
#define gfxHalt(msg) { chDbgPanic(msg); chSysHalt(); }
|
||||
#elif CH_KERNEL_MAJOR == 3
|
||||
#elif (CH_KERNEL_MAJOR == 3) || (CH_KERNEL_MAJOR == 4)
|
||||
#define gfxSystemTicks() chVTGetSystemTimeX()
|
||||
#define gfxMutexInit(pmutex) chMtxObjectInit(pmutex)
|
||||
#define gfxMutexExit(pmutex) chMtxUnlock(pmutex)
|
||||
|
@ -120,8 +120,13 @@ bool_t gfxSemWait(gfxSem *psem, delaytime_t ms);
|
|||
bool_t gfxSemWaitI(gfxSem *psem);
|
||||
void gfxSemSignal(gfxSem *psem);
|
||||
void gfxSemSignalI(gfxSem *psem);
|
||||
#if (CH_KERNEL_MAJOR == 2) || (CH_KERNEL_MAJOR == 3)
|
||||
#define gfxSemCounterI(psem) ((psem)->sem.s_cnt)
|
||||
#define gfxSemCounter(psem) ((psem)->sem.s_cnt)
|
||||
#elif (CH_KERNEL_MAJOR == 4)
|
||||
#define gfxSemCounterI(psem) ((psem)->sem.cnt)
|
||||
#define gfxSemCounter(psem) ((psem)->sem.cnt)
|
||||
#endif
|
||||
gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, threadpriority_t prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param);
|
||||
#define gfxThreadWait(thread) chThdWait(thread)
|
||||
#define gfxThreadMe() chThdSelf()
|
||||
|
|
Loading…
Add table
Reference in a new issue