Browse Source

Updating KEIL port

remotes/origin_old/ugfx_release_2.6
Joel Bodenmann 7 years ago
parent
commit
73b39a7d36
  1. 9
      src/gos/gos_keil.c
  2. 10
      src/gos/gos_keil.h

9
src/gos/gos_keil.c

@ -68,15 +68,16 @@ void gfxSemSignalI(gfxSem* psem)
}
gfxThreadHandle gfxThreadCreate(void* stackarea, size_t stacksz, threadpriority_t prio, DECLARE_THREAD_FUNCTION((*fn),p), void* param)
{
{
osThreadDef_t def;
def.pthread = fn;
(void)stackarea;
def.pthread = (os_pthread)fn;
def.tpriority = prio;
def.instances = 1;
def.stacksize = stacksz;
(void)stackarea;
return osThreadCreate(&def, param);
}

10
src/gos/gos_keil.h

@ -15,6 +15,7 @@
#if GFX_USE_OS_KEIL
#include <stdbool.h>
#include "cmsis_os.h"
#ifndef GFX_OS_HEAP_SIZE
@ -25,7 +26,7 @@
/* Type definitions */
/*===========================================================================*/
typedef uint8_t bool_t;
typedef bool bool_t;
#define TIME_IMMEDIATE 0
#define TIME_INFINITE osWaitForever
@ -52,8 +53,9 @@ typedef struct gfxMutex {
typedef osThreadId gfxThreadHandle;
#define DECLARE_THREAD_STACK(name, sz)
#define DECLARE_THREAD_FUNCTION(fnName, param) threadreturn_t fnName(void* params)
#define DECLARE_THREAD_STACK(name, sz) uint8_t name[1]; // Some compilers don't allow zero sized arrays. Let's waste one byte
#define DECLARE_THREAD_FUNCTION(fnName, param) threadreturn_t fnName(void* param)
#define THREAD_RETURN(retval)
/*===========================================================================*/
/* Function declarations. */
@ -66,7 +68,7 @@ extern "C" {
#define gfxExit() os_error(0)
#define gfxHalt(msg) os_error(1)
#define gfxSystemTicks() osKernelSysTick()
#define gfxMillisecondsToTicks(ms) osKernelSysTickMicroSec(1000*(ms))
#define gfxMillisecondsToTicks(ms) osKernelSysTickMicroSec(1000*ms)
#define gfxSystemLock() osKernelInitialize()
#define gfxSystemUnlock() osKernelStart()
#define gfxSleepMilliseconds(ms) osDelay(ms)

Loading…
Cancel
Save