...
The table below shows the name of µC/CPU files and where they should be placed on the computer used to develop a µC/OS-III-based application. The file names in bold are files you will need to create or modify for your own port.
Panel | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Panel | ||
---|---|---|
| ||
|
cpu_bsp.c
This file contains skeleton functions for CPU_TS_TmrInit()
, CPU_TS_TmrRd()
and other time stamp related functions. You can copy this file to your Board Support Package (BSP) directory, modify its content and add it to your build.
...
The table below shows the name of µC/CPU ‘template’ files you should use as a starting point should you decide to start a µC/CPU port from scratch. It’s highly recommended that you copy these files to folders that matches the layout shown in this table. You would then edit these files to build up your own µC/CPU port files. Again, refer to the µC/CPU User’s Manual (uC-CPU-Manual.pdf
) found in \Micrium\Software\uC-CPU\Doc
.
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
|
cpu.h
Many CPUs have different word lengths and cpu.h
declares a series of type definitions that ensure portability. Specifically, we don’t use the C data types int
, short
, long
, char
, etc. at Micrium. Instead, clearer data types are defined. Consult your compiler documentation to determine whether the standard declarations described below need to be changed for the CPU/compiler you are using. You should note that the typedef
s below are not all grouped together in cpu.h
and also, cpu.h
contains additional comments about these data types.
Code Block | ||
---|---|---|
| ||
typedef void CPU_VOID;
typedef unsigned char CPU_CHAR;
typedef unsigned char CPU_BOOLEAN;
typedef unsigned char CPU_INT08U;
typedef signed char CPU_INT08S;
typedef unsigned short CPU_INT16U;
typedef signed short CPU_INT16S;
typedef unsigned int CPU_INT32U;
typedef signed int CPU_INT32S;
typedef unsigned long long CPU_INT64U;
typedef signed long long CPU_INT64S;
typedef float CPU_FP32;
typedef double CPU_FP64;
typedef volatile CPU_INT08U CPU_REG08;
typedef volatile CPU_INT16U CPU_REG16;
typedef volatile CPU_INT32U CPU_REG32;
typedef volatile CPU_INT64U CPU_REG64;
typedef void (*CPU_FNCT_VOID)(void);
typedef void (*CPU_FNCT_PTR )(void *);
typedef CPU_INT32U CPU_ADDR;
typedef CPU_INT32U CPU_DATA;
typedef CPU_DATA CPU_ALIGN;
typedef CPU_ADDR CPU_SIZE_T;
typedef CPU_INT32U CPU_STK; (1)
typedef CPU_ADDR CPU_STK_SIZE;
typedef CPU_INT16U CPU_ERR;
typedef CPU_INT32U CPU_SR; (2)
typedef CPU_INT32U CPU_TS; (3) |
Panel | ||
---|---|---|
| ||
(1) Especially important for µC/OS-III is the definition of the (2) (3) The |
cpu.h
also declares macros to disable and enable interrupts: CPU_CRITICAL_ENTER()
and CPU_CRITICAL_EXIT()
, respectively. The documentation in the template file explains how to declare these macros.
...
CPU_CRITICAL_METHOD_STATUS_LOCAL
cpu.h
also declares function prototypes for a number of functions found in either cpu_c.c
or cpu_a.asm
.
...