#include "rtk.h"
struct Thread mainThread;
int main(void)
{
// ... code before rtk is active
rtkInitialize(&mainThread, &rtkQueues[0]);
// ... code after rtk is active
// not exciting because with one thread, there isn't much you need to use
// from the RTK
while (1)
{
}
}
The file onethread.make is the makefile for this program. It is very minimalist, also.
MMCU = -mmcu=atmega128
COMMONOPT = -g $(MMCU)
ASFLAGS = $(COMMONOPT) -D__ASM__
CFLAGS = $(COMMONOPT) -O3 # don't forget, otherwise defaulted to 8515!
# the mmcu option also controls how the linker
# links (which linker script file to use)
LDFLAGS = -g $(MMCU)
MAIN_SRCFILE = onethread.c
C_SRCFILES = $(MAIN_SRCFILE)
ASM_SRCFILES = rtk.S
include main.make
The most critical part are explained here:
MMCU=-mmcu=atmega128
atmega128.
COMMONOPT = -g $(MMCU)
CFLAGS = $(COMMONOPT) -O3
-O3 is a very high level of
optimization.
LDFLAGS = -g $(MMCU)
MAIN_SRCFILE = onethread.c
main
function (entry point of the whole program).
C_SRCFILES = $(MAIN_SRCFILE)
MAIN_SRCFILE because that, too, is a
source file written in C.
ASM_SRCFILES = rtk.S
include main.make
main.make.
Copyright © 2008-10-25 by Tak Auyeung