Closed TibaChang closed 8 years ago
The problem above are solved. "cmsis" becomes a submodule in this project!
I ckick the "close button"
mindlessly!
All commits are squashed!
Please read coding-style.txt carefully.
Decouple git-submodule from the commit.
astyle command
into Makefile,it can format all the .c
and .h
files in core/
and platform
.
08-CMSIS
is formatted!src->source
and inc->include
Makefile + rules.mk
provides a very portable version.
no more than 5 lines
can finish their porting job in the Makefile.rules.mk
encapsulate all of the device dependent directories.People should not modify these rules.HTTPS
clone URL
is updated and double checked.08-CMSIS
is ready.Please follow the naming convention of UNIX, which use "src" for "source" (via The Jargon File).
Make rules
make p103
or make target PLAT=p103
will build the binary and relevant files.eval
to derive almost all of the device relevant variable,so some of your suggestion about Makefile are ill-suited,but I adapt the ideas and do some of them in other ways.I am wondering how to avoid exposing the UART initialization. I think this is inevitable.
If you check the design of RExOS, you will figure out the techniques of platform abstractions including UART handling. File kernel/kstream.[ch]
implement the generic UNIX-like interface functions associating a stream with opened files. We should minimize the invocation of peripherals in file os.c
as possible as we can, so that we can maintain it easily.
typedef enum{
USART,
}STREAM;
void stream_init(STREAM stream_type);
void stream_write(STREAM stream_type,const char *data);
Move core/include/uart.h
into platform/[p103,f429disco]/include
dir
README.md
: check Comma and Space. We prefer "this is a string, indicating the type" over "his is a string,indicating the type".
You have to put the license notice in cmsis
submodule, that is crucial for derived open source projects. Typically, file LICENSE
.
Built upon STREAM abstraction, we can provide some shortcut functions such as puts
and putc
.
README
and add more details,such as "USART" info,etc.p103
use cmsis for registers.
cmsis
submodulecore/src/thread.c
use core_cm[3/4].h
, core_cmFunc.h
and core_cmInstr.h
.puts
macro as a shortcut for stream_write
Change into:
CONTROL_Type setPSP_Thread = {
.b.nPRIV = 1,
.b.SPSEL = 1
};
Done!
Portable Version with CMSIS