OpenCores
URL https://opencores.org/ocsvn/mlite/mlite/trunk

Subversion Repositories mlite

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 149 to Rev 150
    Reverse comparison

Rev 149 → Rev 150

/trunk/kernel/rtos.h
12,9 → 12,13
#ifndef __RTOS_H__
#define __RTOS_H__
 
//#define printf UartPrintf
#define printf UartPrintfPoll
#define printf UartPrintf
//#define printf UartPrintfPoll
#define scanf UartScanf
#ifndef WIN32
#define malloc(S) OS_HeapMalloc(NULL, S)
#define free(S) OS_HeapFree(S)
#endif
 
// Typedefs
typedef unsigned int uint32;
25,6 → 29,7
#ifdef WIN32
uint32 MemoryRead(uint32 Address);
void MemoryWrite(uint32 Address, uint32 Value);
#define atoi atoi2
#else
#define MemoryRead(A) (*(volatile uint32*)(A))
#define MemoryWrite(A,V) *(volatile uint32*)(A)=(V)
31,6 → 36,7
#endif
 
/***************** LibC ******************/
#ifndef _LIBC
#ifndef NULL
#define NULL (void*)0
#endif
45,6 → 51,7
#define isalpha(c) (islower(c)||isupper(c))
#define isalnum(c) (isalpha(c)||isdigit(c))
#define min(a,b) ((a)<(b)?(a):(b))
#define memcpy memcpy2 //don't use built in version
 
char *strcpy(char *dst, const char *src);
char *strncpy(char *dst, const char *src, int count);
52,7 → 59,7
char *strncat(char *dst, const char *src, int count);
int strcmp(const char *string1, const char *string2);
int strncmp(const char *string1, const char *string2, int count);
char *strstr(char *string, char *find);
char *strstr(const char *string, const char *find);
int strlen(const char *string);
void *memcpy(void *dst, const void *src, unsigned long bytes);
void *memmove(void *dst, const void *src, unsigned long bytes);
59,16 → 66,20
int memcmp(const void *cs, const void *ct, unsigned long bytes);
void *memset(void *dst, int c, unsigned long bytes);
int abs(int n);
unsigned int rand(void);
int rand(void);
void srand(unsigned int seed);
long strtol(const char *s, const char **end, int base);
int atoi(const char *s);
void itoa(char *dst, int num, int base, int width);
char *itoa(int num, char *dst, int base);
void dump(const unsigned char *data, int length);
#ifndef NO_ELLIPSIS
int sprintf(char *s, const char *format, ...);
int sscanf(char *s, const char *format, ...);
#endif
#define _LIBC
#endif
 
 
/***************** Assembly **************/
#define OS_CriticalBegin() OS_AsmInterruptEnable(0)
#define OS_CriticalEnd(S) OS_AsmInterruptEnable(S)
170,6 → 181,7
void MainThread(void *Arg);
 
/***************** UART ******************/
typedef uint8* (*PacketGetFunc_t)(void);
void UartInit(void);
void UartWrite(int C);
uint8 UartRead(void);
181,12 → 193,18
void UartPrintfCritical(const char *format, ...);
void UartScanf(const char *format, ...);
#endif
void UartPacketConfig(PacketGetFunc_t PacketGetFunc,
int PacketSize,
OS_MQueue_t *mQueue);
void UartPacketSend(uint8 *Data, int Bytes);
int puts(const char *string);
int getch(void);
int kbhit(void);
void LogWrite(int a);
void LogDump(void);
void Led(int value);
 
 
/***************** Math ******************/
//IEEE single precision floating point math
#ifndef WIN32

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.