mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 01:41:37 +08:00
Completes coding of the PWM module
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4200 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/statfs.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "ficl.h"
|
||||
|
||||
void *ficlMalloc(size_t size)
|
||||
{
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
void *ficlRealloc(void *p, size_t size)
|
||||
{
|
||||
return realloc(p, size);
|
||||
}
|
||||
|
||||
void ficlFree(void *p)
|
||||
{
|
||||
free(p);
|
||||
}
|
||||
|
||||
void ficlCallbackDefaultTextOut(ficlCallback *callback, char *message)
|
||||
{
|
||||
FICL_IGNORE(callback);
|
||||
if (message != NULL)
|
||||
fputs(message, stdout);
|
||||
else
|
||||
fflush(stdout);
|
||||
return;
|
||||
}
|
||||
|
||||
int ficlFileStatus(char *filename, int *status)
|
||||
{
|
||||
struct stat statbuf;
|
||||
if (stat(filename, &statbuf) == 0)
|
||||
{
|
||||
*status = statbuf.st_mode;
|
||||
return 0;
|
||||
}
|
||||
*status = ENOENT;
|
||||
return -1;
|
||||
}
|
||||
|
||||
long ficlFileSize(ficlFile *ff)
|
||||
{
|
||||
struct stat statbuf;
|
||||
if (ff == NULL)
|
||||
return -1;
|
||||
|
||||
statbuf.st_size = -1;
|
||||
if (fstat(fileno(ff->f), &statbuf) != 0)
|
||||
return -1;
|
||||
|
||||
return statbuf.st_size;
|
||||
}
|
||||
|
||||
void ficlSystemCompilePlatform(ficlSystem *system)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
#include <stdint.h>
|
||||
|
||||
typedef int8_t ficlInteger8;
|
||||
typedef uint8_t ficlUnsigned8;
|
||||
typedef int16_t ficlInteger16;
|
||||
typedef uint16_t ficlUnsigned16;
|
||||
typedef int32_t ficlInteger32;
|
||||
typedef uint32_t ficlUnsigned32;
|
||||
|
||||
typedef intptr_t ficlInteger;
|
||||
typedef uintptr_t ficlUnsigned;
|
||||
typedef float ficlFloat;
|
||||
|
||||
#define FICL_PLATFORM_BASIC_TYPES (1)
|
||||
#define FICL_PLATFORM_HAS_2INTEGER (0)
|
||||
#define FICL_PLATFORM_HAS_FTRUNCATE (0)
|
||||
|
||||
#define FICL_PLATFORM_OS "ansi"
|
||||
#define FICL_PLATFORM_ARCHITECTURE "unknown"
|
||||
Reference in New Issue
Block a user