From f1df31b81779b51f63ab50c855b6a655289bd732 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 4 Oct 2007 17:39:44 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@36 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/Makefile | 627 +++++++++++++++++++++++++++++++++++++++ demos/AVR-AT90CANx-GCC/chconf.h | 158 ++++++++++ demos/AVR-AT90CANx-GCC/chcore.c | 26 ++ demos/AVR-AT90CANx-GCC/chcore.h | 106 +++++++ demos/AVR-AT90CANx-GCC/chcore2.S | 124 ++++++++ demos/AVR-AT90CANx-GCC/chtypes.h | 47 +++ demos/AVR-AT90CANx-GCC/main.c | 38 +++ 7 files changed, 1126 insertions(+) create mode 100644 demos/AVR-AT90CANx-GCC/Makefile create mode 100644 demos/AVR-AT90CANx-GCC/chconf.h create mode 100644 demos/AVR-AT90CANx-GCC/chcore.c create mode 100644 demos/AVR-AT90CANx-GCC/chcore.h create mode 100644 demos/AVR-AT90CANx-GCC/chcore2.S create mode 100644 demos/AVR-AT90CANx-GCC/chtypes.h create mode 100644 demos/AVR-AT90CANx-GCC/main.c (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/Makefile b/demos/AVR-AT90CANx-GCC/Makefile new file mode 100644 index 000000000..b65fb4a74 --- /dev/null +++ b/demos/AVR-AT90CANx-GCC/Makefile @@ -0,0 +1,627 @@ +# Hey Emacs, this is a -*- makefile -*- +#---------------------------------------------------------------------------- +# WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al. +# +# Released to the Public Domain +# +# Additional material for this makefile was written by: +# Peter Fleury +# Tim Henigan +# Colin O'Flynn +# Reiner Patommel +# Markus Pfaff +# Sander Pool +# Frederik Rouleau +# Carlos Lamas +# +#---------------------------------------------------------------------------- +# On command line: +# +# make all = Make software. +# +# make clean = Clean out built project files. +# +# make coff = Convert ELF to AVR COFF. +# +# make extcoff = Convert ELF to AVR Extended COFF. +# +# make program = Download the hex file to the device, using avrdude. +# Please customize the avrdude settings below first! +# +# make debug = Start either simulavr or avarice as specified for debugging, +# with avr-gdb or avr-insight as the front end for debugging. +# +# make filename.s = Just compile filename.c into the assembler code only. +# +# make filename.i = Create a preprocessed source file for use in submitting +# bug reports to the GCC project. +# +# To rebuild project do "make clean" then "make all". +#---------------------------------------------------------------------------- + + +# MCU name +MCU = at90can128 + + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# Typical values are: +# F_CPU = 1000000 +# F_CPU = 1843200 +# F_CPU = 2000000 +# F_CPU = 3686400 +# F_CPU = 4000000 +# F_CPU = 7372800 +# F_CPU = 8000000 +# F_CPU = 11059200 +# F_CPU = 14745600 +# F_CPU = 16000000 +# F_CPU = 18432000 +# F_CPU = 20000000 +F_CPU = 16000000 + + +# Output format. (can be srec, ihex, binary) +FORMAT = ihex + + +# Target file name (without extension). +TARGET = ch + + +# Object files directory +# To put object files in current directory, use a dot (.), do NOT make +# this an empty or blank macro! +OBJDIR = . + + +# List C source files here. (C dependencies are automatically generated.) +SRC = ./main.c ./chcore.c ../../src/chinit.c ../../src/chlists.c ../../src/chdelta.c ../../src/chschd.c ../../src/chthreads.c ../../src/chsem.c ../../src/chevents.c ../../src/chmsg.c ../../src/chsleep.c ../../src/chqueues.c ../../src/chserial.c + + + +# List C++ source files here. (C dependencies are automatically generated.) +CPPSRC = + + +# List Assembler source files here. +# Make them always end in a capital .S. Files ending in a lowercase .s +# will not be considered source files but generated files (assembler +# output from the compiler), and will be deleted upon "make clean"! +# Even though the DOS/Win* filesystem matches both .s and .S the same, +# it will preserve the spelling of the filenames, and gcc itself does +# care about how the name is spelled on its command-line. +ASRC = ./chcore2.S + + +# Optimization level, can be [0, 1, 2, 3, s]. +# 0 = turn off optimization. s = optimize for size. +# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) +OPT = s + + +# Debugging format. +# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs. +# AVR Studio 4.10 requires dwarf-2. +# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run. +DEBUG = dwarf-2 + + +# List any extra directories to look for include files here. +# Each directory must be seperated by a space. +# Use forward slashes for directory separators. +# For a directory that has spaces, enclose it in quotes. +EXTRAINCDIRS = ../../src/include + + +# Compiler flag to set the C Standard level. +# c89 = "ANSI" C +# gnu89 = c89 plus GCC extensions +# c99 = ISO C99 standard (not yet fully implemented) +# gnu99 = c99 plus GCC extensions +CSTANDARD = -std=gnu99 + + +# Place -D or -U options here for C sources +CDEFS = -DF_CPU=$(F_CPU)UL + + +# Place -D or -U options here for ASM sources +ADEFS = -DF_CPU=$(F_CPU) + + +# Place -D or -U options here for C++ sources +CPPDEFS = -DF_CPU=$(F_CPU)UL +#CPPDEFS += -D__STDC_LIMIT_MACROS +#CPPDEFS += -D__STDC_CONSTANT_MACROS + + + +#---------------- Compiler Options C ---------------- +# -g*: generate debugging information +# -O*: optimization level +# -f...: tuning, see GCC manual and avr-libc documentation +# -Wall...: warning level +# -Wa,...: tell GCC to pass this to the assembler. +# -adhlns...: create assembler listing +CFLAGS = -g$(DEBUG) +CFLAGS += $(CDEFS) +CFLAGS += -O$(OPT) +CFLAGS += -funsigned-char +CFLAGS += -funsigned-bitfields +CFLAGS += -fpack-struct +CFLAGS += -fshort-enums +CFLAGS += -fno-strict-aliasing +CFLAGS += -Wall +CFLAGS += -Wstrict-prototypes +#CFLAGS += -mshort-calls +#CFLAGS += -fno-unit-at-a-time +#CFLAGS += -Wundef +#CFLAGS += -Wunreachable-code +#CFLAGS += -Wsign-compare +CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst) +CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) +CFLAGS += $(CSTANDARD) + + +#---------------- Compiler Options C++ ---------------- +# -g*: generate debugging information +# -O*: optimization level +# -f...: tuning, see GCC manual and avr-libc documentation +# -Wall...: warning level +# -Wa,...: tell GCC to pass this to the assembler. +# -adhlns...: create assembler listing +CPPFLAGS = -g$(DEBUG) +CPPFLAGS += $(CPPDEFS) +CPPFLAGS += -O$(OPT) +CPPFLAGS += -funsigned-char +CPPFLAGS += -funsigned-bitfields +CPPFLAGS += -fpack-struct +CPPFLAGS += -fshort-enums +CPPFLAGS += -fno-exceptions +CPPFLAGS += -Wall +CFLAGS += -Wundef +#CPPFLAGS += -mshort-calls +#CPPFLAGS += -fno-unit-at-a-time +#CPPFLAGS += -Wstrict-prototypes +#CPPFLAGS += -Wunreachable-code +#CPPFLAGS += -Wsign-compare +CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst) +CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) +#CPPFLAGS += $(CSTANDARD) + + +#---------------- Assembler Options ---------------- +# -Wa,...: tell GCC to pass this to the assembler. +# -adhlns: create listing +# -gstabs: have the assembler create line number information; note that +# for use in COFF files, additional information about filenames +# and function names needs to be present in the assembler source +# files -- see avr-libc docs [FIXME: not yet described there] +# -listing-cont-lines: Sets the maximum number of continuation lines of hex +# dump that will be displayed for a given single line of source input. +ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100 + + +#---------------- Library Options ---------------- +# Minimalistic printf version +PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min + +# Floating point printf version (requires MATH_LIB = -lm below) +PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt + +# If this is left blank, then it will use the Standard printf version. +PRINTF_LIB = $(PRINTF_LIB_MIN) +#PRINTF_LIB = $(PRINTF_LIB_MIN) +#PRINTF_LIB = $(PRINTF_LIB_FLOAT) + + +# Minimalistic scanf version +SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min + +# Floating point + %[ scanf version (requires MATH_LIB = -lm below) +SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt + +# If this is left blank, then it will use the Standard scanf version. +SCANF_LIB = $(SCANF_LIB_MIN) +#SCANF_LIB = $(SCANF_LIB_MIN) +#SCANF_LIB = $(SCANF_LIB_FLOAT) + + +MATH_LIB = -lm + + +# List any extra directories to look for libraries here. +# Each directory must be seperated by a space. +# Use forward slashes for directory separators. +# For a directory that has spaces, enclose it in quotes. +EXTRALIBDIRS = + + + +#---------------- External Memory Options ---------------- + +# 64 KB of external RAM, starting after internal RAM (ATmega128!), +# used for variables (.data/.bss) and heap (malloc()). +#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff + +# 64 KB of external RAM, starting after internal RAM (ATmega128!), +# only used for heap (malloc()). +#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff + +EXTMEMOPTS = + + + +#---------------- Linker Options ---------------- +# -Wl,...: tell GCC to pass this to linker. +# -Map: create map file +# --cref: add cross reference to map file +LDFLAGS = -Wl,-Map=$(TARGET).map,--cref +LDFLAGS += $(EXTMEMOPTS) +LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) +LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) +#LDFLAGS += -T linker_script.x + + + +#---------------- Programming Options (avrdude) ---------------- + +# Programming hardware: alf avr910 avrisp bascom bsd +# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 +# +# Type: avrdude -c ? +# to get a full listing. +# +AVRDUDE_PROGRAMMER = stk500 + +# com1 = serial port. Use lpt1 to connect to parallel port. +AVRDUDE_PORT = com1 # programmer connected to serial device + +AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex +#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep + + +# Uncomment the following if you want avrdude's erase cycle counter. +# Note that this counter needs to be initialized first using -Yn, +# see avrdude manual. +#AVRDUDE_ERASE_COUNTER = -y + +# Uncomment the following if you do /not/ wish a verification to be +# performed after programming the device. +#AVRDUDE_NO_VERIFY = -V + +# Increase verbosity level. Please use this when submitting bug +# reports about avrdude. See +# to submit bug reports. +#AVRDUDE_VERBOSE = -v -v + +AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) +AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY) +AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE) +AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER) + + + +#---------------- Debugging Options ---------------- + +# For simulavr only - target MCU frequency. +DEBUG_MFREQ = $(F_CPU) + +# Set the DEBUG_UI to either gdb or insight. +# DEBUG_UI = gdb +DEBUG_UI = insight + +# Set the debugging back-end to either avarice, simulavr. +DEBUG_BACKEND = avarice +#DEBUG_BACKEND = simulavr + +# GDB Init Filename. +GDBINIT_FILE = __avr_gdbinit + +# When using avarice settings for the JTAG +JTAG_DEV = /dev/com1 + +# Debugging port used to communicate between GDB / avarice / simulavr. +DEBUG_PORT = 4242 + +# Debugging host used to communicate between GDB / avarice / simulavr, normally +# just set to localhost unless doing some sort of crazy debugging when +# avarice is running on a different computer. +DEBUG_HOST = localhost + + + +#============================================================================ + + +# Define programs and commands. +SHELL = sh +CC = avr-gcc +OBJCOPY = avr-objcopy +OBJDUMP = avr-objdump +SIZE = avr-size +AR = avr-ar rcs +NM = avr-nm +AVRDUDE = avrdude +REMOVE = rm -f +REMOVEDIR = rm -rf +COPY = cp +WINSHELL = cmd + + +# Define Messages +# English +MSG_ERRORS_NONE = Errors: none +MSG_BEGIN = -------- begin -------- +MSG_END = -------- end -------- +MSG_SIZE_BEFORE = Size before: +MSG_SIZE_AFTER = Size after: +MSG_COFF = Converting to AVR COFF: +MSG_EXTENDED_COFF = Converting to AVR Extended COFF: +MSG_FLASH = Creating load file for Flash: +MSG_EEPROM = Creating load file for EEPROM: +MSG_EXTENDED_LISTING = Creating Extended Listing: +MSG_SYMBOL_TABLE = Creating Symbol Table: +MSG_LINKING = Linking: +MSG_COMPILING = Compiling C: +MSG_COMPILING_CPP = Compiling C++: +MSG_ASSEMBLING = Assembling: +MSG_CLEANING = Cleaning project: +MSG_CREATING_LIBRARY = Creating library: + + + + +# Define all object files. +OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o) + +# Define all listing files. +LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst) + + +# Compiler flags to generate dependency files. +GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d + + +# Combine all necessary flags and optional flags. +# Add target processor to flags. +ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS) +ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS) +ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) + + + + + +# Default target. +all: begin gccversion sizebefore build sizeafter end + +# Change the build target to build a HEX file or a library. +build: elf hex eep lss sym +#build: lib + + +elf: $(TARGET).elf +hex: $(TARGET).hex +eep: $(TARGET).eep +lss: $(TARGET).lss +sym: $(TARGET).sym +LIBNAME=lib$(TARGET).a +lib: $(LIBNAME) + + + +# Eye candy. +# AVR Studio 3.x does not check make's exit code but relies on +# the following magic strings to be generated by the compile job. +begin: + @echo + @echo $(MSG_BEGIN) + +end: + @echo $(MSG_END) + @echo + + +# Display size of file. +HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex +ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf + +sizebefore: + @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \ + 2>/dev/null; echo; fi + +sizeafter: + @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ + 2>/dev/null; echo; fi + + + +# Display compiler version information. +gccversion : + @$(CC) --version + + + +# Program the device. +program: $(TARGET).hex $(TARGET).eep + $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) + + +# Generate avr-gdb config/init file which does the following: +# define the reset signal, load the target file, connect to target, and set +# a breakpoint at main(). +gdb-config: + @$(REMOVE) $(GDBINIT_FILE) + @echo define reset >> $(GDBINIT_FILE) + @echo SIGNAL SIGHUP >> $(GDBINIT_FILE) + @echo end >> $(GDBINIT_FILE) + @echo file $(TARGET).elf >> $(GDBINIT_FILE) + @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE) +ifeq ($(DEBUG_BACKEND),simulavr) + @echo load >> $(GDBINIT_FILE) +endif + @echo break main >> $(GDBINIT_FILE) + +debug: gdb-config $(TARGET).elf +ifeq ($(DEBUG_BACKEND), avarice) + @echo Starting AVaRICE - Press enter when "waiting to connect" message displays. + @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \ + $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT) + @$(WINSHELL) /c pause + +else + @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \ + $(DEBUG_MFREQ) --port $(DEBUG_PORT) +endif + @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE) + + + + +# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. +COFFCONVERT = $(OBJCOPY) --debugging +COFFCONVERT += --change-section-address .data-0x800000 +COFFCONVERT += --change-section-address .bss-0x800000 +COFFCONVERT += --change-section-address .noinit-0x800000 +COFFCONVERT += --change-section-address .eeprom-0x810000 + + + +coff: $(TARGET).elf + @echo + @echo $(MSG_COFF) $(TARGET).cof + $(COFFCONVERT) -O coff-avr $< $(TARGET).cof + + +extcoff: $(TARGET).elf + @echo + @echo $(MSG_EXTENDED_COFF) $(TARGET).cof + $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof + + + +# Create final output files (.hex, .eep) from ELF output file. +%.hex: %.elf + @echo + @echo $(MSG_FLASH) $@ + $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ + +%.eep: %.elf + @echo + @echo $(MSG_EEPROM) $@ + -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ + --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0 + +# Create extended listing file from ELF output file. +%.lss: %.elf + @echo + @echo $(MSG_EXTENDED_LISTING) $@ + $(OBJDUMP) -h -S $< > $@ + +# Create a symbol table from ELF output file. +%.sym: %.elf + @echo + @echo $(MSG_SYMBOL_TABLE) $@ + $(NM) -n $< > $@ + + + +# Create library from object files. +.SECONDARY : $(TARGET).a +.PRECIOUS : $(OBJ) +%.a: $(OBJ) + @echo + @echo $(MSG_CREATING_LIBRARY) $@ + $(AR) $@ $(OBJ) + + +# Link: create ELF output file from object files. +.SECONDARY : $(TARGET).elf +.PRECIOUS : $(OBJ) +%.elf: $(OBJ) + @echo + @echo $(MSG_LINKING) $@ + $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS) + + +# Compile: create object files from C source files. +$(OBJDIR)/%.o : %.c + @echo + @echo $(MSG_COMPILING) $< + $(CC) -c $(ALL_CFLAGS) $< -o $@ + + +# Compile: create object files from C++ source files. +$(OBJDIR)/%.o : %.cpp + @echo + @echo $(MSG_COMPILING_CPP) $< + $(CC) -c $(ALL_CPPFLAGS) $< -o $@ + + +# Compile: create assembler files from C source files. +%.s : %.c + $(CC) -S $(ALL_CFLAGS) $< -o $@ + + +# Compile: create assembler files from C++ source files. +%.s : %.cpp + $(CC) -S $(ALL_CPPFLAGS) $< -o $@ + + +# Assemble: create object files from assembler source files. +$(OBJDIR)/%.o : %.S + @echo + @echo $(MSG_ASSEMBLING) $< + $(CC) -c $(ALL_ASFLAGS) $< -o $@ + + +# Create preprocessed source for use in sending a bug report. +%.i : %.c + $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ + + +# Target: clean project. +clean: begin clean_list end + +clean_list : + @echo + @echo $(MSG_CLEANING) + $(REMOVE) $(TARGET).hex + $(REMOVE) $(TARGET).eep + $(REMOVE) $(TARGET).cof + $(REMOVE) $(TARGET).elf + $(REMOVE) $(TARGET).map + $(REMOVE) $(TARGET).sym + $(REMOVE) $(TARGET).lss + $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o) + $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst) + $(REMOVE) $(SRC:.c=.s) + $(REMOVE) $(SRC:.c=.d) + $(REMOVE) $(SRC:.c=.i) + $(REMOVEDIR) .dep + + +# Create object files directory +$(shell mkdir $(OBJDIR) 2>/dev/null) + + +# Include the dependency files. +-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*) + + +# Listing of phony targets. +.PHONY : all begin finish end sizebefore sizeafter gccversion \ +build elf hex eep lss sym coff extcoff \ +clean clean_list program debug gdb-config + + + + + + diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h new file mode 100644 index 000000000..0857a1fbd --- /dev/null +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -0,0 +1,158 @@ +/* + ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @addtogroup Config + * @{ + */ + +#ifndef _CHCONF_H_ +#define _CHCONF_H_ + +/* + * NOTE: this is just documentation for doxigen, the real configuration file + * is the one into the project directories. + */ + +/** Configuration option: if specified then time efficient rather than space + * efficient code is used when two possible implementations exist, note + * that this is not related to the compiler optimization options.*/ +//#define CH_OPTIMIZE_SPEED + +/** Configuration option: if specified then the Virtual Timers subsystem is + * included in the kernel.*/ +#define CH_USE_VIRTUAL_TIMERS + +/** Configuration option: if specified then the System Timer subsystem is + * included in the kernel.*/ +#define CH_USE_SYSTEMTIME + +/** Configuration option: if specified then the \p chThdSleep() function is + * included in the kernel. + * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ +#define CH_USE_SLEEP + +/** Configuration option: if specified then the \p chThdResume() + * function is included in the kernel.*/ +#define CH_USE_RESUME + +/** Configuration option: if specified then the \p chThdTerminate() + * and \p chThdShouldTerminate() functions are included in the kernel.*/ +#define CH_USE_TERMINATE + +/** Configuration option: if specified then the \p chThdWait() function + * is included in the kernel.*/ +#define CH_USE_WAITEXIT + +/** Configuration option: if specified then the Semaphores APIs are included + * in the kernel.*/ +#define CH_USE_SEMAPHORES + +/** Configuration option: if specified then the Semaphores atomic Signal+Wait + * APIs are included in the kernel.*/ +#define CH_USE_SEMSW + +/** Configuration option: if specified then the Semaphores with timeout APIs + * are included in the kernel. + * @note requires \p CH_USE_SEMAPHORES. + * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ +#define CH_USE_SEMAPHORES_TIMEOUT + +/** Configuration option: if specified then the Semaphores APIs with priority + * shift are included in the kernel. + * @note requires \p CH_USE_SEMAPHORES.*/ +#define CH_USE_RT_SEMAPHORES + +/** Configuration option: if specified then the Events APIs are included in + * the kernel.*/ +#define CH_USE_EVENTS + +/** Configuration option: if specified then the \p chEvtWaitTimeout() + * function is included in the kernel. + * @note requires \p CH_USE_EVENTS. + * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ +#define CH_USE_EVENTS_TIMEOUT + +/** Configuration option: if specified then the Synchronous Messages APIs are + * included in the kernel.*/ +#define CH_USE_MESSAGES + +/** Configuration option: if specified then the \p chMsgSendTimeout() + * function is included in the kernel. + * @note requires \p CH_USE_MESSAGES. + * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ +#define CH_USE_MESSAGES_TIMEOUT + +/** Configuration option: if specified then the \p chMsgSendWithEvent() + * function is included in the kernel. + * @note requires \p CH_USE_MESSAGES. + * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ +#define CH_USE_MESSAGES_EVENT + +/** Configuration option: if specified then the + * \p chThdGetExitEventSource() function is included in the kernel. + * @note requires \p CH_USE_MESSAGES. + * @note requires \p CH_USE_EVENTS.*/ +#define CH_USE_EXIT_EVENT + +/** Configuration option: if specified then the I/O queues APIs are included + * in the kernel.*/ +#define CH_USE_QUEUES + +/** Configuration option: if specified then the halfduplex queue APIs are + * included in the kernel.*/ +#define CH_USE_QUEUES_HALFDUPLEX + +/** Configuration option: if specified then the I/O queues with timeout + * APIs are included in the kernel. + * @note requires \p CH_USE_SEMAPHORES_TIMEOUT.*/ +#define CH_USE_QUEUES_TIMEOUT + +/** Configuration option: if specified then the full duplex serial driver APIs + * are included in the kernel.*/ +#define CH_USE_SERIAL_FULLDUPLEX + +/** Configuration option: if specified then the half duplex serial driver APIs + * are included in the kernel.*/ +#define CH_USE_SERIAL_HALFDUPLEX + +/** Configuration option: Frequency of the system timer that drives the system + * ticks. This also defines the system time unit.*/ +#define CH_FREQUENCY 100 + +/** Configuration option: This constant is the number of ticks allowed for the + * threads before preemption occurs.*/ +#define CH_TIME_QUANTUM 10 + +/** Configuration option: Defines a CPU register to be used as storage for the + * global \p currp variable. Caching this variable in a register can greatly + * improve both space and time efficiency of the generated code. Another side + * effect is that one less register has to be saved during the context switch + * resulting in lower RAM usage and faster code. + * @note This option is only useable with the GCC compiler and is only useful + * on processors with many registers like ARM cores. + * @note If this option is enabled then ALL the libraries linked to the + * ChibiOS/RT code must be recompiled with the GCC option \p + * -ffixed-\. + */ +//#define CH_CURRP_REGISTER_CACHE "reg" + +#endif /* _CHCONF_H_ */ + +/** @} */ diff --git a/demos/AVR-AT90CANx-GCC/chcore.c b/demos/AVR-AT90CANx-GCC/chcore.c new file mode 100644 index 000000000..2d0a2c0df --- /dev/null +++ b/demos/AVR-AT90CANx-GCC/chcore.c @@ -0,0 +1,26 @@ +/* + ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include + +void chSysHalt(void) { + + while (TRUE) + ; +} diff --git a/demos/AVR-AT90CANx-GCC/chcore.h b/demos/AVR-AT90CANx-GCC/chcore.h new file mode 100644 index 000000000..d263202d8 --- /dev/null +++ b/demos/AVR-AT90CANx-GCC/chcore.h @@ -0,0 +1,106 @@ +/* + ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @addtogroup Core + * @{ + */ + +#ifndef _CHCORE_H_ +#define _CHCORE_H_ + +/* + * Interrupt saved context. + */ +struct extctx { + BYTE8 sr; + BYTE8 r31; + BYTE8 r30; + BYTE8 r27; + BYTE8 r26; + BYTE8 r25; + BYTE8 r24; + BYTE8 r23; + BYTE8 r22; + BYTE8 r21; + BYTE8 r20; + BYTE8 r19; + BYTE8 r18; + BYTE8 r1; + BYTE8 r0; + UWORD16 pc; +}; + +/* + * Stack saved context. + */ +struct intctx { + BYTE8 r29; + BYTE8 r28; + BYTE8 r17; + BYTE8 r16; + BYTE8 r15; + BYTE8 r14; + BYTE8 r13; + BYTE8 r12; + BYTE8 r11; + BYTE8 r10; + BYTE8 r9; + BYTE8 r8; + BYTE8 r7; + BYTE8 r6; + BYTE8 r5; + BYTE8 r4; + BYTE8 r3; + BYTE8 r2; + UWORD16 pc; +}; + +typedef struct { + struct intctx *sp; +} Context; + +/** + * Platform dependent part of the \p chThdCreate() API. + */ +#define SETUP_CONTEXT(workspace, wsize, pf, arg) \ +{ \ +} + +/* + * Interrupt stack usage except for saved registers. + */ +#define EXTRA_INT_STACK 0x10 + +#define UserStackSize(n) (sizeof(Thread) + \ + sizeof(struct intctx) + \ + sizeof(struct extctx) + \ + EXTRA_INT_STACK + \ + (n)) + +#define chSysLock() asm("cli") +#define chSysUnlock() asm("sei") + +void chSysHalt(void); +void chSysPause(void); +void chSysSwitchI(Context *oldp, Context *newp); + +#endif /* _CHCORE_H_ */ + +/** @} */ diff --git a/demos/AVR-AT90CANx-GCC/chcore2.S b/demos/AVR-AT90CANx-GCC/chcore2.S new file mode 100644 index 000000000..a9d39690a --- /dev/null +++ b/demos/AVR-AT90CANx-GCC/chcore2.S @@ -0,0 +1,124 @@ +/* + ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include + +.global chSysPause +chSysPause: + ldi r18, (1 << SE) + out _SFR_IO_ADDR(SMCR), r18 +stay: + sleep + rjmp stay + +.global chSysSwitchI +chSysSwitchI: + push r2 + push r3 + push r4 + push r5 + push r6 + push r7 + push r8 + push r9 + push r10 + push r11 + push r12 + push r13 + push r14 + push r15 + push r16 + push r17 + push r28 + push r29 + movw r30, r24 // Z <- oldp + in r0, _SFR_IO_ADDR(SPL) + st Z, r0 + in r0, _SFR_IO_ADDR(SPH) + std Z+1, r0 + + movw r30, r22 // Z <- newp + ld r0, Z + out _SFR_IO_ADDR(SPL), r0 + ldd r0, Z+1 + out _SFR_IO_ADDR(SPH), r0 + pop r29 + pop r28 + pop r17 + pop r16 + pop r15 + pop r14 + pop r13 + pop r12 + pop r11 + pop r10 + pop r9 + pop r8 + pop r7 + pop r6 + pop r5 + pop r4 + pop r3 + pop r2 + ret + +.global __vector_17 +__vector_17: + push r0 + push r1 + push r18 + push r19 + push r20 + push r21 + push r22 + push r23 + push r24 + push r25 + push r26 + push r27 + push r30 + push r31 + in r0, _SFR_IO_ADDR(SREG) + push r0 + clr r1 + call chSchTimerHandlerI +intcommon: + call chSchRescRequiredI + tst r24 + breq noschd + call chSchDoRescheduleI +noschd: + pop r0 + out _SFR_IO_ADDR(SREG), r0 + pop r31 + pop r30 + pop r27 + pop r26 + pop r25 + pop r24 + pop r23 + pop r22 + pop r21 + pop r20 + pop r19 + pop r18 + pop r1 + pop r0 + reti + diff --git a/demos/AVR-AT90CANx-GCC/chtypes.h b/demos/AVR-AT90CANx-GCC/chtypes.h new file mode 100644 index 000000000..d3c26caaf --- /dev/null +++ b/demos/AVR-AT90CANx-GCC/chtypes.h @@ -0,0 +1,47 @@ +/* + ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef _CHTYPES_H_ +#define _CHTYPES_H_ + +/* + * Generic types often dependant on the compiler. + */ +#define BOOL char +#define BYTE8 unsigned char +#define SBYTE8 signed char +#define WORD16 int +#define UWORD16 unsigned int +#define LONG32 long +#define ULONG32 unsigned long +#define PTR_EQ int + +typedef BYTE8 t_tmode; +typedef BYTE8 t_tstate; +typedef BYTE8 t_prio; +typedef WORD16 t_msg; +typedef BYTE8 t_eventid; +typedef BYTE8 t_eventmask; +typedef UWORD16 t_time; +typedef SBYTE8 t_cnt; +typedef UWORD16 t_size; + +#define INLINE inline + +#endif /* _CHTYPES_H_ */ diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c new file mode 100644 index 000000000..2c04d82dc --- /dev/null +++ b/demos/AVR-AT90CANx-GCC/main.c @@ -0,0 +1,38 @@ +/* + ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include + +static BYTE8 waThread1[UserStackSize(32)]; + +static t_msg Thread1(void *arg) { + + while (TRUE) { + chThdSleep(800); + } + return 0; +} + +int main(int argc, char **argv) { + + chSysInit(); + chThdCreate(NORMALPRIO, 0, waThread1, sizeof(waThread1), Thread1, NULL); + chSysPause(); + return 0; +} -- cgit v1.2.3 From d6d799ed48f8193bee286187132221f831726a07 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 6 Oct 2007 08:58:52 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@39 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chcore.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chcore.h b/demos/AVR-AT90CANx-GCC/chcore.h index d263202d8..799742f47 100644 --- a/demos/AVR-AT90CANx-GCC/chcore.h +++ b/demos/AVR-AT90CANx-GCC/chcore.h @@ -97,8 +97,8 @@ typedef struct { #define chSysLock() asm("cli") #define chSysUnlock() asm("sei") -void chSysHalt(void); -void chSysPause(void); +void chSysHalt(void) __attribute__((noreturn)) ; +void chSysPause(void) __attribute__((noreturn)) ; void chSysSwitchI(Context *oldp, Context *newp); #endif /* _CHCORE_H_ */ -- cgit v1.2.3 From cb5757e03204c11f425c20bb6766242618eb2b28 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 6 Oct 2007 10:22:07 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@41 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chcore.c | 15 +++++++++++++++ demos/AVR-AT90CANx-GCC/chcore2.S | 8 -------- 2 files changed, 15 insertions(+), 8 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chcore.c b/demos/AVR-AT90CANx-GCC/chcore.c index 2d0a2c0df..53fe296ac 100644 --- a/demos/AVR-AT90CANx-GCC/chcore.c +++ b/demos/AVR-AT90CANx-GCC/chcore.c @@ -19,8 +19,23 @@ #include +void chSysPause(void) { + + chThdSetPriority(IDLEPRIO); + + asm volatile ( + "ldi r18, 1 \n\t" // SE bit + "out 0x33, r18 \n" // SMCR + ); + while (TRUE) { + asm volatile ("sleep\n\t"); + } +} + void chSysHalt(void) { + chSysLock(); + while (TRUE) ; } diff --git a/demos/AVR-AT90CANx-GCC/chcore2.S b/demos/AVR-AT90CANx-GCC/chcore2.S index a9d39690a..d438ffb4f 100644 --- a/demos/AVR-AT90CANx-GCC/chcore2.S +++ b/demos/AVR-AT90CANx-GCC/chcore2.S @@ -19,14 +19,6 @@ #include -.global chSysPause -chSysPause: - ldi r18, (1 << SE) - out _SFR_IO_ADDR(SMCR), r18 -stay: - sleep - rjmp stay - .global chSysSwitchI chSysSwitchI: push r2 -- cgit v1.2.3 From e313c04627e8d7e16e0da58e4def155fbfb0c591 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 6 Oct 2007 10:29:22 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@42 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chcore.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chcore.c b/demos/AVR-AT90CANx-GCC/chcore.c index 53fe296ac..85dff271f 100644 --- a/demos/AVR-AT90CANx-GCC/chcore.c +++ b/demos/AVR-AT90CANx-GCC/chcore.c @@ -24,11 +24,11 @@ void chSysPause(void) { chThdSetPriority(IDLEPRIO); asm volatile ( - "ldi r18, 1 \n\t" // SE bit - "out 0x33, r18 \n" // SMCR + "ldi r18, 1 \n\t" // SE bit + "out 0x33, r18" // SMCR ); while (TRUE) { - asm volatile ("sleep\n\t"); + asm volatile ("sleep"); } } -- cgit v1.2.3 From 70c86d43ec79032c7172507fc12bf7d78d44a3de Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 15 Oct 2007 14:52:56 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@53 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 0857a1fbd..2c849b3c6 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -52,6 +52,10 @@ * function is included in the kernel.*/ #define CH_USE_RESUME +/** Configuration option: if specified then the \p chThdSuspend() + * function is included in the kernel.*/ +#define CH_USE_SUSPEND + /** Configuration option: if specified then the \p chThdTerminate() * and \p chThdShouldTerminate() functions are included in the kernel.*/ #define CH_USE_TERMINATE -- cgit v1.2.3 From 4674513d38a8872a95a895de05ed6a750c842591 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 23 Oct 2007 18:43:39 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@59 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chcore.c | 35 ++++++++++++++++++++++++++++++----- demos/AVR-AT90CANx-GCC/main.c | 6 ++++++ 2 files changed, 36 insertions(+), 5 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chcore.c b/demos/AVR-AT90CANx-GCC/chcore.c index 85dff271f..9d2e0e1b2 100644 --- a/demos/AVR-AT90CANx-GCC/chcore.c +++ b/demos/AVR-AT90CANx-GCC/chcore.c @@ -19,16 +19,41 @@ #include +#include + +void hwinit(void) { + + /* + * I/O ports setup. + * Everything configured as input with pull-up initially. + */ + DDRA = 0; + PORTA = 0xFF; + DDRB = 0; + PORTB = 0xFF; + DDRC = 0; + PORTC = 0xFF; + DDRD = 0; + PORTD = 0xFF; + DDRE = 0; + PORTE = 0xFF; + DDRF = 0; + PORTF = 0xFF; + DDRG = 0; + PORTG = 0xFF; + + /* + * Enables Idle mode for SLEEP instruction. + */ + SMCR = 1; +} + void chSysPause(void) { chThdSetPriority(IDLEPRIO); - asm volatile ( - "ldi r18, 1 \n\t" // SE bit - "out 0x33, r18" // SMCR - ); while (TRUE) { - asm volatile ("sleep"); +// asm volatile ("sleep"); } } diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c index 2c04d82dc..48f58d080 100644 --- a/demos/AVR-AT90CANx-GCC/main.c +++ b/demos/AVR-AT90CANx-GCC/main.c @@ -19,6 +19,10 @@ #include +#include + +void hwinit(void); + static BYTE8 waThread1[UserStackSize(32)]; static t_msg Thread1(void *arg) { @@ -31,6 +35,8 @@ static t_msg Thread1(void *arg) { int main(int argc, char **argv) { + hwinit(); + chSysInit(); chThdCreate(NORMALPRIO, 0, waThread1, sizeof(waThread1), Thread1, NULL); chSysPause(); -- cgit v1.2.3 From f021c6fe95603891a9da63b04791e2e934555ec7 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 25 Oct 2007 15:36:55 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@65 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chcore.c | 92 ++++++++++++++++++++++++++++++++++------- 1 file changed, 77 insertions(+), 15 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chcore.c b/demos/AVR-AT90CANx-GCC/chcore.c index 9d2e0e1b2..ed9d90d01 100644 --- a/demos/AVR-AT90CANx-GCC/chcore.c +++ b/demos/AVR-AT90CANx-GCC/chcore.c @@ -21,26 +21,88 @@ #include +/* + * All inputs with pullups. + */ +#define VAL_DDRA 0x00 +#define VAL_PORTA 0xFF + +/* + * All inputs with pullups. + */ +#define VAL_DDRB 0x00 +#define VAL_PORTB 0xFF + +/* + * All inputs with pullups. + */ +#define VAL_DDRC 0x00 +#define VAL_PORTC 0xFF + +/* PD7 PD6 PD5 PD4 PD3 PD2 PD1 PD0 + * IN IN OUT IN OUT IN IN IN + * DDRD 0 0 1 0 1 0 0 0 + * PU HiZ VAL PU VAL HiZ HiZ HiZ + * PORTD 1 0 ?1 1 1 0 0 0 + */ +#define VAL_DDRD 0x28 +#define VAL_PORTD 0xB8 + +/* PE7 PE6 BUT LED PE3 PE2 PE1 PE0 + * IN IN IN OUT IN IN OUT IN + * DDRE 0 0 0 1 0 0 1 0 + * PU PU HiZ VAL PU PU VAL HiZ + * PORTE 1 1 0 1 1 1 1 0 + */ +#define VAL_DDRE 0x12 +#define VAL_PORTE 0xDE + +/* TDI TDO TMS TCK PF3 PF2 PF1 PF0 + * x x x x IN IN IN IN + * DDRF 0 0 0 0 0 0 0 0 + * x x x x PU PU PU PU + * PORTF 0 0 0 0 1 1 1 1 + * + */ +#define VAL_DDRF 0x00 +#define VAL_PORTF 0x0F + +/* x x x x x PG2 PG1 PG0 + * x x x x x IN IN IN + * DDRG 0 0 0 0 0 0 0 0 + * x x x x x PU PU PU + * PORTG 0 0 0 0 0 1 1 1 + * + */ +#define VAL_DDRG 0x00 +#define VAL_PORTG 0x07 + void hwinit(void) { /* * I/O ports setup. - * Everything configured as input with pull-up initially. */ - DDRA = 0; - PORTA = 0xFF; - DDRB = 0; - PORTB = 0xFF; - DDRC = 0; - PORTC = 0xFF; - DDRD = 0; - PORTD = 0xFF; - DDRE = 0; - PORTE = 0xFF; - DDRF = 0; - PORTF = 0xFF; - DDRG = 0; - PORTG = 0xFF; + DDRA = VAL_DDRA; + PORTA = VAL_PORTA; + DDRB = VAL_DDRB; + PORTB = VAL_PORTB; + DDRC = VAL_DDRC; + PORTC = VAL_PORTC; + DDRD = VAL_DDRD; + PORTD = VAL_PORTD; + DDRE = VAL_DDRE; + PORTE = VAL_PORTE; + DDRF = VAL_DDRF; + PORTF = VAL_PORTF; + DDRG = VAL_DDRG; + PORTG = VAL_PORTG; + + /* + * External interrupts setup, all disabled initially. + */ + EICRA = 0x00; + EICRB = 0x00; + EIMSK = 0x00; /* * Enables Idle mode for SLEEP instruction. -- cgit v1.2.3 From fb49ce4f3aae2a481be29d030b26a1485d6227de Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 26 Oct 2007 15:08:54 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@66 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 4 ++-- demos/AVR-AT90CANx-GCC/chcore.c | 47 +++++++++++++++++++++++++--------------- demos/AVR-AT90CANx-GCC/chcore.h | 10 +++++++-- demos/AVR-AT90CANx-GCC/chcore2.S | 9 +++++++- 4 files changed, 47 insertions(+), 23 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 2c849b3c6..63a391e08 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -138,11 +138,11 @@ /** Configuration option: Frequency of the system timer that drives the system * ticks. This also defines the system time unit.*/ -#define CH_FREQUENCY 100 +#define CH_FREQUENCY 1000 /** Configuration option: This constant is the number of ticks allowed for the * threads before preemption occurs.*/ -#define CH_TIME_QUANTUM 10 +#define CH_TIME_QUANTUM 20 /** Configuration option: Defines a CPU register to be used as storage for the * global \p currp variable. Caching this variable in a register can greatly diff --git a/demos/AVR-AT90CANx-GCC/chcore.c b/demos/AVR-AT90CANx-GCC/chcore.c index ed9d90d01..262732676 100644 --- a/demos/AVR-AT90CANx-GCC/chcore.c +++ b/demos/AVR-AT90CANx-GCC/chcore.c @@ -82,32 +82,43 @@ void hwinit(void) { /* * I/O ports setup. */ - DDRA = VAL_DDRA; - PORTA = VAL_PORTA; - DDRB = VAL_DDRB; - PORTB = VAL_PORTB; - DDRC = VAL_DDRC; - PORTC = VAL_PORTC; - DDRD = VAL_DDRD; - PORTD = VAL_PORTD; - DDRE = VAL_DDRE; - PORTE = VAL_PORTE; - DDRF = VAL_DDRF; - PORTF = VAL_PORTF; - DDRG = VAL_DDRG; - PORTG = VAL_PORTG; + DDRA = VAL_DDRA; + PORTA = VAL_PORTA; + DDRB = VAL_DDRB; + PORTB = VAL_PORTB; + DDRC = VAL_DDRC; + PORTC = VAL_PORTC; + DDRD = VAL_DDRD; + PORTD = VAL_PORTD; + DDRE = VAL_DDRE; + PORTE = VAL_PORTE; + DDRF = VAL_DDRF; + PORTF = VAL_PORTF; + DDRG = VAL_DDRG; + PORTG = VAL_PORTG; /* * External interrupts setup, all disabled initially. */ - EICRA = 0x00; - EICRB = 0x00; - EIMSK = 0x00; + EICRA = 0x00; + EICRB = 0x00; + EIMSK = 0x00; /* * Enables Idle mode for SLEEP instruction. */ - SMCR = 1; + SMCR = 1; + + /* + * Timer 0 setup. + */ + TCCR0A = (1 << WGM01) | (0 << WGM00) | // CTC mode. + (0 << COM0A1) | (0 << COM0A0) | // OC0A disabled (normal I/O). + (0 << CS02) | (1 << CS01) | (1 << CS00); // CLK/64 clock source. + OCR0A = F_CPU / 64 / CH_FREQUENCY - 1; + TCNT0 = 0; // Reset counter. + TIFR0 = (1 << OCF0A); // Reset pending (if any). + TIMSK0 = (1 << OCIE0A); // Interrupt on compare. } void chSysPause(void) { diff --git a/demos/AVR-AT90CANx-GCC/chcore.h b/demos/AVR-AT90CANx-GCC/chcore.h index 799742f47..c3e0cfa34 100644 --- a/demos/AVR-AT90CANx-GCC/chcore.h +++ b/demos/AVR-AT90CANx-GCC/chcore.h @@ -79,8 +79,13 @@ typedef struct { /** * Platform dependent part of the \p chThdCreate() API. */ -#define SETUP_CONTEXT(workspace, wsize, pf, arg) \ -{ \ +#define SETUP_CONTEXT(workspace, wsize, pf, arg) { \ + tp->p_ctx.sp--; \ + tp->p_ctx.sp->r2 = (int)pf; \ + tp->p_ctx.sp->r3 = (int)pf >> 8; \ + tp->p_ctx.sp->r4 = (int)arg; \ + tp->p_ctx.sp->r5 = (int)arg >> 8; \ + tp->p_ctx.sp->pc = (UWORD16)threadstart; \ } /* @@ -100,6 +105,7 @@ typedef struct { void chSysHalt(void) __attribute__((noreturn)) ; void chSysPause(void) __attribute__((noreturn)) ; void chSysSwitchI(Context *oldp, Context *newp); +void threadstart(void); #endif /* _CHCORE_H_ */ diff --git a/demos/AVR-AT90CANx-GCC/chcore2.S b/demos/AVR-AT90CANx-GCC/chcore2.S index d438ffb4f..3564de521 100644 --- a/demos/AVR-AT90CANx-GCC/chcore2.S +++ b/demos/AVR-AT90CANx-GCC/chcore2.S @@ -19,6 +19,14 @@ #include +.global threadstart +threadstart: + sei + movw r24, r4 // argument + movw r30, r2 // thread function + icall + call chThdExit + .global chSysSwitchI chSysSwitchI: push r2 @@ -113,4 +121,3 @@ noschd: pop r1 pop r0 reti - -- cgit v1.2.3 From 890c5532da783e8d58cfbf28822bcedaa8a0c61d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 14 Nov 2007 16:32:41 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@90 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 6 ++++++ demos/AVR-AT90CANx-GCC/chcore.h | 1 + demos/AVR-AT90CANx-GCC/chtypes.h | 1 + 3 files changed, 8 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 63a391e08..c6146f5e7 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -157,6 +157,12 @@ */ //#define CH_CURRP_REGISTER_CACHE "reg" +/** Configuration option: Includes basic debug support to the kernel. + * @note the debug support is port-dependent, it may be not present on some + * targets. In that case stub functions will be included. + */ +//#define CH_USE_DEBUG + #endif /* _CHCONF_H_ */ /** @} */ diff --git a/demos/AVR-AT90CANx-GCC/chcore.h b/demos/AVR-AT90CANx-GCC/chcore.h index c3e0cfa34..935c37488 100644 --- a/demos/AVR-AT90CANx-GCC/chcore.h +++ b/demos/AVR-AT90CANx-GCC/chcore.h @@ -101,6 +101,7 @@ typedef struct { #define chSysLock() asm("cli") #define chSysUnlock() asm("sei") +#define chSysPuts(msg) {} void chSysHalt(void) __attribute__((noreturn)) ; void chSysPause(void) __attribute__((noreturn)) ; diff --git a/demos/AVR-AT90CANx-GCC/chtypes.h b/demos/AVR-AT90CANx-GCC/chtypes.h index d3c26caaf..60e16aaf4 100644 --- a/demos/AVR-AT90CANx-GCC/chtypes.h +++ b/demos/AVR-AT90CANx-GCC/chtypes.h @@ -34,6 +34,7 @@ typedef BYTE8 t_tmode; typedef BYTE8 t_tstate; +typedef BYTE8 t_tid; typedef BYTE8 t_prio; typedef WORD16 t_msg; typedef BYTE8 t_eventid; -- cgit v1.2.3 From b3361bd0e8ca074dbf7f312a87bbcdbf0019ebc7 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 19 Nov 2007 11:09:33 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@97 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chcore.c | 4 +--- demos/AVR-AT90CANx-GCC/chcore.h | 18 ++++++++++++------ demos/AVR-AT90CANx-GCC/main.c | 14 ++++++++++++-- 3 files changed, 25 insertions(+), 11 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chcore.c b/demos/AVR-AT90CANx-GCC/chcore.c index 262732676..3bc5b027e 100644 --- a/demos/AVR-AT90CANx-GCC/chcore.c +++ b/demos/AVR-AT90CANx-GCC/chcore.c @@ -121,9 +121,7 @@ void hwinit(void) { TIMSK0 = (1 << OCIE0A); // Interrupt on compare. } -void chSysPause(void) { - - chThdSetPriority(IDLEPRIO); +void _IdleThread(void *p) { while (TRUE) { // asm volatile ("sleep"); diff --git a/demos/AVR-AT90CANx-GCC/chcore.h b/demos/AVR-AT90CANx-GCC/chcore.h index 935c37488..32c939d32 100644 --- a/demos/AVR-AT90CANx-GCC/chcore.h +++ b/demos/AVR-AT90CANx-GCC/chcore.h @@ -48,7 +48,7 @@ struct extctx { }; /* - * Stack saved context. + * System saved context. */ struct intctx { BYTE8 r29; @@ -72,6 +72,10 @@ struct intctx { UWORD16 pc; }; +/* + * Port dependent part of the Thread structure, you may add fields in + * this structure. + */ typedef struct { struct intctx *sp; } Context; @@ -93,18 +97,20 @@ typedef struct { */ #define EXTRA_INT_STACK 0x10 -#define UserStackSize(n) (sizeof(Thread) + \ - sizeof(struct intctx) + \ - sizeof(struct extctx) + \ - EXTRA_INT_STACK + \ +#define UserStackSize(n) (sizeof(Thread) + \ + sizeof(struct intctx) + \ + sizeof(struct extctx) + \ + EXTRA_INT_STACK + \ (n)) #define chSysLock() asm("cli") #define chSysUnlock() asm("sei") #define chSysPuts(msg) {} +#define IDLE_THREAD_STACK_SIZE 8 +void _IdleThread(void *p) __attribute__((noreturn)); + void chSysHalt(void) __attribute__((noreturn)) ; -void chSysPause(void) __attribute__((noreturn)) ; void chSysSwitchI(Context *oldp, Context *newp); void threadstart(void); diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c index 48f58d080..61156b040 100644 --- a/demos/AVR-AT90CANx-GCC/main.c +++ b/demos/AVR-AT90CANx-GCC/main.c @@ -24,7 +24,6 @@ void hwinit(void); static BYTE8 waThread1[UserStackSize(32)]; - static t_msg Thread1(void *arg) { while (TRUE) { @@ -37,8 +36,19 @@ int main(int argc, char **argv) { hwinit(); + /* + * The main() function becomes a thread here then the interrupts are + * enabled and ChibiOS/RT goes live. + */ chSysInit(); + + /* + * Starts the LED blinker thread. + */ chThdCreate(NORMALPRIO, 0, waThread1, sizeof(waThread1), Thread1, NULL); - chSysPause(); + + while(TRUE) + /* Do stuff*/ ; + return 0; } -- cgit v1.2.3 From 97bf45204321755cf2e78a7cc7ff616edaec59c4 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 22 Nov 2007 15:24:50 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@105 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chcore.h | 2 ++ demos/AVR-AT90CANx-GCC/main.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chcore.h b/demos/AVR-AT90CANx-GCC/chcore.h index 32c939d32..07cb45f64 100644 --- a/demos/AVR-AT90CANx-GCC/chcore.h +++ b/demos/AVR-AT90CANx-GCC/chcore.h @@ -103,6 +103,8 @@ typedef struct { EXTRA_INT_STACK + \ (n)) +#define WorkingArea(s, n) BYTE8 s[UserStackSize(n)]; + #define chSysLock() asm("cli") #define chSysUnlock() asm("sei") #define chSysPuts(msg) {} diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c index 61156b040..14c45cf47 100644 --- a/demos/AVR-AT90CANx-GCC/main.c +++ b/demos/AVR-AT90CANx-GCC/main.c @@ -23,7 +23,7 @@ void hwinit(void); -static BYTE8 waThread1[UserStackSize(32)]; +static WorkingArea(waThread1, 32); static t_msg Thread1(void *arg) { while (TRUE) { -- cgit v1.2.3 From a134cd919ea3e6fee591bc29d360f3da74f46a8b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 27 Nov 2007 11:43:28 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@115 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 4 ++++ demos/AVR-AT90CANx-GCC/chcore.h | 31 +++++++++++++------------------ 2 files changed, 17 insertions(+), 18 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index c6146f5e7..2bc89dc2f 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -163,6 +163,10 @@ */ //#define CH_USE_DEBUG +/** Debug option: Includes the threads context switch tracing feature. + */ +//#define CH_USE_TRACE + #endif /* _CHCONF_H_ */ /** @} */ diff --git a/demos/AVR-AT90CANx-GCC/chcore.h b/demos/AVR-AT90CANx-GCC/chcore.h index 07cb45f64..9e1b95db8 100644 --- a/demos/AVR-AT90CANx-GCC/chcore.h +++ b/demos/AVR-AT90CANx-GCC/chcore.h @@ -83,26 +83,21 @@ typedef struct { /** * Platform dependent part of the \p chThdCreate() API. */ -#define SETUP_CONTEXT(workspace, wsize, pf, arg) { \ - tp->p_ctx.sp--; \ - tp->p_ctx.sp->r2 = (int)pf; \ - tp->p_ctx.sp->r3 = (int)pf >> 8; \ - tp->p_ctx.sp->r4 = (int)arg; \ - tp->p_ctx.sp->r5 = (int)arg >> 8; \ - tp->p_ctx.sp->pc = (UWORD16)threadstart; \ +#define SETUP_CONTEXT(workspace, wsize, pf, arg) { \ + tp->p_ctx.sp--; \ + tp->p_ctx.sp->r2 = (int)pf; \ + tp->p_ctx.sp->r3 = (int)pf >> 8; \ + tp->p_ctx.sp->r4 = (int)arg; \ + tp->p_ctx.sp->r5 = (int)arg >> 8; \ + tp->p_ctx.sp->pc = (UWORD16)threadstart; \ } -/* - * Interrupt stack usage except for saved registers. - */ -#define EXTRA_INT_STACK 0x10 - -#define UserStackSize(n) (sizeof(Thread) + \ - sizeof(struct intctx) + \ - sizeof(struct extctx) + \ - EXTRA_INT_STACK + \ - (n)) - +#define INT_REQUIRED_STACK 0x10 +#define StackAlign(n) (n) +#define UserStackSize(n) StackAlign(sizeof(Thread) + \ + sizeof(struct intctx) + \ + sizeof(struct extctx) + \ + (n) + (INT_REQUIRED_STACK)) #define WorkingArea(s, n) BYTE8 s[UserStackSize(n)]; #define chSysLock() asm("cli") -- cgit v1.2.3 From bef9d20d8eb9186a4f03c397ae880be7cad7efe1 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 4 Dec 2007 14:48:41 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@126 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chcore2.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chcore2.S b/demos/AVR-AT90CANx-GCC/chcore2.S index 3564de521..96c17f011 100644 --- a/demos/AVR-AT90CANx-GCC/chcore2.S +++ b/demos/AVR-AT90CANx-GCC/chcore2.S @@ -97,7 +97,7 @@ __vector_17: in r0, _SFR_IO_ADDR(SREG) push r0 clr r1 - call chSchTimerHandlerI + call chSysTimerHandlerI intcommon: call chSchRescRequiredI tst r24 -- cgit v1.2.3 From 430010715e7a9af17185412273165674f3b58f20 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 16 Dec 2007 19:01:30 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@141 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 2bc89dc2f..b4ddeeb05 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -78,10 +78,9 @@ * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ #define CH_USE_SEMAPHORES_TIMEOUT -/** Configuration option: if specified then the Semaphores APIs with priority - * shift are included in the kernel. - * @note requires \p CH_USE_SEMAPHORES.*/ -#define CH_USE_RT_SEMAPHORES +/** Configuration option: if specified then the Mutexes APIs are included in + * the kernel.*/ +#define CH_USE_MUTEXES /** Configuration option: if specified then the Events APIs are included in * the kernel.*/ -- cgit v1.2.3 From b1db8a9f7fe3bc2cd48c52e7c2c50e0e118f8889 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 7 Jan 2008 14:06:46 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@166 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index b4ddeeb05..d3f4491b2 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -108,6 +108,11 @@ * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ #define CH_USE_MESSAGES_EVENT +/** Configuration option: If enabled then the threads have an option to serve + * messages by priority instead of FIFO order. + * @note requires \p CH_USE_MESSAGES.*/ +#define CH_USE_MESSAGES_PRIORITY + /** Configuration option: if specified then the * \p chThdGetExitEventSource() function is included in the kernel. * @note requires \p CH_USE_MESSAGES. -- cgit v1.2.3 From 29feb9855078f659c1ff9c9459c0a013a9be4daf Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 7 Jan 2008 14:16:06 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@168 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index d3f4491b2..f0f3caf26 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -111,7 +111,7 @@ /** Configuration option: If enabled then the threads have an option to serve * messages by priority instead of FIFO order. * @note requires \p CH_USE_MESSAGES.*/ -#define CH_USE_MESSAGES_PRIORITY +//#define CH_USE_MESSAGES_PRIORITY /** Configuration option: if specified then the * \p chThdGetExitEventSource() function is included in the kernel. -- cgit v1.2.3 From 68003a03c299850f0b66adfa4df6c9d6b6ba6ab2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 23 Jan 2008 14:50:42 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@182 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index f0f3caf26..162255af5 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -96,12 +96,6 @@ * included in the kernel.*/ #define CH_USE_MESSAGES -/** Configuration option: if specified then the \p chMsgSendTimeout() - * function is included in the kernel. - * @note requires \p CH_USE_MESSAGES. - * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ -#define CH_USE_MESSAGES_TIMEOUT - /** Configuration option: if specified then the \p chMsgSendWithEvent() * function is included in the kernel. * @note requires \p CH_USE_MESSAGES. -- cgit v1.2.3 From a6dbd7a691a6c70ebaf132cdc92fc21b3428f6f7 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 6 Mar 2008 11:38:11 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@217 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/Makefile | 25 +++++-- demos/AVR-AT90CANx-GCC/board.c | 87 ++++++++++++++++++++++++ demos/AVR-AT90CANx-GCC/board.h | 86 ++++++++++++++++++++++++ demos/AVR-AT90CANx-GCC/chconf.h | 15 ++--- demos/AVR-AT90CANx-GCC/chcore.c | 137 -------------------------------------- demos/AVR-AT90CANx-GCC/chcore.h | 116 -------------------------------- demos/AVR-AT90CANx-GCC/chcore2.S | 123 ---------------------------------- demos/AVR-AT90CANx-GCC/chtypes.h | 48 ------------- demos/AVR-AT90CANx-GCC/main.c | 30 ++++++++- demos/AVR-AT90CANx-GCC/readme.txt | 25 +++++++ 10 files changed, 251 insertions(+), 441 deletions(-) create mode 100644 demos/AVR-AT90CANx-GCC/board.c create mode 100644 demos/AVR-AT90CANx-GCC/board.h delete mode 100644 demos/AVR-AT90CANx-GCC/chcore.c delete mode 100644 demos/AVR-AT90CANx-GCC/chcore.h delete mode 100644 demos/AVR-AT90CANx-GCC/chcore2.S delete mode 100644 demos/AVR-AT90CANx-GCC/chtypes.h create mode 100644 demos/AVR-AT90CANx-GCC/readme.txt (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/Makefile b/demos/AVR-AT90CANx-GCC/Makefile index b65fb4a74..106c3c390 100644 --- a/demos/AVR-AT90CANx-GCC/Makefile +++ b/demos/AVR-AT90CANx-GCC/Makefile @@ -80,8 +80,14 @@ OBJDIR = . # List C source files here. (C dependencies are automatically generated.) -SRC = ./main.c ./chcore.c ../../src/chinit.c ../../src/chlists.c ../../src/chdelta.c ../../src/chschd.c ../../src/chthreads.c ../../src/chsem.c ../../src/chevents.c ../../src/chmsg.c ../../src/chsleep.c ../../src/chqueues.c ../../src/chserial.c - +SRC = ../../ports/AVR/chcore.c ../../ports/AVR/avr_serial.c \ + ../../src/chinit.c ../../src/chdebug.c ../../src/chlists.c ../../src/chdelta.c \ + ../../src/chschd.c ../../src/chthreads.c ../../src/chsem.c ../../src/chmtx.c \ + ../../src/chevents.c ../../src/chmsg.c ../../src/chsleep.c ../../src/chqueues.c \ + ../../src/chserial.c \ + ../../src/lib/evtimer.c \ + ../../test/test.c \ + board.c main.c # List C++ source files here. (C dependencies are automatically generated.) @@ -95,7 +101,7 @@ CPPSRC = # Even though the DOS/Win* filesystem matches both .s and .S the same, # it will preserve the spelling of the filenames, and gcc itself does # care about how the name is spelled on its command-line. -ASRC = ./chcore2.S +ASRC = # Optimization level, can be [0, 1, 2, 3, s]. @@ -115,7 +121,7 @@ DEBUG = dwarf-2 # Each directory must be seperated by a space. # Use forward slashes for directory separators. # For a directory that has spaces, enclose it in quotes. -EXTRAINCDIRS = ../../src/include +EXTRAINCDIRS = ../../src/include ../../src/lib ../../ports/AVR # Compiler flag to set the C Standard level. @@ -402,12 +408,13 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) all: begin gccversion sizebefore build sizeafter end # Change the build target to build a HEX file or a library. -build: elf hex eep lss sym +build: elf hex bin eep lss sym #build: lib elf: $(TARGET).elf hex: $(TARGET).hex +bin: $(TARGET).bin eep: $(TARGET).eep lss: $(TARGET).lss sym: $(TARGET).sym @@ -512,6 +519,11 @@ extcoff: $(TARGET).elf @echo $(MSG_FLASH) $@ $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ +%.bin: %.elf + @echo + @echo $(MSG_FLASH) $@ + $(OBJCOPY) -O binary -R .eeprom $< $@ + %.eep: %.elf @echo @echo $(MSG_EEPROM) $@ @@ -593,6 +605,7 @@ clean_list : @echo @echo $(MSG_CLEANING) $(REMOVE) $(TARGET).hex + $(REMOVE) $(TARGET).bin $(REMOVE) $(TARGET).eep $(REMOVE) $(TARGET).cof $(REMOVE) $(TARGET).elf @@ -617,7 +630,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null) # Listing of phony targets. .PHONY : all begin finish end sizebefore sizeafter gccversion \ -build elf hex eep lss sym coff extcoff \ +build elf hex bin eep lss sym coff extcoff \ clean clean_list program debug gdb-config diff --git a/demos/AVR-AT90CANx-GCC/board.c b/demos/AVR-AT90CANx-GCC/board.c new file mode 100644 index 000000000..e78360e9a --- /dev/null +++ b/demos/AVR-AT90CANx-GCC/board.c @@ -0,0 +1,87 @@ +/* + ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include + +#include +#include + +#include "board.h" +#include "avr_serial.h" + +ISR(TIMER0_COMP_vect) { + + chSysIRQEnterI(); + + chSysTimerHandlerI(); + + chSysIRQExitI(); +} + +/* + * Board initialization code. + */ +void hwinit(void) { + + /* + * I/O ports setup. + */ + DDRA = VAL_DDRA; + PORTA = VAL_PORTA; + DDRB = VAL_DDRB; + PORTB = VAL_PORTB; + DDRC = VAL_DDRC; + PORTC = VAL_PORTC; + DDRD = VAL_DDRD; + PORTD = VAL_PORTD; + DDRE = VAL_DDRE; + PORTE = VAL_PORTE; + DDRF = VAL_DDRF; + PORTF = VAL_PORTF; + DDRG = VAL_DDRG; + PORTG = VAL_PORTG; + + /* + * External interrupts setup, all disabled initially. + */ + EICRA = 0x00; + EICRB = 0x00; + EIMSK = 0x00; + + /* + * Enables Idle mode for SLEEP instruction. + */ + SMCR = (1 << SE); + + /* + * Timer 0 setup. + */ + TCCR0A = (1 << WGM01) | (0 << WGM00) | // CTC mode. + (0 << COM0A1) | (0 << COM0A0) | // OC0A disabled (normal I/O). + (0 << CS02) | (1 << CS01) | (1 << CS00); // CLK/64 clock source. + OCR0A = F_CPU / 64 / CH_FREQUENCY - 1; + TCNT0 = 0; // Reset counter. + TIFR0 = (1 << OCF0A); // Reset pending (if any). + TIMSK0 = (1 << OCIE0A); // Interrupt on compare. + + /* + * Other initializations. + */ + InitSerial(); +} diff --git a/demos/AVR-AT90CANx-GCC/board.h b/demos/AVR-AT90CANx-GCC/board.h new file mode 100644 index 000000000..fefd6a39c --- /dev/null +++ b/demos/AVR-AT90CANx-GCC/board.h @@ -0,0 +1,86 @@ +/* + ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +#define BOARD_OLIMEX_AVR_CAN + +/* + * All inputs with pullups. + */ +#define VAL_DDRA 0x00 +#define VAL_PORTA 0xFF + +/* + * All inputs with pullups. + */ +#define VAL_DDRB 0x00 +#define VAL_PORTB 0xFF + +/* + * All inputs with pullups. + */ +#define VAL_DDRC 0x00 +#define VAL_PORTC 0xFF + +/* PD7 PD6 PD5 PD4 PD3 PD2 PD1 PD0 + * IN IN OUT IN OUT IN IN IN + * DDRD 0 0 1 0 1 0 0 0 + * PU HiZ VAL PU VAL HiZ HiZ HiZ + * PORTD 1 0 ?1 1 1 0 0 0 + */ +#define VAL_DDRD 0x28 +#define VAL_PORTD 0xB8 + +/* PE7 PE6 BUT LED PE3 PE2 PE1 PE0 + * IN IN IN OUT IN IN OUT IN + * DDRE 0 0 0 1 0 0 1 0 + * PU PU HiZ VAL PU PU VAL HiZ + * PORTE 1 1 0 1 1 1 1 0 + */ +#define VAL_DDRE 0x12 +#define VAL_PORTE 0xDE + +/* TDI TDO TMS TCK PF3 PF2 PF1 PF0 + * x x x x IN IN IN IN + * DDRF 0 0 0 0 0 0 0 0 + * x x x x PU PU PU PU + * PORTF 0 0 0 0 1 1 1 1 + * + */ +#define VAL_DDRF 0x00 +#define VAL_PORTF 0x0F + +/* x x x x x PG2 PG1 PG0 + * x x x x x IN IN IN + * DDRG 0 0 0 0 0 0 0 0 + * x x x x x PU PU PU + * PORTG 0 0 0 0 0 1 1 1 + * + */ +#define VAL_DDRG 0x00 +#define VAL_PORTG 0x07 + +#define PORTE_LED (1 << 4) +#define PORTE_BUTTON (1 << 5) + +void hwinit(void); + +#endif /* _BOARD_H_ */ diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 162255af5..17c2c3d38 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -17,6 +17,10 @@ along with this program. If not, see . */ +/* + * Configuration file for LPC214x-GCC demo project. + */ + /** * @addtogroup Config * @{ @@ -25,15 +29,10 @@ #ifndef _CHCONF_H_ #define _CHCONF_H_ -/* - * NOTE: this is just documentation for doxigen, the real configuration file - * is the one into the project directories. - */ - /** Configuration option: if specified then time efficient rather than space * efficient code is used when two possible implementations exist, note * that this is not related to the compiler optimization options.*/ -//#define CH_OPTIMIZE_SPEED +#define CH_OPTIMIZE_SPEED /** Configuration option: if specified then the Virtual Timers subsystem is * included in the kernel.*/ @@ -151,9 +150,9 @@ * on processors with many registers like ARM cores. * @note If this option is enabled then ALL the libraries linked to the * ChibiOS/RT code must be recompiled with the GCC option \p - * -ffixed-\. + * -ffixed-. */ -//#define CH_CURRP_REGISTER_CACHE "reg" +//#define CH_CURRP_REGISTER_CACHE "r8" /** Configuration option: Includes basic debug support to the kernel. * @note the debug support is port-dependent, it may be not present on some diff --git a/demos/AVR-AT90CANx-GCC/chcore.c b/demos/AVR-AT90CANx-GCC/chcore.c deleted file mode 100644 index 3bc5b027e..000000000 --- a/demos/AVR-AT90CANx-GCC/chcore.c +++ /dev/null @@ -1,137 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include - -#include - -/* - * All inputs with pullups. - */ -#define VAL_DDRA 0x00 -#define VAL_PORTA 0xFF - -/* - * All inputs with pullups. - */ -#define VAL_DDRB 0x00 -#define VAL_PORTB 0xFF - -/* - * All inputs with pullups. - */ -#define VAL_DDRC 0x00 -#define VAL_PORTC 0xFF - -/* PD7 PD6 PD5 PD4 PD3 PD2 PD1 PD0 - * IN IN OUT IN OUT IN IN IN - * DDRD 0 0 1 0 1 0 0 0 - * PU HiZ VAL PU VAL HiZ HiZ HiZ - * PORTD 1 0 ?1 1 1 0 0 0 - */ -#define VAL_DDRD 0x28 -#define VAL_PORTD 0xB8 - -/* PE7 PE6 BUT LED PE3 PE2 PE1 PE0 - * IN IN IN OUT IN IN OUT IN - * DDRE 0 0 0 1 0 0 1 0 - * PU PU HiZ VAL PU PU VAL HiZ - * PORTE 1 1 0 1 1 1 1 0 - */ -#define VAL_DDRE 0x12 -#define VAL_PORTE 0xDE - -/* TDI TDO TMS TCK PF3 PF2 PF1 PF0 - * x x x x IN IN IN IN - * DDRF 0 0 0 0 0 0 0 0 - * x x x x PU PU PU PU - * PORTF 0 0 0 0 1 1 1 1 - * - */ -#define VAL_DDRF 0x00 -#define VAL_PORTF 0x0F - -/* x x x x x PG2 PG1 PG0 - * x x x x x IN IN IN - * DDRG 0 0 0 0 0 0 0 0 - * x x x x x PU PU PU - * PORTG 0 0 0 0 0 1 1 1 - * - */ -#define VAL_DDRG 0x00 -#define VAL_PORTG 0x07 - -void hwinit(void) { - - /* - * I/O ports setup. - */ - DDRA = VAL_DDRA; - PORTA = VAL_PORTA; - DDRB = VAL_DDRB; - PORTB = VAL_PORTB; - DDRC = VAL_DDRC; - PORTC = VAL_PORTC; - DDRD = VAL_DDRD; - PORTD = VAL_PORTD; - DDRE = VAL_DDRE; - PORTE = VAL_PORTE; - DDRF = VAL_DDRF; - PORTF = VAL_PORTF; - DDRG = VAL_DDRG; - PORTG = VAL_PORTG; - - /* - * External interrupts setup, all disabled initially. - */ - EICRA = 0x00; - EICRB = 0x00; - EIMSK = 0x00; - - /* - * Enables Idle mode for SLEEP instruction. - */ - SMCR = 1; - - /* - * Timer 0 setup. - */ - TCCR0A = (1 << WGM01) | (0 << WGM00) | // CTC mode. - (0 << COM0A1) | (0 << COM0A0) | // OC0A disabled (normal I/O). - (0 << CS02) | (1 << CS01) | (1 << CS00); // CLK/64 clock source. - OCR0A = F_CPU / 64 / CH_FREQUENCY - 1; - TCNT0 = 0; // Reset counter. - TIFR0 = (1 << OCF0A); // Reset pending (if any). - TIMSK0 = (1 << OCIE0A); // Interrupt on compare. -} - -void _IdleThread(void *p) { - - while (TRUE) { -// asm volatile ("sleep"); - } -} - -void chSysHalt(void) { - - chSysLock(); - - while (TRUE) - ; -} diff --git a/demos/AVR-AT90CANx-GCC/chcore.h b/demos/AVR-AT90CANx-GCC/chcore.h deleted file mode 100644 index 9e1b95db8..000000000 --- a/demos/AVR-AT90CANx-GCC/chcore.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/** - * @addtogroup Core - * @{ - */ - -#ifndef _CHCORE_H_ -#define _CHCORE_H_ - -/* - * Interrupt saved context. - */ -struct extctx { - BYTE8 sr; - BYTE8 r31; - BYTE8 r30; - BYTE8 r27; - BYTE8 r26; - BYTE8 r25; - BYTE8 r24; - BYTE8 r23; - BYTE8 r22; - BYTE8 r21; - BYTE8 r20; - BYTE8 r19; - BYTE8 r18; - BYTE8 r1; - BYTE8 r0; - UWORD16 pc; -}; - -/* - * System saved context. - */ -struct intctx { - BYTE8 r29; - BYTE8 r28; - BYTE8 r17; - BYTE8 r16; - BYTE8 r15; - BYTE8 r14; - BYTE8 r13; - BYTE8 r12; - BYTE8 r11; - BYTE8 r10; - BYTE8 r9; - BYTE8 r8; - BYTE8 r7; - BYTE8 r6; - BYTE8 r5; - BYTE8 r4; - BYTE8 r3; - BYTE8 r2; - UWORD16 pc; -}; - -/* - * Port dependent part of the Thread structure, you may add fields in - * this structure. - */ -typedef struct { - struct intctx *sp; -} Context; - -/** - * Platform dependent part of the \p chThdCreate() API. - */ -#define SETUP_CONTEXT(workspace, wsize, pf, arg) { \ - tp->p_ctx.sp--; \ - tp->p_ctx.sp->r2 = (int)pf; \ - tp->p_ctx.sp->r3 = (int)pf >> 8; \ - tp->p_ctx.sp->r4 = (int)arg; \ - tp->p_ctx.sp->r5 = (int)arg >> 8; \ - tp->p_ctx.sp->pc = (UWORD16)threadstart; \ -} - -#define INT_REQUIRED_STACK 0x10 -#define StackAlign(n) (n) -#define UserStackSize(n) StackAlign(sizeof(Thread) + \ - sizeof(struct intctx) + \ - sizeof(struct extctx) + \ - (n) + (INT_REQUIRED_STACK)) -#define WorkingArea(s, n) BYTE8 s[UserStackSize(n)]; - -#define chSysLock() asm("cli") -#define chSysUnlock() asm("sei") -#define chSysPuts(msg) {} - -#define IDLE_THREAD_STACK_SIZE 8 -void _IdleThread(void *p) __attribute__((noreturn)); - -void chSysHalt(void) __attribute__((noreturn)) ; -void chSysSwitchI(Context *oldp, Context *newp); -void threadstart(void); - -#endif /* _CHCORE_H_ */ - -/** @} */ diff --git a/demos/AVR-AT90CANx-GCC/chcore2.S b/demos/AVR-AT90CANx-GCC/chcore2.S deleted file mode 100644 index 96c17f011..000000000 --- a/demos/AVR-AT90CANx-GCC/chcore2.S +++ /dev/null @@ -1,123 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include - -.global threadstart -threadstart: - sei - movw r24, r4 // argument - movw r30, r2 // thread function - icall - call chThdExit - -.global chSysSwitchI -chSysSwitchI: - push r2 - push r3 - push r4 - push r5 - push r6 - push r7 - push r8 - push r9 - push r10 - push r11 - push r12 - push r13 - push r14 - push r15 - push r16 - push r17 - push r28 - push r29 - movw r30, r24 // Z <- oldp - in r0, _SFR_IO_ADDR(SPL) - st Z, r0 - in r0, _SFR_IO_ADDR(SPH) - std Z+1, r0 - - movw r30, r22 // Z <- newp - ld r0, Z - out _SFR_IO_ADDR(SPL), r0 - ldd r0, Z+1 - out _SFR_IO_ADDR(SPH), r0 - pop r29 - pop r28 - pop r17 - pop r16 - pop r15 - pop r14 - pop r13 - pop r12 - pop r11 - pop r10 - pop r9 - pop r8 - pop r7 - pop r6 - pop r5 - pop r4 - pop r3 - pop r2 - ret - -.global __vector_17 -__vector_17: - push r0 - push r1 - push r18 - push r19 - push r20 - push r21 - push r22 - push r23 - push r24 - push r25 - push r26 - push r27 - push r30 - push r31 - in r0, _SFR_IO_ADDR(SREG) - push r0 - clr r1 - call chSysTimerHandlerI -intcommon: - call chSchRescRequiredI - tst r24 - breq noschd - call chSchDoRescheduleI -noschd: - pop r0 - out _SFR_IO_ADDR(SREG), r0 - pop r31 - pop r30 - pop r27 - pop r26 - pop r25 - pop r24 - pop r23 - pop r22 - pop r21 - pop r20 - pop r19 - pop r18 - pop r1 - pop r0 - reti diff --git a/demos/AVR-AT90CANx-GCC/chtypes.h b/demos/AVR-AT90CANx-GCC/chtypes.h deleted file mode 100644 index 60e16aaf4..000000000 --- a/demos/AVR-AT90CANx-GCC/chtypes.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#ifndef _CHTYPES_H_ -#define _CHTYPES_H_ - -/* - * Generic types often dependant on the compiler. - */ -#define BOOL char -#define BYTE8 unsigned char -#define SBYTE8 signed char -#define WORD16 int -#define UWORD16 unsigned int -#define LONG32 long -#define ULONG32 unsigned long -#define PTR_EQ int - -typedef BYTE8 t_tmode; -typedef BYTE8 t_tstate; -typedef BYTE8 t_tid; -typedef BYTE8 t_prio; -typedef WORD16 t_msg; -typedef BYTE8 t_eventid; -typedef BYTE8 t_eventmask; -typedef UWORD16 t_time; -typedef SBYTE8 t_cnt; -typedef UWORD16 t_size; - -#define INLINE inline - -#endif /* _CHTYPES_H_ */ diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c index 14c45cf47..2379b670f 100644 --- a/demos/AVR-AT90CANx-GCC/main.c +++ b/demos/AVR-AT90CANx-GCC/main.c @@ -18,21 +18,38 @@ */ #include +#include +#include #include +#include "board.h" + void hwinit(void); static WorkingArea(waThread1, 32); -static t_msg Thread1(void *arg) { +static msg_t Thread1(void *arg) { while (TRUE) { - chThdSleep(800); + PORTE ^= PORTE_LED; + chThdSleep(500); } return 0; } +static void TimerHandler(eventid_t id) { + msg_t TestThread(void *p); + + if (!(PORTE & PORTE_BUTTON)) + TestThread(&SER2); +} + int main(int argc, char **argv) { + static EvTimer evt; + static evhandler_t handlers[1] = { + TimerHandler + }; + static EventListener el0; hwinit(); @@ -42,13 +59,20 @@ int main(int argc, char **argv) { */ chSysInit(); + /* + * Event Timer initialization. + */ + evtInit(&evt, 500); /* Initializes an event timer object. */ + evtStart(&evt); /* Starts the event timer. */ + chEvtRegister(&evt.et_es, &el0, 0); /* Registers on the timer event source. */ + /* * Starts the LED blinker thread. */ chThdCreate(NORMALPRIO, 0, waThread1, sizeof(waThread1), Thread1, NULL); while(TRUE) - /* Do stuff*/ ; + chEvtWait(ALL_EVENTS, handlers); return 0; } diff --git a/demos/AVR-AT90CANx-GCC/readme.txt b/demos/AVR-AT90CANx-GCC/readme.txt new file mode 100644 index 000000000..3102bcf15 --- /dev/null +++ b/demos/AVR-AT90CANx-GCC/readme.txt @@ -0,0 +1,25 @@ +***************************************************************************** +** ChibiOS/RT port for Atmel AVR AT90CAN128. ** +***************************************************************************** + +** TARGET ** + +The demo runs on an Olimex AVR-CAN board. + +** The Demo ** + +The demo currently just flashes the board LED using a thread. It will be +expanded in next releases. +By pressing the board button the test suite is activated, output on serial +port 2. + +** Build Procedure ** + +The demo was built using the WinAVR toolchain. + +** Notes ** + +The demo requires include files from WinAVR that are not part of the ChibiOS/RT +distribution, please install WinAVR. + + http://winavr.sourceforge.net/ -- cgit v1.2.3 From 777291ac8aaed233aa79bb4388ff3485e4c19de1 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 12 Mar 2008 21:05:13 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@228 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/Makefile b/demos/AVR-AT90CANx-GCC/Makefile index 106c3c390..37c56acf9 100644 --- a/demos/AVR-AT90CANx-GCC/Makefile +++ b/demos/AVR-AT90CANx-GCC/Makefile @@ -161,7 +161,7 @@ CFLAGS += -funsigned-char CFLAGS += -funsigned-bitfields CFLAGS += -fpack-struct CFLAGS += -fshort-enums -CFLAGS += -fno-strict-aliasing +#CFLAGS += -fno-strict-aliasing CFLAGS += -Wall CFLAGS += -Wstrict-prototypes #CFLAGS += -mshort-calls -- cgit v1.2.3 From cc44376c6e07d5c47561db9f6179e51e0654391d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 26 Jun 2008 14:06:21 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@325 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/Makefile b/demos/AVR-AT90CANx-GCC/Makefile index 37c56acf9..a72f1f913 100644 --- a/demos/AVR-AT90CANx-GCC/Makefile +++ b/demos/AVR-AT90CANx-GCC/Makefile @@ -79,14 +79,16 @@ TARGET = ch OBJDIR = . +# Imported source files +include ../../src/kernel.mk +include ../../test/test.mk + + # List C source files here. (C dependencies are automatically generated.) SRC = ../../ports/AVR/chcore.c ../../ports/AVR/avr_serial.c \ - ../../src/chinit.c ../../src/chdebug.c ../../src/chlists.c ../../src/chdelta.c \ - ../../src/chschd.c ../../src/chthreads.c ../../src/chsem.c ../../src/chmtx.c \ - ../../src/chevents.c ../../src/chmsg.c ../../src/chsleep.c ../../src/chqueues.c \ - ../../src/chserial.c \ + ${KERNSRC} \ + ${TESTSRC} \ ../../src/lib/evtimer.c \ - ../../test/test.c \ board.c main.c -- cgit v1.2.3 From f53cac6961b33a09913a5ae87dfe410686f153bb Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 4 Jul 2008 12:12:25 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@333 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c index 2379b670f..9dde101ef 100644 --- a/demos/AVR-AT90CANx-GCC/main.c +++ b/demos/AVR-AT90CANx-GCC/main.c @@ -69,7 +69,7 @@ int main(int argc, char **argv) { /* * Starts the LED blinker thread. */ - chThdCreate(NORMALPRIO, 0, waThread1, sizeof(waThread1), Thread1, NULL); + chThdCreateFast(NORMALPRIO, waThread1, sizeof(waThread1), Thread1); while(TRUE) chEvtWait(ALL_EVENTS, handlers); -- cgit v1.2.3 From eb9b4efd31018e4949e3cc09830a5ecfc1304664 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 25 Jul 2008 14:32:39 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@353 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 17c2c3d38..fca0159a2 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -38,6 +38,10 @@ * included in the kernel.*/ #define CH_USE_VIRTUAL_TIMERS +/** Configuration option: if specified then the kernel performs the round + * robin scheduling algorithm on threads of equal priority. */ +#define CH_USE_ROUNDROBIN + /** Configuration option: if specified then the System Timer subsystem is * included in the kernel.*/ #define CH_USE_SYSTEMTIME @@ -138,7 +142,8 @@ #define CH_FREQUENCY 1000 /** Configuration option: This constant is the number of ticks allowed for the - * threads before preemption occurs.*/ + * threads before preemption occurs. This option is only meaningful if the + * option \p CH_USE_ROUNDROBIN is also active.*/ #define CH_TIME_QUANTUM 20 /** Configuration option: Defines a CPU register to be used as storage for the -- cgit v1.2.3 From 6ae1a6c88223d875f0dbd81066d4d8f40713b0a0 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 26 Jul 2008 09:46:43 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@360 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index fca0159a2..a6b0f4a95 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -75,6 +75,10 @@ * APIs are included in the kernel.*/ #define CH_USE_SEMSW +/** Configuration option: if specified then the Conditional Variables APIs are + * included in the kernel.*/ +#define CH_USE_CONDVARS + /** Configuration option: if specified then the Semaphores with timeout APIs * are included in the kernel. * @note requires \p CH_USE_SEMAPHORES. -- cgit v1.2.3 From b27329f45b8e51d9ee2149e2ea102d13ce15f886 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 26 Jul 2008 17:39:01 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@366 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index a6b0f4a95..fca0159a2 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -75,10 +75,6 @@ * APIs are included in the kernel.*/ #define CH_USE_SEMSW -/** Configuration option: if specified then the Conditional Variables APIs are - * included in the kernel.*/ -#define CH_USE_CONDVARS - /** Configuration option: if specified then the Semaphores with timeout APIs * are included in the kernel. * @note requires \p CH_USE_SEMAPHORES. -- cgit v1.2.3 From ac6b3caba1b75ca603e63946f8ca7f54c7ab598f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 26 Aug 2008 10:38:29 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@407 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index fca0159a2..182ba1a9b 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -137,6 +137,14 @@ * are included in the kernel.*/ #define CH_USE_SERIAL_HALFDUPLEX +/** Configuration option: if specified then the memory pools allocator APIs + * are included in the kernel.*/ +#define CH_USE_MEMPOOLS + +/** Configuration option: if specified then the memory pools allocator + provides an implementation of the sbrk() function.*/ +#define CH_MEMPOOLS_PROVIDE_SBRK + /** Configuration option: Frequency of the system timer that drives the system * ticks. This also defines the system time unit.*/ #define CH_FREQUENCY 1000 -- cgit v1.2.3 From d9d134c7ad07db84b3555d56e9ea388593e60fb2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 26 Aug 2008 12:22:11 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@408 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 182ba1a9b..bd9c528d2 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -139,11 +139,11 @@ /** Configuration option: if specified then the memory pools allocator APIs * are included in the kernel.*/ -#define CH_USE_MEMPOOLS +//#define CH_USE_MEMPOOLS /** Configuration option: if specified then the memory pools allocator provides an implementation of the sbrk() function.*/ -#define CH_MEMPOOLS_PROVIDE_SBRK +//#define CH_MEMPOOLS_PROVIDE_SBRK /** Configuration option: Frequency of the system timer that drives the system * ticks. This also defines the system time unit.*/ -- cgit v1.2.3 From 7768c51b7b1ef0becc4090705a9bd2f14aa28d00 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 28 Aug 2008 13:34:46 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@412 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index bd9c528d2..594d28272 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -137,13 +137,25 @@ * are included in the kernel.*/ #define CH_USE_SERIAL_HALFDUPLEX -/** Configuration option: if specified then the memory pools allocator APIs +/** Configuration option: if specified then the memory heap allocator APIs * are included in the kernel.*/ -//#define CH_USE_MEMPOOLS +#define CH_USE_HEAP + +/** Configuration option: Number of RAM bytes to use as system heap. If set to + * zero then the whole available RAM is used as system heap. + * @note In order to use the whole RAM as system heap the linker script must + * provide the \p __heap_base__ and \p __heap_end__ symbols. + * @note requires \p CH_USE_HEAP. + */ +#define CH_HEAP_SIZE 0 -/** Configuration option: if specified then the memory pools allocator - provides an implementation of the sbrk() function.*/ -//#define CH_MEMPOOLS_PROVIDE_SBRK +/** Configuration option: enforces the use of the C-runtime \p malloc() and + * \p free() functions as backend for the system heap allocator.*/ +#define CH_USE_MALLOC_HEAP + +/** Configuration option: if specified then the memory pools allocator APIs + * are included in the kernel.*/ +#define CH_USE_MEMPOOLS /** Configuration option: Frequency of the system timer that drives the system * ticks. This also defines the system time unit.*/ -- cgit v1.2.3 From 071e9457b0645f07a90485bd7a7c68fa5e34801b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 3 Sep 2008 12:18:39 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@421 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 594d28272..132bc4f15 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -46,23 +46,6 @@ * included in the kernel.*/ #define CH_USE_SYSTEMTIME -/** Configuration option: if specified then the \p chThdSleep() function is - * included in the kernel. - * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ -#define CH_USE_SLEEP - -/** Configuration option: if specified then the \p chThdResume() - * function is included in the kernel.*/ -#define CH_USE_RESUME - -/** Configuration option: if specified then the \p chThdSuspend() - * function is included in the kernel.*/ -#define CH_USE_SUSPEND - -/** Configuration option: if specified then the \p chThdTerminate() - * and \p chThdShouldTerminate() functions are included in the kernel.*/ -#define CH_USE_TERMINATE - /** Configuration option: if specified then the \p chThdWait() function * is included in the kernel.*/ #define CH_USE_WAITEXIT -- cgit v1.2.3 From 517440bad9d6d2f27689e4e3de72794d869d2c26 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 5 Sep 2008 13:04:28 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@425 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 132bc4f15..eca46b974 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -34,6 +34,13 @@ * that this is not related to the compiler optimization options.*/ #define CH_OPTIMIZE_SPEED +/** Configuration option: it specified this option enables the \p Thread + * extension fields and initiazation code. + * @see THREAD_EXT_FIELDS + * @see THREAD_EXT_INIT + */ +//#define CH_USE_THREAD_EXT + /** Configuration option: if specified then the Virtual Timers subsystem is * included in the kernel.*/ #define CH_USE_VIRTUAL_TIMERS @@ -172,6 +179,23 @@ */ //#define CH_USE_TRACE +/** User fields added to the end of the \p Thread structure if the + * \p CH_USE_THREAD_EXT option is enabled. + * @see CH_USE_THREAD_EXT + */ +#define THREAD_EXT_FIELDS \ +struct { \ + /* Add fields here.*/ \ +}; + +/** User initialization code added to the \p chThdCreate() API if the + * \p CH_USE_THREAD_EXT option is enabled. + * @see CH_USE_THREAD_EXT + */ +#define THREAD_EXT_INIT(tp) { \ + /* Add initialization code here.*/ \ +} + #endif /* _CHCONF_H_ */ /** @} */ -- cgit v1.2.3 From 15ee17c8740a378cffcae681421b9e28fcde3d4c Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 6 Sep 2008 08:56:34 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@426 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index eca46b974..1d9f2acff 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -102,9 +102,10 @@ /** Configuration option: if specified then the * \p chThdGetExitEventSource() function is included in the kernel. + * @deprecated * @note requires \p CH_USE_MESSAGES. * @note requires \p CH_USE_EVENTS.*/ -#define CH_USE_EXIT_EVENT +//#define CH_USE_EXIT_EVENT /** Configuration option: if specified then the I/O queues APIs are included * in the kernel.*/ -- cgit v1.2.3 From a474010e54534785366d1924554f5452725499b0 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 11 Sep 2008 15:03:25 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@430 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 1d9f2acff..eca46b974 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -102,10 +102,9 @@ /** Configuration option: if specified then the * \p chThdGetExitEventSource() function is included in the kernel. - * @deprecated * @note requires \p CH_USE_MESSAGES. * @note requires \p CH_USE_EVENTS.*/ -//#define CH_USE_EXIT_EVENT +#define CH_USE_EXIT_EVENT /** Configuration option: if specified then the I/O queues APIs are included * in the kernel.*/ -- cgit v1.2.3 From 9a1c91e6ee9baaee3529e16fc732cbd9c7e99844 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 22 Sep 2008 15:29:48 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@437 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index eca46b974..a3c3697af 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -147,6 +147,12 @@ * are included in the kernel.*/ #define CH_USE_MEMPOOLS +/** Configuration option: if specified then the dynamic objects creation APIs + * are included in the kernel. + * @note requires \p CH_USE_WAITEXIT. + */ +#define CH_USE_DYNAMIC + /** Configuration option: Frequency of the system timer that drives the system * ticks. This also defines the system time unit.*/ #define CH_FREQUENCY 1000 -- cgit v1.2.3 From c9205e2fd961c60cffd1000936340806a8e45558 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 24 Sep 2008 12:28:07 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@442 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c index 9dde101ef..987deb072 100644 --- a/demos/AVR-AT90CANx-GCC/main.c +++ b/demos/AVR-AT90CANx-GCC/main.c @@ -69,7 +69,7 @@ int main(int argc, char **argv) { /* * Starts the LED blinker thread. */ - chThdCreateFast(NORMALPRIO, waThread1, sizeof(waThread1), Thread1); + chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); while(TRUE) chEvtWait(ALL_EVENTS, handlers); -- cgit v1.2.3 From 8feba91865981a1cb8b1ba12c4bce09997141f2f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 26 Sep 2008 10:46:10 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@444 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index a3c3697af..ea26be7ad 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -34,13 +34,6 @@ * that this is not related to the compiler optimization options.*/ #define CH_OPTIMIZE_SPEED -/** Configuration option: it specified this option enables the \p Thread - * extension fields and initiazation code. - * @see THREAD_EXT_FIELDS - * @see THREAD_EXT_INIT - */ -//#define CH_USE_THREAD_EXT - /** Configuration option: if specified then the Virtual Timers subsystem is * included in the kernel.*/ #define CH_USE_VIRTUAL_TIMERS @@ -102,8 +95,10 @@ /** Configuration option: if specified then the * \p chThdGetExitEventSource() function is included in the kernel. - * @note requires \p CH_USE_MESSAGES. - * @note requires \p CH_USE_EVENTS.*/ + * @note requires \p CH_USE_EVENTS. + * @deprecated \p THREAD_EXT_EXIT should be used, this functionality will be + * removed in version 1.0.0. + */ #define CH_USE_EXIT_EVENT /** Configuration option: if specified then the I/O queues APIs are included @@ -185,21 +180,22 @@ */ //#define CH_USE_TRACE -/** User fields added to the end of the \p Thread structure if the - * \p CH_USE_THREAD_EXT option is enabled. - * @see CH_USE_THREAD_EXT - */ +/** User fields added to the end of the \p Thread structure. */ #define THREAD_EXT_FIELDS \ struct { \ - /* Add fields here.*/ \ + /* Add thread custom fields here.*/ \ }; -/** User initialization code added to the \p chThdCreate() API if the - * \p CH_USE_THREAD_EXT option is enabled. - * @see CH_USE_THREAD_EXT - */ +/** User initialization code added to the \p chThdCreate() API. + * @note It is invoked from within \p chThdInit(). */ #define THREAD_EXT_INIT(tp) { \ - /* Add initialization code here.*/ \ + /* Add thread initialization code here.*/ \ +} + +/** User finalization code added to the \p chThdExit() API. + * @note It is inserted into lock zone. */ +#define THREAD_EXT_EXIT(tp) { \ + /* Add thread finalization code here.*/ \ } #endif /* _CHCONF_H_ */ -- cgit v1.2.3 From 902470d1c542735b989a727355744a974af43de4 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 25 Oct 2008 09:34:25 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@481 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index ea26be7ad..8408f6f22 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -17,10 +17,6 @@ along with this program. If not, see . */ -/* - * Configuration file for LPC214x-GCC demo project. - */ - /** * @addtogroup Config * @{ @@ -34,18 +30,10 @@ * that this is not related to the compiler optimization options.*/ #define CH_OPTIMIZE_SPEED -/** Configuration option: if specified then the Virtual Timers subsystem is - * included in the kernel.*/ -#define CH_USE_VIRTUAL_TIMERS - /** Configuration option: if specified then the kernel performs the round * robin scheduling algorithm on threads of equal priority. */ #define CH_USE_ROUNDROBIN -/** Configuration option: if specified then the System Timer subsystem is - * included in the kernel.*/ -#define CH_USE_SYSTEMTIME - /** Configuration option: if specified then the \p chThdWait() function * is included in the kernel.*/ #define CH_USE_WAITEXIT @@ -60,8 +48,7 @@ /** Configuration option: if specified then the Semaphores with timeout APIs * are included in the kernel. - * @note requires \p CH_USE_SEMAPHORES. - * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ + * @note requires \p CH_USE_SEMAPHORES.*/ #define CH_USE_SEMAPHORES_TIMEOUT /** Configuration option: if specified then the Mutexes APIs are included in @@ -74,8 +61,7 @@ /** Configuration option: if specified then the \p chEvtWaitTimeout() * function is included in the kernel. - * @note requires \p CH_USE_EVENTS. - * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ + * @note requires \p CH_USE_EVENTS.*/ #define CH_USE_EVENTS_TIMEOUT /** Configuration option: if specified then the Synchronous Messages APIs are @@ -84,8 +70,7 @@ /** Configuration option: if specified then the \p chMsgSendWithEvent() * function is included in the kernel. - * @note requires \p CH_USE_MESSAGES. - * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ + * @note requires \p CH_USE_MESSAGES.*/ #define CH_USE_MESSAGES_EVENT /** Configuration option: If enabled then the threads have an option to serve -- cgit v1.2.3 From 9336c1fc9fdae776126295737131d0a22b2f05b8 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 8 Nov 2008 10:58:59 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@501 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 8408f6f22..383f714f3 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -59,11 +59,6 @@ * the kernel.*/ #define CH_USE_EVENTS -/** Configuration option: if specified then the \p chEvtWaitTimeout() - * function is included in the kernel. - * @note requires \p CH_USE_EVENTS.*/ -#define CH_USE_EVENTS_TIMEOUT - /** Configuration option: if specified then the Synchronous Messages APIs are * included in the kernel.*/ #define CH_USE_MESSAGES -- cgit v1.2.3 From cbc30670d8004caeb7b0a8a9567377ac99032805 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 8 Nov 2008 12:44:36 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@502 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 383f714f3..7e972155f 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -59,6 +59,12 @@ * the kernel.*/ #define CH_USE_EVENTS +/** Configuration option: if specified then the \p chEvtWaitXXXTimeout() + * functions are included in the kernel. + * @note requires \p CH_USE_EVENTS. + */ +#define CH_USE_EVENTS_TIMEOUT + /** Configuration option: if specified then the Synchronous Messages APIs are * included in the kernel.*/ #define CH_USE_MESSAGES -- cgit v1.2.3 From aafa0564b8cdd61c68165217a4b7576bd35b2b4b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 9 Nov 2008 13:28:19 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@508 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 7e972155f..89b01bfae 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -55,6 +55,16 @@ * the kernel.*/ #define CH_USE_MUTEXES +/** Configuration option: if specified then the Conditional Variables APIs are + * included in the kernel. + * @note requires \p CH_USE_MUTEXES.*/ +#define CH_USE_CONDVARS + +/** Configuration option: if specified then the Conditional Variables APIs are + * included in the kernel. + * @note requires \p CH_USE_CONDVARS and \p CH_USE_MUTEXES.*/ +#define CH_USE_CONDVARS_TIMEOUT + /** Configuration option: if specified then the Events APIs are included in * the kernel.*/ #define CH_USE_EVENTS -- cgit v1.2.3 From 554e9da84ac99455e812d366418dc508eb51f09d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 15 Nov 2008 10:34:35 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@511 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c index 987deb072..b7e646c6b 100644 --- a/demos/AVR-AT90CANx-GCC/main.c +++ b/demos/AVR-AT90CANx-GCC/main.c @@ -32,7 +32,7 @@ static msg_t Thread1(void *arg) { while (TRUE) { PORTE ^= PORTE_LED; - chThdSleep(500); + chThdSleepMilliseconds(500); } return 0; } @@ -62,7 +62,7 @@ int main(int argc, char **argv) { /* * Event Timer initialization. */ - evtInit(&evt, 500); /* Initializes an event timer object. */ + evtInit(&evt, MS2ST(500)); /* Initializes an event timer object. */ evtStart(&evt); /* Starts the event timer. */ chEvtRegister(&evt.et_es, &el0, 0); /* Registers on the timer event source. */ @@ -72,7 +72,7 @@ int main(int argc, char **argv) { chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); while(TRUE) - chEvtWait(ALL_EVENTS, handlers); + chEvtDispatch(handlers, chEvtWaitOne(ALL_EVENTS)); return 0; } -- cgit v1.2.3 From 62d821990abb79f9c7bb27f32d249bc934fa0990 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 29 Nov 2008 12:55:35 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@524 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c index b7e646c6b..aa9b99dc0 100644 --- a/demos/AVR-AT90CANx-GCC/main.c +++ b/demos/AVR-AT90CANx-GCC/main.c @@ -27,7 +27,7 @@ void hwinit(void); -static WorkingArea(waThread1, 32); +static WORKING_AREA(waThread1, 32); static msg_t Thread1(void *arg) { while (TRUE) { -- cgit v1.2.3 From 3e9765e2069a9faedff2721a1abf46607cf1189d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 28 Dec 2008 10:07:46 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@545 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 89b01bfae..4900dd240 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -84,19 +84,11 @@ * @note requires \p CH_USE_MESSAGES.*/ #define CH_USE_MESSAGES_EVENT -/** Configuration option: If enabled then the threads have an option to serve - * messages by priority instead of FIFO order. +/** Configuration option: If enabled then the threads serve messages by + * priority instead of FIFO order. * @note requires \p CH_USE_MESSAGES.*/ //#define CH_USE_MESSAGES_PRIORITY -/** Configuration option: if specified then the - * \p chThdGetExitEventSource() function is included in the kernel. - * @note requires \p CH_USE_EVENTS. - * @deprecated \p THREAD_EXT_EXIT should be used, this functionality will be - * removed in version 1.0.0. - */ -#define CH_USE_EXIT_EVENT - /** Configuration option: if specified then the I/O queues APIs are included * in the kernel.*/ #define CH_USE_QUEUES -- cgit v1.2.3 From e1b6b9e988d70442e71b520f5a8f43e355688a71 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 9 Jan 2009 14:26:25 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@596 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/board.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/board.c b/demos/AVR-AT90CANx-GCC/board.c index e78360e9a..bd052b9c9 100644 --- a/demos/AVR-AT90CANx-GCC/board.c +++ b/demos/AVR-AT90CANx-GCC/board.c @@ -19,19 +19,18 @@ #include -#include -#include - #include "board.h" #include "avr_serial.h" -ISR(TIMER0_COMP_vect) { +SYS_IRQ_HANDLER(TIMER0_COMP_vect) { - chSysIRQEnterI(); + SYS_IRQ_PROLOGUE(); + chSysLockI(); chSysTimerHandlerI(); + chSysUnlockI(); - chSysIRQExitI(); + SYS_IRQ_EPILOGUE(); } /* -- cgit v1.2.3 From e2b6b440e12562804f161d8db677554bbd666bd1 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 10 Jan 2009 16:21:27 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@612 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/board.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/board.c b/demos/AVR-AT90CANx-GCC/board.c index bd052b9c9..cf97132cf 100644 --- a/demos/AVR-AT90CANx-GCC/board.c +++ b/demos/AVR-AT90CANx-GCC/board.c @@ -22,15 +22,15 @@ #include "board.h" #include "avr_serial.h" -SYS_IRQ_HANDLER(TIMER0_COMP_vect) { +CH_IRQ_HANDLER(TIMER0_COMP_vect) { - SYS_IRQ_PROLOGUE(); + CH_IRQ_PROLOGUE(); chSysLockI(); chSysTimerHandlerI(); chSysUnlockI(); - SYS_IRQ_EPILOGUE(); + CH_IRQ_EPILOGUE(); } /* -- cgit v1.2.3 From 8fa109243e5d626a941db8e7d6dc30bb64f9bc9f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 24 Jan 2009 17:59:51 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@675 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/board.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/board.c b/demos/AVR-AT90CANx-GCC/board.c index cf97132cf..96b6c7e53 100644 --- a/demos/AVR-AT90CANx-GCC/board.c +++ b/demos/AVR-AT90CANx-GCC/board.c @@ -26,9 +26,9 @@ CH_IRQ_HANDLER(TIMER0_COMP_vect) { CH_IRQ_PROLOGUE(); - chSysLockI(); + chSysLockFromIsr(); chSysTimerHandlerI(); - chSysUnlockI(); + chSysUnlockFromIsr(); CH_IRQ_EPILOGUE(); } -- cgit v1.2.3 From ec4178dd0ff7587b79a8c525aa88d467642ce629 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 2 Feb 2009 12:48:17 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@712 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 4900dd240..2cf2f8507 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -42,6 +42,11 @@ * in the kernel.*/ #define CH_USE_SEMAPHORES +/** Configuration option: If enabled then the threads are enqueued on semaphores + * by priority rather than FIFO order. + * @note requires @p CH_USE_SEMAPHORES.*/ +//#define CH_USE_SEMAPHORES_PRIORITY + /** Configuration option: if specified then the Semaphores atomic Signal+Wait * APIs are included in the kernel.*/ #define CH_USE_SEMSW -- cgit v1.2.3 From aaf826b161d38f5d2139d64b6d18898dbc902b19 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 7 Feb 2009 10:16:14 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@733 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/board.c b/demos/AVR-AT90CANx-GCC/board.c index 96b6c7e53..3119b82be 100644 --- a/demos/AVR-AT90CANx-GCC/board.c +++ b/demos/AVR-AT90CANx-GCC/board.c @@ -82,5 +82,5 @@ void hwinit(void) { /* * Other initializations. */ - InitSerial(); + serial_init(); } -- cgit v1.2.3 From 6cfef53ca56e835c9fcd28206971bf15e17fb31b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 7 Feb 2009 14:59:26 +0000 Subject: Configuration system improvements. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@739 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 450 ++++++++++++++++++++++++++++------------ 1 file changed, 313 insertions(+), 137 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 2cf2f8507..5e787d675 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -18,6 +18,8 @@ */ /** + * @file src/templates/chconf.h + * @brief Configuration file template. * @addtogroup Config * @{ */ @@ -25,171 +27,345 @@ #ifndef _CHCONF_H_ #define _CHCONF_H_ -/** Configuration option: if specified then time efficient rather than space - * efficient code is used when two possible implementations exist, note - * that this is not related to the compiler optimization options.*/ -#define CH_OPTIMIZE_SPEED - -/** Configuration option: if specified then the kernel performs the round - * robin scheduling algorithm on threads of equal priority. */ -#define CH_USE_ROUNDROBIN - -/** Configuration option: if specified then the \p chThdWait() function - * is included in the kernel.*/ -#define CH_USE_WAITEXIT - -/** Configuration option: if specified then the Semaphores APIs are included - * in the kernel.*/ -#define CH_USE_SEMAPHORES - -/** Configuration option: If enabled then the threads are enqueued on semaphores - * by priority rather than FIFO order. - * @note requires @p CH_USE_SEMAPHORES.*/ -//#define CH_USE_SEMAPHORES_PRIORITY - -/** Configuration option: if specified then the Semaphores atomic Signal+Wait - * APIs are included in the kernel.*/ -#define CH_USE_SEMSW - -/** Configuration option: if specified then the Semaphores with timeout APIs - * are included in the kernel. - * @note requires \p CH_USE_SEMAPHORES.*/ -#define CH_USE_SEMAPHORES_TIMEOUT - -/** Configuration option: if specified then the Mutexes APIs are included in - * the kernel.*/ -#define CH_USE_MUTEXES - -/** Configuration option: if specified then the Conditional Variables APIs are - * included in the kernel. - * @note requires \p CH_USE_MUTEXES.*/ -#define CH_USE_CONDVARS - -/** Configuration option: if specified then the Conditional Variables APIs are - * included in the kernel. - * @note requires \p CH_USE_CONDVARS and \p CH_USE_MUTEXES.*/ -#define CH_USE_CONDVARS_TIMEOUT - -/** Configuration option: if specified then the Events APIs are included in - * the kernel.*/ -#define CH_USE_EVENTS - -/** Configuration option: if specified then the \p chEvtWaitXXXTimeout() - * functions are included in the kernel. - * @note requires \p CH_USE_EVENTS. - */ -#define CH_USE_EVENTS_TIMEOUT - -/** Configuration option: if specified then the Synchronous Messages APIs are - * included in the kernel.*/ -#define CH_USE_MESSAGES - -/** Configuration option: if specified then the \p chMsgSendWithEvent() - * function is included in the kernel. - * @note requires \p CH_USE_MESSAGES.*/ -#define CH_USE_MESSAGES_EVENT - -/** Configuration option: If enabled then the threads serve messages by - * priority instead of FIFO order. - * @note requires \p CH_USE_MESSAGES.*/ -//#define CH_USE_MESSAGES_PRIORITY - -/** Configuration option: if specified then the I/O queues APIs are included - * in the kernel.*/ -#define CH_USE_QUEUES - -/** Configuration option: if specified then the halfduplex queue APIs are - * included in the kernel.*/ -#define CH_USE_QUEUES_HALFDUPLEX - -/** Configuration option: if specified then the I/O queues with timeout - * APIs are included in the kernel. - * @note requires \p CH_USE_SEMAPHORES_TIMEOUT.*/ -#define CH_USE_QUEUES_TIMEOUT - -/** Configuration option: if specified then the full duplex serial driver APIs - * are included in the kernel.*/ -#define CH_USE_SERIAL_FULLDUPLEX - -/** Configuration option: if specified then the half duplex serial driver APIs - * are included in the kernel.*/ -#define CH_USE_SERIAL_HALFDUPLEX - -/** Configuration option: if specified then the memory heap allocator APIs - * are included in the kernel.*/ -#define CH_USE_HEAP - -/** Configuration option: Number of RAM bytes to use as system heap. If set to - * zero then the whole available RAM is used as system heap. +/** + * If specified then time efficient rather than space efficient code is used + * when two possible implementations exist. + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#ifndef CH_OPTIMIZE_SPEED +#define CH_OPTIMIZE_SPEED TRUE +#endif + +/** + * If enabled then the use of nested @p chSysLock() / @p chSysUnlock() + * operations is allowed.
+ * For performance and code size reasons the recommended setting is to leave + * this option disabled.
+ * You can use this option if you need to merge ChibiOS/RT with external + * libraries that require nested lock/unlock operations. + * @note The default is @p FALSE. + */ +#ifndef CH_USE_NESTED_LOCKS +#define CH_USE_NESTED_LOCKS FALSE +#endif + +/** + * If specified then the kernel performs the round robin scheduling algorithm + * on threads of equal priority. + * @note The default is @p TRUE. + */ +#ifndef CH_USE_ROUNDROBIN +#define CH_USE_ROUNDROBIN TRUE +#endif + +/** + * If specified then the @p chThdWait() function is included in the kernel. + * @note The default is @p TRUE. + */ +#ifndef CH_USE_WAITEXIT +#define CH_USE_WAITEXIT TRUE +#endif + +/** + * If specified then the Semaphores APIs are included in the kernel. + * @note The default is @p TRUE. + */ +#ifndef CH_USE_SEMAPHORES +#define CH_USE_SEMAPHORES TRUE +#endif + +/** + * If enabled then the threads are enqueued on semaphores by priority rather + * than FIFO order. + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#ifndef CH_USE_SEMAPHORES_PRIORITY +#define CH_USE_SEMAPHORES_PRIORITY FALSE +#endif + +/** + * If specified then the Semaphores the @p chSemWaitSignal() API is included + * in the kernel. + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#ifndef CH_USE_SEMSW +#define CH_USE_SEMSW TRUE +#endif + +/** + * If specified then the Semaphores with timeout APIs are included in the + * kernel. + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#ifndef CH_USE_SEMAPHORES_TIMEOUT +#define CH_USE_SEMAPHORES_TIMEOUT TRUE +#endif + +/** + * If specified then the Mutexes APIs are included in the kernel. + * @note The default is @p TRUE. + */ +#ifndef CH_USE_MUTEXES +#define CH_USE_MUTEXES TRUE +#endif + +/** + * If specified then the Conditional Variables APIs are included in the kernel. + * @note The default is @p TRUE. + * @note Requires @p CH_USE_MUTEXES. + */ +#ifndef CH_USE_CONDVARS +#define CH_USE_CONDVARS TRUE +#endif + +/** + * If specified then the Conditional Variables APIs are included in the kernel. + * @note The default is @p TRUE. + * @note Requires @p CH_USE_CONDVARS. + */ +#ifndef CH_USE_CONDVARS_TIMEOUT +#define CH_USE_CONDVARS_TIMEOUT TRUE +#endif + +/** + * If specified then the Event flags APIs are included in the kernel. + * @note The default is @p TRUE. + */ +#ifndef CH_USE_EVENTS +#define CH_USE_EVENTS TRUE +#endif + +/** + * If specified then the @p chEvtWaitXXXTimeout() functions are included in + * the kernel. + * @note The default is @p TRUE. + * @note Requires @p CH_USE_EVENTS. + */ +#ifndef CH_USE_EVENTS_TIMEOUT +#define CH_USE_EVENTS_TIMEOUT TRUE +#endif + +/** + * If specified then the Synchronous Messages APIs are included in the kernel. + * @note The default is @p TRUE. + */ +#ifndef CH_USE_MESSAGES +#define CH_USE_MESSAGES TRUE +#endif + +/** + * If specified then the @p chMsgSendWithEvent() function is included in the + * kernel. + * @note The default is @p TRUE. + * @note Requires @p CH_USE_MESSAGES and @p CH_USE_EVENTS. + */ +#ifndef CH_USE_MESSAGES_EVENT +#define CH_USE_MESSAGES_EVENT TRUE +#endif + +/** + * If enabled then messages are served by priority rather than in FIFO order. + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_MESSAGES. + */ +#ifndef CH_USE_MESSAGES_PRIORITY +#define CH_USE_MESSAGES_PRIORITY FALSE +#endif + +/** + * If specified then the I/O queues APIs are included in the kernel. + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#ifndef CH_USE_QUEUES +#define CH_USE_QUEUES TRUE +#endif + +/** + * If specified then the half duplex queues APIs are included in the kernel. + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. + */ +#ifndef CH_USE_QUEUES_HALFDUPLEX +#define CH_USE_QUEUES_HALFDUPLEX TRUE +#endif + +/** + * If specified then the I/O queues with timeout APIs are included in the + * kernel. + * @note The default is @p TRUE. + * @note Requires @p CH_USE_QUEUES and @p CH_USE_SEMAPHORES_TIMEOUT. + */ +#ifndef CH_USE_QUEUES_TIMEOUT +#define CH_USE_QUEUES_TIMEOUT TRUE +#endif + +/** + * If specified then the full duplex serial driver APIs are included in the + * kernel. + * @note The default is @p TRUE. + * @note Requires @p CH_USE_QUEUES. + */ +#ifndef CH_USE_SERIAL_FULLDUPLEX +#define CH_USE_SERIAL_FULLDUPLEX TRUE +#endif + +/** + * If specified then the half duplex serial driver APIs are included in the + * kernel. + * @note The default is @p TRUE. + * @note Requires @p CH_USE_QUEUES_HALFDUPLEX. + */ +#ifndef CH_USE_SERIAL_HALFDUPLEX +#define CH_USE_SERIAL_HALFDUPLEX TRUE +#endif + +/** + * If specified then the memory heap allocator APIs are included in the kernel. + * @note The default is @p TRUE. + * @note Requires @p CH_USE_MUTEXES or @p CH_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#ifndef CH_USE_HEAP +#define CH_USE_HEAP TRUE +#endif + +/** + * Number of RAM bytes to use as system heap. If set to zero then the whole + * available RAM is used as system heap. * @note In order to use the whole RAM as system heap the linker script must - * provide the \p __heap_base__ and \p __heap_end__ symbols. - * @note requires \p CH_USE_HEAP. + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_USE_HEAP. */ -#define CH_HEAP_SIZE 0 +#ifndef CH_HEAP_SIZE +#define CH_HEAP_SIZE 512 +#endif -/** Configuration option: enforces the use of the C-runtime \p malloc() and - * \p free() functions as backend for the system heap allocator.*/ -#define CH_USE_MALLOC_HEAP +/** + * If enabled enforces the use of the C-runtime @p malloc() and @p free() + * functions as backend for the system heap allocator. + * @note The default is @p FALSE. + * @note Requires @p CH_USE_HEAP. + */ +#ifndef CH_USE_MALLOC_HEAP +#define CH_USE_MALLOC_HEAP FALSE +#endif -/** Configuration option: if specified then the memory pools allocator APIs - * are included in the kernel.*/ -#define CH_USE_MEMPOOLS +/** + * If specified then the memory pools allocator APIs are included in the + * kernel. + * @note The default is @p TRUE. + */ +#ifndef CH_USE_MEMPOOLS +#define CH_USE_MEMPOOLS TRUE +#endif -/** Configuration option: if specified then the dynamic objects creation APIs - * are included in the kernel. - * @note requires \p CH_USE_WAITEXIT. +/** + * If specified then the dynamic threads creation APIs are included in the + * kernel. + * @note The default is @p TRUE. + * @note Requires @p CH_USE_WAITEXIT. */ -#define CH_USE_DYNAMIC +#ifndef CH_USE_DYNAMIC +#define CH_USE_DYNAMIC TRUE +#endif -/** Configuration option: Frequency of the system timer that drives the system - * ticks. This also defines the system time unit.*/ -#define CH_FREQUENCY 1000 +/** + * Frequency of the system timer that drives the system ticks. This also + * defines the system tick time unit. + */ +#ifndef CH_FREQUENCY +#define CH_FREQUENCY 1000 +#endif -/** Configuration option: This constant is the number of ticks allowed for the - * threads before preemption occurs. This option is only meaningful if the - * option \p CH_USE_ROUNDROBIN is also active.*/ -#define CH_TIME_QUANTUM 20 +/** + * This constant is the number of system ticks allowed for the threads before + * preemption occurs. This option is only meaningful if the option + * @p CH_USE_ROUNDROBIN is also active. + */ +#ifndef CH_TIME_QUANTUM +#define CH_TIME_QUANTUM 20 +#endif -/** Configuration option: Defines a CPU register to be used as storage for the - * global \p currp variable. Caching this variable in a register can greatly - * improve both space and time efficiency of the generated code. Another side - * effect is that one less register has to be saved during the context switch - * resulting in lower RAM usage and faster code. - * @note This option is only useable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option \p - * -ffixed-. +/** + * If enabled defines a CPU register to be used as storage for the global + * @p currp variable. Caching this variable in a register can greatly + * improve both space and time efficiency of the generated code. Another side + * effect is that one less register has to be saved during the context switch + * resulting in lower RAM usage and faster code. + * @note This option is only usable with the GCC compiler and is only useful + * on processors with many registers like ARM cores. + * @note If this option is enabled then ALL the libraries linked to the + * ChibiOS/RT code must be recompiled with the GCC option @p + * -ffixed-@. + * @note This option must be enabled in the Makefile, it is listed here for + * documentation. */ -//#define CH_CURRP_REGISTER_CACHE "r8" +#if defined(__DOXYGEN__) +#define CH_CURRP_REGISTER_CACHE "reg" +#endif -/** Configuration option: Includes basic debug support to the kernel. - * @note the debug support is port-dependent, it may be not present on some +/** + * Debug option, if enableed includes basic debug support to the kernel. + * @note The debug support is port-dependent, it may be not present on some * targets. In that case stub functions will be included. + * @note The default is @p FALSE. */ -//#define CH_USE_DEBUG +#ifndef CH_USE_DEBUG +#define CH_USE_DEBUG FALSE +#endif -/** Debug option: Includes the threads context switch tracing feature. +/** + * Debug option, includes the threads context switch tracing feature. + * @note The default is @p FALSE. */ -//#define CH_USE_TRACE +#ifndef CH_USE_TRACE +#define CH_USE_TRACE FALSE +#endif -/** User fields added to the end of the \p Thread structure. */ +/** + * User fields added to the end of the @p Thread structure. + */ +#ifndef THREAD_EXT_FIELDS #define THREAD_EXT_FIELDS \ struct { \ /* Add thread custom fields here.*/ \ }; +#endif -/** User initialization code added to the \p chThdCreate() API. - * @note It is invoked from within \p chThdInit(). */ +/** + * User initialization code added to the @p chThdInit() API. + * @note It is invoked from within @p chThdInit(). + */ +#ifndef THREAD_EXT_INIT #define THREAD_EXT_INIT(tp) { \ /* Add thread initialization code here.*/ \ } +#endif -/** User finalization code added to the \p chThdExit() API. - * @note It is inserted into lock zone. */ +/** + * User finalization code added to the @p chThdExit() API. + * @note It is inserted into lock zone. + */ +#ifndef THREAD_EXT_EXIT #define THREAD_EXT_EXIT(tp) { \ /* Add thread finalization code here.*/ \ } +#endif + +/** + * Code inserted inside the idle thread loop immediately after an interrupt + * resumed execution. + */ +#ifndef IDLE_LOOP_HOOK +#define IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} +#endif #endif /* _CHCONF_H_ */ -- cgit v1.2.3 From fa9b36aff3676a897503a359314d08db8fc5a09d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 14 Feb 2009 18:20:33 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@766 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 5e787d675..da4744a16 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -310,21 +310,30 @@ #endif /** - * Debug option, if enableed includes basic debug support to the kernel. - * @note The debug support is port-dependent, it may be not present on some - * targets. In that case stub functions will be included. + * Debug option, if enabled all the assertions in the kernel code are + * activated. This includes function parameters checks and consistency + * checks inside the kernel. * @note The default is @p FALSE. */ -#ifndef CH_USE_DEBUG -#define CH_USE_DEBUG FALSE +#ifndef CH_DBG_ENABLE_ASSERTS +#define CH_DBG_ENABLE_ASSERTS FALSE #endif /** - * Debug option, includes the threads context switch tracing feature. + * Debug option, if enabled the context switch circular trace buffer is + * activated. * @note The default is @p FALSE. */ -#ifndef CH_USE_TRACE -#define CH_USE_TRACE FALSE +#ifndef CH_DBG_ENABLE_TRACE +#define CH_DBG_ENABLE_TRACE FALSE +#endif + +/** + * Debug option, if enabled the threads working area is filled with a byte + * pattern when a thread is created. + */ +#ifndef CH_DBG_FILL_THREADS +#define CH_DBG_FILL_THREADS FALSE #endif /** -- cgit v1.2.3 From 3d2f2081cebee2936d8073ab6a55177b6549013e Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 17 Feb 2009 19:58:46 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@778 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 216 ++++++++++++++++++++++++---------------- 1 file changed, 131 insertions(+), 85 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index da4744a16..15ce1a80d 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -27,14 +27,25 @@ #ifndef _CHCONF_H_ #define _CHCONF_H_ +/*===========================================================================*/ +/* Kernel parameters. */ +/*===========================================================================*/ + /** - * If specified then time efficient rather than space efficient code is used - * when two possible implementations exist. - * @note This is not related to the compiler optimization options. - * @note The default is @p TRUE. + * Frequency of the system timer that drives the system ticks. This also + * defines the system tick time unit. */ -#ifndef CH_OPTIMIZE_SPEED -#define CH_OPTIMIZE_SPEED TRUE +#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__) +#define CH_FREQUENCY 1000 +#endif + +/** + * This constant is the number of system ticks allowed for the threads before + * preemption occurs. This option is only meaningful if the option + * @p CH_USE_ROUNDROBIN is also active. + */ +#if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__) +#define CH_TIME_QUANTUM 20 #endif /** @@ -43,10 +54,10 @@ * For performance and code size reasons the recommended setting is to leave * this option disabled.
* You can use this option if you need to merge ChibiOS/RT with external - * libraries that require nested lock/unlock operations. + * libraries that require nested lock/unlock operations. * @note The default is @p FALSE. */ -#ifndef CH_USE_NESTED_LOCKS +#if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) #define CH_USE_NESTED_LOCKS FALSE #endif @@ -55,15 +66,62 @@ * on threads of equal priority. * @note The default is @p TRUE. */ -#ifndef CH_USE_ROUNDROBIN +#if !defined(CH_USE_ROUNDROBIN) || defined(__DOXYGEN__) #define CH_USE_ROUNDROBIN TRUE #endif +/** + * Number of RAM bytes to use as system heap. If set to zero then the whole + * available RAM is used as system heap. + * @note In order to use the whole RAM as system heap the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_USE_HEAP. + */ +#if !defined(CH_HEAP_SIZE) || defined(__DOXYGEN__) +#define CH_HEAP_SIZE 512 +#endif + +/*===========================================================================*/ +/* Performance options. */ +/*===========================================================================*/ + +/** + * If specified then time efficient rather than space efficient code is used + * when two possible implementations exist. + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#if !defined(CH_OPTIMIZE_SPEED) || defined(__DOXYGEN__) +#define CH_OPTIMIZE_SPEED TRUE +#endif + +/** + * If enabled defines a CPU register to be used as storage for the global + * @p currp variable. Caching this variable in a register can greatly + * improve both space and time efficiency of the generated code. Another side + * effect is that one less register has to be saved during the context switch + * resulting in lower RAM usage and faster code. + * @note This option is only usable with the GCC compiler and is only useful + * on processors with many registers like ARM cores. + * @note If this option is enabled then ALL the libraries linked to the + * ChibiOS/RT code must be recompiled with the GCC option @p + * -ffixed-@. + * @note This option must be enabled in the Makefile, it is listed here for + * documentation. + */ +#if defined(__DOXYGEN__) +#define CH_CURRP_REGISTER_CACHE "reg" +#endif + +/*===========================================================================*/ +/* Subsystem options. */ +/*===========================================================================*/ + /** * If specified then the @p chThdWait() function is included in the kernel. * @note The default is @p TRUE. */ -#ifndef CH_USE_WAITEXIT +#if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__) #define CH_USE_WAITEXIT TRUE #endif @@ -71,7 +129,7 @@ * If specified then the Semaphores APIs are included in the kernel. * @note The default is @p TRUE. */ -#ifndef CH_USE_SEMAPHORES +#if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__) #define CH_USE_SEMAPHORES TRUE #endif @@ -81,7 +139,7 @@ * @note The default is @p FALSE. Enable this if you have special requirements. * @note Requires @p CH_USE_SEMAPHORES. */ -#ifndef CH_USE_SEMAPHORES_PRIORITY +#if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__) #define CH_USE_SEMAPHORES_PRIORITY FALSE #endif @@ -91,7 +149,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_SEMAPHORES. */ -#ifndef CH_USE_SEMSW +#if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__) #define CH_USE_SEMSW TRUE #endif @@ -101,7 +159,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_SEMAPHORES. */ -#ifndef CH_USE_SEMAPHORES_TIMEOUT +#if !defined(CH_USE_SEMAPHORES_TIMEOUT) || defined(__DOXYGEN__) #define CH_USE_SEMAPHORES_TIMEOUT TRUE #endif @@ -109,7 +167,7 @@ * If specified then the Mutexes APIs are included in the kernel. * @note The default is @p TRUE. */ -#ifndef CH_USE_MUTEXES +#if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__) #define CH_USE_MUTEXES TRUE #endif @@ -118,7 +176,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_MUTEXES. */ -#ifndef CH_USE_CONDVARS +#if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__) #define CH_USE_CONDVARS TRUE #endif @@ -127,7 +185,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_CONDVARS. */ -#ifndef CH_USE_CONDVARS_TIMEOUT +#if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__) #define CH_USE_CONDVARS_TIMEOUT TRUE #endif @@ -135,7 +193,7 @@ * If specified then the Event flags APIs are included in the kernel. * @note The default is @p TRUE. */ -#ifndef CH_USE_EVENTS +#if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__) #define CH_USE_EVENTS TRUE #endif @@ -145,7 +203,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_EVENTS. */ -#ifndef CH_USE_EVENTS_TIMEOUT +#if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__) #define CH_USE_EVENTS_TIMEOUT TRUE #endif @@ -153,7 +211,7 @@ * If specified then the Synchronous Messages APIs are included in the kernel. * @note The default is @p TRUE. */ -#ifndef CH_USE_MESSAGES +#if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__) #define CH_USE_MESSAGES TRUE #endif @@ -163,7 +221,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_MESSAGES and @p CH_USE_EVENTS. */ -#ifndef CH_USE_MESSAGES_EVENT +#if !defined(CH_USE_MESSAGES_EVENT) || defined(__DOXYGEN__) #define CH_USE_MESSAGES_EVENT TRUE #endif @@ -172,16 +230,25 @@ * @note The default is @p FALSE. Enable this if you have special requirements. * @note Requires @p CH_USE_MESSAGES. */ -#ifndef CH_USE_MESSAGES_PRIORITY +#if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__) #define CH_USE_MESSAGES_PRIORITY FALSE #endif +/** + * If specified then the Asynchronous Messages (Mailboxes) APIs are included + * in the kernel. + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__) +#define CH_USE_MAILBOXES TRUE +#endif + /** * If specified then the I/O queues APIs are included in the kernel. * @note The default is @p TRUE. * @note Requires @p CH_USE_SEMAPHORES. */ -#ifndef CH_USE_QUEUES +#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE #endif @@ -190,7 +257,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_SEMAPHORES. */ -#ifndef CH_USE_QUEUES_HALFDUPLEX +#if !defined(CH_USE_QUEUES_HALFDUPLEX) || defined(__DOXYGEN__) #define CH_USE_QUEUES_HALFDUPLEX TRUE #endif @@ -200,7 +267,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_QUEUES and @p CH_USE_SEMAPHORES_TIMEOUT. */ -#ifndef CH_USE_QUEUES_TIMEOUT +#if !defined(CH_USE_QUEUES_TIMEOUT) || defined(__DOXYGEN__) #define CH_USE_QUEUES_TIMEOUT TRUE #endif @@ -210,7 +277,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_QUEUES. */ -#ifndef CH_USE_SERIAL_FULLDUPLEX +#if !defined(CH_USE_SERIAL_FULLDUPLEX) || defined(__DOXYGEN__) #define CH_USE_SERIAL_FULLDUPLEX TRUE #endif @@ -220,7 +287,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_QUEUES_HALFDUPLEX. */ -#ifndef CH_USE_SERIAL_HALFDUPLEX +#if !defined(CH_USE_SERIAL_HALFDUPLEX) || defined(__DOXYGEN__) #define CH_USE_SERIAL_HALFDUPLEX TRUE #endif @@ -230,28 +297,17 @@ * @note Requires @p CH_USE_MUTEXES or @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ -#ifndef CH_USE_HEAP +#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) #define CH_USE_HEAP TRUE #endif -/** - * Number of RAM bytes to use as system heap. If set to zero then the whole - * available RAM is used as system heap. - * @note In order to use the whole RAM as system heap the linker script must - * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_HEAP. - */ -#ifndef CH_HEAP_SIZE -#define CH_HEAP_SIZE 512 -#endif - /** * If enabled enforces the use of the C-runtime @p malloc() and @p free() * functions as backend for the system heap allocator. * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. */ -#ifndef CH_USE_MALLOC_HEAP +#if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) #define CH_USE_MALLOC_HEAP FALSE #endif @@ -260,7 +316,7 @@ * kernel. * @note The default is @p TRUE. */ -#ifndef CH_USE_MEMPOOLS +#if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__) #define CH_USE_MEMPOOLS TRUE #endif @@ -270,52 +326,21 @@ * @note The default is @p TRUE. * @note Requires @p CH_USE_WAITEXIT. */ -#ifndef CH_USE_DYNAMIC +#if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__) #define CH_USE_DYNAMIC TRUE #endif -/** - * Frequency of the system timer that drives the system ticks. This also - * defines the system tick time unit. - */ -#ifndef CH_FREQUENCY -#define CH_FREQUENCY 1000 -#endif - -/** - * This constant is the number of system ticks allowed for the threads before - * preemption occurs. This option is only meaningful if the option - * @p CH_USE_ROUNDROBIN is also active. - */ -#ifndef CH_TIME_QUANTUM -#define CH_TIME_QUANTUM 20 -#endif - -/** - * If enabled defines a CPU register to be used as storage for the global - * @p currp variable. Caching this variable in a register can greatly - * improve both space and time efficiency of the generated code. Another side - * effect is that one less register has to be saved during the context switch - * resulting in lower RAM usage and faster code. - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif +/*===========================================================================*/ +/* Debug options. */ +/*===========================================================================*/ /** * Debug option, if enabled all the assertions in the kernel code are * activated. This includes function parameters checks and consistency - * checks inside the kernel. + * checks inside the kernel. * @note The default is @p FALSE. */ -#ifndef CH_DBG_ENABLE_ASSERTS +#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) #define CH_DBG_ENABLE_ASSERTS FALSE #endif @@ -324,22 +349,43 @@ * activated. * @note The default is @p FALSE. */ -#ifndef CH_DBG_ENABLE_TRACE +#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__) #define CH_DBG_ENABLE_TRACE FALSE #endif +/** + * Debug option, if enabled a runtime stack check is performed. + * @note The stack check is performed in a architecture/port dependent way. It + * may not be implemented at all. + */ +#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_STACK_CHECK FALSE +#endif + /** * Debug option, if enabled the threads working area is filled with a byte - * pattern when a thread is created. + * pattern when a thread is created. */ -#ifndef CH_DBG_FILL_THREADS +#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__) #define CH_DBG_FILL_THREADS FALSE #endif +/** + * Debug option, if enabled a field is added to the @p Thread structure that + * counts the system ticks occurred while executing the thread. + */ +#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) +#define CH_DBG_THREADS_PROFILING FALSE +#endif + +/*===========================================================================*/ +/* Kernel hooks. */ +/*===========================================================================*/ + /** * User fields added to the end of the @p Thread structure. */ -#ifndef THREAD_EXT_FIELDS +#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) #define THREAD_EXT_FIELDS \ struct { \ /* Add thread custom fields here.*/ \ @@ -350,7 +396,7 @@ struct { \ * User initialization code added to the @p chThdInit() API. * @note It is invoked from within @p chThdInit(). */ -#ifndef THREAD_EXT_INIT +#if !defined(THREAD_EXT_INIT) || defined(__DOXYGEN__) #define THREAD_EXT_INIT(tp) { \ /* Add thread initialization code here.*/ \ } @@ -360,7 +406,7 @@ struct { \ * User finalization code added to the @p chThdExit() API. * @note It is inserted into lock zone. */ -#ifndef THREAD_EXT_EXIT +#if !defined(THREAD_EXT_EXIT) || defined(__DOXYGEN__) #define THREAD_EXT_EXIT(tp) { \ /* Add thread finalization code here.*/ \ } @@ -370,7 +416,7 @@ struct { \ * Code inserted inside the idle thread loop immediately after an interrupt * resumed execution. */ -#ifndef IDLE_LOOP_HOOK +#if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__) #define IDLE_LOOP_HOOK() { \ /* Idle loop code here.*/ \ } -- cgit v1.2.3 From daabc2b079b17a41ca2f1a2a6423373f811402ba Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 20 Feb 2009 20:14:42 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@791 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 15ce1a80d..ff98f4164 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -335,9 +335,18 @@ /*===========================================================================*/ /** - * Debug option, if enabled all the assertions in the kernel code are - * activated. This includes function parameters checks and consistency - * checks inside the kernel. + * Debug option, if enabled then the checks on the API functions input + * parameters are activated. + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__) +#define CH_DBG_ENABLE_CHECKS FALSE +#endif + +/** + * Debug option, if enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, runtime + * anomalies and port-defined checks. * @note The default is @p FALSE. */ #if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) -- cgit v1.2.3 From d62a644b1e910c7fccd65d768a838fcc651e4e80 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 19 Apr 2009 07:15:05 +0000 Subject: Removed the chMsgSendWithEvent() function and the related configuration option. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@914 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index ff98f4164..2681f9563 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -215,16 +215,6 @@ #define CH_USE_MESSAGES TRUE #endif -/** - * If specified then the @p chMsgSendWithEvent() function is included in the - * kernel. - * @note The default is @p TRUE. - * @note Requires @p CH_USE_MESSAGES and @p CH_USE_EVENTS. - */ -#if !defined(CH_USE_MESSAGES_EVENT) || defined(__DOXYGEN__) -#define CH_USE_MESSAGES_EVENT TRUE -#endif - /** * If enabled then messages are served by priority rather than in FIFO order. * @note The default is @p FALSE. Enable this if you have special requirements. -- cgit v1.2.3 From c989a8967cdcbd54109d686678936a3581fd2c70 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 1 May 2009 13:11:26 +0000 Subject: Removed the CH_USE_SERIAL_HALFDUPLEX, CH_USE_QUEUES_TIMEOUT and CH_USE_QUEUES_HALFDUPLEX configuration options. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@927 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 2681f9563..9c00191cc 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -242,25 +242,6 @@ #define CH_USE_QUEUES TRUE #endif -/** - * If specified then the half duplex queues APIs are included in the kernel. - * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. - */ -#if !defined(CH_USE_QUEUES_HALFDUPLEX) || defined(__DOXYGEN__) -#define CH_USE_QUEUES_HALFDUPLEX TRUE -#endif - -/** - * If specified then the I/O queues with timeout APIs are included in the - * kernel. - * @note The default is @p TRUE. - * @note Requires @p CH_USE_QUEUES and @p CH_USE_SEMAPHORES_TIMEOUT. - */ -#if !defined(CH_USE_QUEUES_TIMEOUT) || defined(__DOXYGEN__) -#define CH_USE_QUEUES_TIMEOUT TRUE -#endif - /** * If specified then the full duplex serial driver APIs are included in the * kernel. @@ -271,16 +252,6 @@ #define CH_USE_SERIAL_FULLDUPLEX TRUE #endif -/** - * If specified then the half duplex serial driver APIs are included in the - * kernel. - * @note The default is @p TRUE. - * @note Requires @p CH_USE_QUEUES_HALFDUPLEX. - */ -#if !defined(CH_USE_SERIAL_HALFDUPLEX) || defined(__DOXYGEN__) -#define CH_USE_SERIAL_HALFDUPLEX TRUE -#endif - /** * If specified then the memory heap allocator APIs are included in the kernel. * @note The default is @p TRUE. -- cgit v1.2.3 From 7506cef74c79741c57cf9575ac8b3b400c50bf41 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 9 May 2009 15:44:17 +0000 Subject: Made CH_DBG_THREADS_PROFILING default to TRUE in all demos because the changes to the function test_cpu_pulse(). git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@961 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 9c00191cc..b4cccc474 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -345,7 +345,7 @@ * counts the system ticks occurred while executing the thread. */ #if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) -#define CH_DBG_THREADS_PROFILING FALSE +#define CH_DBG_THREADS_PROFILING TRUE #endif /*===========================================================================*/ -- cgit v1.2.3 From a6feec221cd3050e0f2d56950abd39677790d79f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 9 May 2009 16:05:41 +0000 Subject: Removed the CH_USE_SEMAPHORES_TIMEOUT configuration option. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@962 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index b4cccc474..717a0ce09 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -153,16 +153,6 @@ #define CH_USE_SEMSW TRUE #endif -/** - * If specified then the Semaphores with timeout APIs are included in the - * kernel. - * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. - */ -#if !defined(CH_USE_SEMAPHORES_TIMEOUT) || defined(__DOXYGEN__) -#define CH_USE_SEMAPHORES_TIMEOUT TRUE -#endif - /** * If specified then the Mutexes APIs are included in the kernel. * @note The default is @p TRUE. -- cgit v1.2.3 From 1ea7355d85e316aadfd90468b3e808bb3dc95ee9 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 16 Aug 2009 13:07:24 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1073 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/Makefile b/demos/AVR-AT90CANx-GCC/Makefile index a72f1f913..7b880f6d9 100644 --- a/demos/AVR-AT90CANx-GCC/Makefile +++ b/demos/AVR-AT90CANx-GCC/Makefile @@ -80,15 +80,17 @@ OBJDIR = . # Imported source files -include ../../src/kernel.mk +include ../../os/ports/GCC/AVR/port.mk +include ../../os/kernel/kernel.mk include ../../test/test.mk # List C source files here. (C dependencies are automatically generated.) -SRC = ../../ports/AVR/chcore.c ../../ports/AVR/avr_serial.c \ - ${KERNSRC} \ - ${TESTSRC} \ - ../../src/lib/evtimer.c \ +SRC = ${PORTSRC} \ + ${KERNSRC} \ + ${TESTSRC} \ + ../../os/ports/GCC/AVR/avr_serial.c \ + ../../os/various/evtimer.c \ board.c main.c @@ -123,7 +125,7 @@ DEBUG = dwarf-2 # Each directory must be seperated by a space. # Use forward slashes for directory separators. # For a directory that has spaces, enclose it in quotes. -EXTRAINCDIRS = ../../src/include ../../src/lib ../../ports/AVR +EXTRAINCDIRS = $(PORTINC) $(KERNINC) $(TESTINC)e ../../os/various # Compiler flag to set the C Standard level. -- cgit v1.2.3 From 46827225678cea64b9519813fb60d5a0d388676f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 26 Aug 2009 13:34:52 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1106 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/Makefile | 8 ++++++-- demos/AVR-AT90CANx-GCC/board.c | 8 ++++---- demos/AVR-AT90CANx-GCC/chconf.h | 10 ---------- demos/AVR-AT90CANx-GCC/main.c | 9 +++++++-- 4 files changed, 17 insertions(+), 18 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/Makefile b/demos/AVR-AT90CANx-GCC/Makefile index 7b880f6d9..30ae2aad0 100644 --- a/demos/AVR-AT90CANx-GCC/Makefile +++ b/demos/AVR-AT90CANx-GCC/Makefile @@ -89,7 +89,8 @@ include ../../test/test.mk SRC = ${PORTSRC} \ ${KERNSRC} \ ${TESTSRC} \ - ../../os/ports/GCC/AVR/avr_serial.c \ + ../../os/io/serial.c \ + ../../os/io/platforms/AVR/serial_lld.c \ ../../os/various/evtimer.c \ board.c main.c @@ -125,7 +126,10 @@ DEBUG = dwarf-2 # Each directory must be seperated by a space. # Use forward slashes for directory separators. # For a directory that has spaces, enclose it in quotes. -EXTRAINCDIRS = $(PORTINC) $(KERNINC) $(TESTINC)e ../../os/various +EXTRAINCDIRS = $(PORTINC) $(KERNINC) $(TESTINC) \ + ../../os/io \ + ../../os/io/platforms/AVR \ + ../../os/various # Compiler flag to set the C Standard level. diff --git a/demos/AVR-AT90CANx-GCC/board.c b/demos/AVR-AT90CANx-GCC/board.c index 3119b82be..2fdf128a1 100644 --- a/demos/AVR-AT90CANx-GCC/board.c +++ b/demos/AVR-AT90CANx-GCC/board.c @@ -18,9 +18,9 @@ */ #include +#include #include "board.h" -#include "avr_serial.h" CH_IRQ_HANDLER(TIMER0_COMP_vect) { @@ -71,9 +71,9 @@ void hwinit(void) { /* * Timer 0 setup. */ - TCCR0A = (1 << WGM01) | (0 << WGM00) | // CTC mode. + TCCR0A = (1 << WGM01) | (0 << WGM00) | // CTC mode. (0 << COM0A1) | (0 << COM0A0) | // OC0A disabled (normal I/O). - (0 << CS02) | (1 << CS01) | (1 << CS00); // CLK/64 clock source. + (0 << CS02) | (1 << CS01) | (1 << CS00); // CLK/64 clock source. OCR0A = F_CPU / 64 / CH_FREQUENCY - 1; TCNT0 = 0; // Reset counter. TIFR0 = (1 << OCF0A); // Reset pending (if any). @@ -82,5 +82,5 @@ void hwinit(void) { /* * Other initializations. */ - serial_init(); + sdInit(); } diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 717a0ce09..cb7da16d3 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -232,16 +232,6 @@ #define CH_USE_QUEUES TRUE #endif -/** - * If specified then the full duplex serial driver APIs are included in the - * kernel. - * @note The default is @p TRUE. - * @note Requires @p CH_USE_QUEUES. - */ -#if !defined(CH_USE_SERIAL_FULLDUPLEX) || defined(__DOXYGEN__) -#define CH_USE_SERIAL_FULLDUPLEX TRUE -#endif - /** * If specified then the memory heap allocator APIs are included in the kernel. * @note The default is @p TRUE. diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c index aa9b99dc0..a19b1e9c5 100644 --- a/demos/AVR-AT90CANx-GCC/main.c +++ b/demos/AVR-AT90CANx-GCC/main.c @@ -18,8 +18,8 @@ */ #include +#include #include -#include #include @@ -41,7 +41,7 @@ static void TimerHandler(eventid_t id) { msg_t TestThread(void *p); if (!(PORTE & PORTE_BUTTON)) - TestThread(&SER2); + TestThread(&SD2); } int main(int argc, char **argv) { @@ -59,6 +59,11 @@ int main(int argc, char **argv) { */ chSysInit(); + /* + * Activates the serial driver 2 using the driver default configuration. + */ + sdStart(&SD2, NULL); + /* * Event Timer initialization. */ -- cgit v1.2.3 From 9b59b00627e0e068d6e63da7f21ee54d709a46c2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 19 Sep 2009 08:00:34 +0000 Subject: Improved makefiles. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1166 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/Makefile | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/Makefile b/demos/AVR-AT90CANx-GCC/Makefile index 30ae2aad0..5754a6371 100644 --- a/demos/AVR-AT90CANx-GCC/Makefile +++ b/demos/AVR-AT90CANx-GCC/Makefile @@ -80,18 +80,19 @@ OBJDIR = . # Imported source files -include ../../os/ports/GCC/AVR/port.mk -include ../../os/kernel/kernel.mk -include ../../test/test.mk +CHIBIOS = ../.. +include ${CHIBIOS}/os/ports/GCC/AVR/port.mk +include ${CHIBIOS}/os/kernel/kernel.mk +include ${CHIBIOS}/test/test.mk # List C source files here. (C dependencies are automatically generated.) SRC = ${PORTSRC} \ ${KERNSRC} \ ${TESTSRC} \ - ../../os/io/serial.c \ - ../../os/io/platforms/AVR/serial_lld.c \ - ../../os/various/evtimer.c \ + ${CHIBIOS}/os/io/serial.c \ + ${CHIBIOS}/os/io/platforms/AVR/serial_lld.c \ + ${CHIBIOS}/os/various/evtimer.c \ board.c main.c @@ -127,9 +128,9 @@ DEBUG = dwarf-2 # Use forward slashes for directory separators. # For a directory that has spaces, enclose it in quotes. EXTRAINCDIRS = $(PORTINC) $(KERNINC) $(TESTINC) \ - ../../os/io \ - ../../os/io/platforms/AVR \ - ../../os/various + ${CHIBIOS}/os/io \ + ${CHIBIOS}/os/io/platforms/AVR \ + ${CHIBIOS}/os/various # Compiler flag to set the C Standard level. -- cgit v1.2.3 From 0c0d93a91e14e60c58148f65bde4d7f45a26c67c Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 16 Oct 2009 18:24:32 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1223 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 253 +++++++++++++++++++++++++++------------- 1 file changed, 170 insertions(+), 83 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index cb7da16d3..c4ebe589f 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -18,9 +18,9 @@ */ /** - * @file src/templates/chconf.h + * @file templates/chconf.h * @brief Configuration file template. - * @addtogroup Config + * @addtogroup config * @{ */ @@ -32,29 +32,36 @@ /*===========================================================================*/ /** - * Frequency of the system timer that drives the system ticks. This also - * defines the system tick time unit. + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. */ #if !defined(CH_FREQUENCY) || defined(__DOXYGEN__) #define CH_FREQUENCY 1000 #endif /** - * This constant is the number of system ticks allowed for the threads before - * preemption occurs. This option is only meaningful if the option - * @p CH_USE_ROUNDROBIN is also active. + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the round robin mechanism. + * + * @note Disabling round robin makes the kernel more compact and generally + * faster but forbids multiple threads at the same priority level. */ #if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__) #define CH_TIME_QUANTUM 20 #endif /** - * If enabled then the use of nested @p chSysLock() / @p chSysUnlock() - * operations is allowed.
- * For performance and code size reasons the recommended setting is to leave - * this option disabled.
- * You can use this option if you need to merge ChibiOS/RT with external - * libraries that require nested lock/unlock operations. + * @brief Nested locks. + * @details If enabled then the use of nested @p chSysLock() / @p chSysUnlock() + * operations is allowed.
+ * For performance and code size reasons the recommended setting + * is to leave this option disabled.
+ * You may use this option if you need to merge ChibiOS/RT with + * external libraries that require nested lock/unlock operations. + * * @note The default is @p FALSE. */ #if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) @@ -62,23 +69,18 @@ #endif /** - * If specified then the kernel performs the round robin scheduling algorithm - * on threads of equal priority. - * @note The default is @p TRUE. - */ -#if !defined(CH_USE_ROUNDROBIN) || defined(__DOXYGEN__) -#define CH_USE_ROUNDROBIN TRUE -#endif - -/** - * Number of RAM bytes to use as system heap. If set to zero then the whole - * available RAM is used as system heap. - * @note In order to use the whole RAM as system heap the linker script must + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_HEAP. + * @note Requires @p CH_USE_COREMEM. */ -#if !defined(CH_HEAP_SIZE) || defined(__DOXYGEN__) -#define CH_HEAP_SIZE 512 +#if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) +#define CH_MEMCORE_SIZE 512 #endif /*===========================================================================*/ @@ -86,8 +88,10 @@ /*===========================================================================*/ /** - * If specified then time efficient rather than space efficient code is used - * when two possible implementations exist. + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * * @note This is not related to the compiler optimization options. * @note The default is @p TRUE. */ @@ -96,18 +100,20 @@ #endif /** - * If enabled defines a CPU register to be used as storage for the global - * @p currp variable. Caching this variable in a register can greatly - * improve both space and time efficiency of the generated code. Another side - * effect is that one less register has to be saved during the context switch - * resulting in lower RAM usage and faster code. + * @brief Exotic optimization. + * @details If defined then a CPU register is used as storage for the global + * @p currp variable. Caching this variable in a register greatly + * improves both space and time OS efficiency. A side effect is that + * one less register has to be saved during the context switch + * resulting in lower RAM usage and faster context switch. + * * @note This option is only usable with the GCC compiler and is only useful * on processors with many registers like ARM cores. * @note If this option is enabled then ALL the libraries linked to the * ChibiOS/RT code must be recompiled with the GCC option @p * -ffixed-@. * @note This option must be enabled in the Makefile, it is listed here for - * documentation. + * documentation only. */ #if defined(__DOXYGEN__) #define CH_CURRP_REGISTER_CACHE "reg" @@ -118,7 +124,10 @@ /*===========================================================================*/ /** - * If specified then the @p chThdWait() function is included in the kernel. + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * * @note The default is @p TRUE. */ #if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__) @@ -126,7 +135,9 @@ #endif /** - * If specified then the Semaphores APIs are included in the kernel. + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * * @note The default is @p TRUE. */ #if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__) @@ -134,8 +145,10 @@ #endif /** - * If enabled then the threads are enqueued on semaphores by priority rather - * than FIFO order. + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * * @note The default is @p FALSE. Enable this if you have special requirements. * @note Requires @p CH_USE_SEMAPHORES. */ @@ -144,8 +157,10 @@ #endif /** - * If specified then the Semaphores the @p chSemWaitSignal() API is included - * in the kernel. + * @brief Atomic semaphore API. + * @details If enabled then the semaphores the @p chSemWaitSignal() API + * is included in the kernel. + * * @note The default is @p TRUE. * @note Requires @p CH_USE_SEMAPHORES. */ @@ -154,7 +169,9 @@ #endif /** - * If specified then the Mutexes APIs are included in the kernel. + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * * @note The default is @p TRUE. */ #if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__) @@ -162,7 +179,10 @@ #endif /** - * If specified then the Conditional Variables APIs are included in the kernel. + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * * @note The default is @p TRUE. * @note Requires @p CH_USE_MUTEXES. */ @@ -171,7 +191,10 @@ #endif /** - * If specified then the Conditional Variables APIs are included in the kernel. + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * * @note The default is @p TRUE. * @note Requires @p CH_USE_CONDVARS. */ @@ -180,7 +203,9 @@ #endif /** - * If specified then the Event flags APIs are included in the kernel. + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * * @note The default is @p TRUE. */ #if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__) @@ -188,8 +213,10 @@ #endif /** - * If specified then the @p chEvtWaitXXXTimeout() functions are included in - * the kernel. + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * * @note The default is @p TRUE. * @note Requires @p CH_USE_EVENTS. */ @@ -198,7 +225,10 @@ #endif /** - * If specified then the Synchronous Messages APIs are included in the kernel. + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * * @note The default is @p TRUE. */ #if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__) @@ -206,7 +236,10 @@ #endif /** - * If enabled then messages are served by priority rather than in FIFO order. + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * * @note The default is @p FALSE. Enable this if you have special requirements. * @note Requires @p CH_USE_MESSAGES. */ @@ -215,16 +248,21 @@ #endif /** - * If specified then the Asynchronous Messages (Mailboxes) APIs are included - * in the kernel. + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__) #define CH_USE_MAILBOXES TRUE #endif /** - * If specified then the I/O queues APIs are included in the kernel. + * @brief I/O Queues APIs. + * @details If enabled then the I/O queues APIs are included in the kernel. + * * @note The default is @p TRUE. * @note Requires @p CH_USE_SEMAPHORES. */ @@ -233,9 +271,24 @@ #endif /** - * If specified then the memory heap allocator APIs are included in the kernel. + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) +#define CH_USE_MEMCORE TRUE +#endif + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * * @note The default is @p TRUE. - * @note Requires @p CH_USE_MUTEXES or @p CH_USE_SEMAPHORES. + * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ #if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) @@ -243,18 +296,24 @@ #endif /** - * If enabled enforces the use of the C-runtime @p malloc() and @p free() - * functions as backend for the system heap allocator. + * @brief C-runtime allocator. + * @details If enabled the the heap allocator APIs just wrap the C-runtime + * @p malloc() and @p free() functions. + * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. + * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) #define CH_USE_MALLOC_HEAP FALSE #endif /** - * If specified then the memory pools allocator APIs are included in the - * kernel. + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * * @note The default is @p TRUE. */ #if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__) @@ -262,8 +321,10 @@ #endif /** - * If specified then the dynamic threads creation APIs are included in the - * kernel. + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * * @note The default is @p TRUE. * @note Requires @p CH_USE_WAITEXIT. */ @@ -276,8 +337,10 @@ /*===========================================================================*/ /** - * Debug option, if enabled then the checks on the API functions input - * parameters are activated. + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * * @note The default is @p FALSE. */ #if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__) @@ -285,9 +348,11 @@ #endif /** - * Debug option, if enabled then all the assertions in the kernel code are - * activated. This includes consistency checks inside the kernel, runtime - * anomalies and port-defined checks. + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * * @note The default is @p FALSE. */ #if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) @@ -295,8 +360,10 @@ #endif /** - * Debug option, if enabled the context switch circular trace buffer is - * activated. + * @brief Debug option, trace buffer. + * @details If enabled then the context switch circular trace buffer is + * activated. + * * @note The default is @p FALSE. */ #if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__) @@ -304,25 +371,37 @@ #endif /** - * Debug option, if enabled a runtime stack check is performed. + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. * @note The stack check is performed in a architecture/port dependent way. It - * may not be implemented at all. + * may not be implemented or some ports. */ #if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) #define CH_DBG_ENABLE_STACK_CHECK FALSE #endif /** - * Debug option, if enabled the threads working area is filled with a byte - * pattern when a thread is created. + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. */ #if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__) #define CH_DBG_FILL_THREADS FALSE #endif /** - * Debug option, if enabled a field is added to the @p Thread structure that - * counts the system ticks occurred while executing the thread. + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p Thread structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p TRUE. + * @note This debug option is defaulted to TRUE because it is required by + * some test cases into the test suite. */ #if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) #define CH_DBG_THREADS_PROFILING TRUE @@ -333,38 +412,46 @@ /*===========================================================================*/ /** - * User fields added to the end of the @p Thread structure. + * @brief Threads descriptor structure hook. + * @details User fields added to the end of the @p Thread structure. */ #if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) #define THREAD_EXT_FIELDS \ struct { \ - /* Add thread custom fields here.*/ \ + /* Add threads custom fields here.*/ \ }; #endif /** - * User initialization code added to the @p chThdInit() API. - * @note It is invoked from within @p chThdInit(). + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitily from all + * the threads creation APIs. */ #if !defined(THREAD_EXT_INIT) || defined(__DOXYGEN__) #define THREAD_EXT_INIT(tp) { \ - /* Add thread initialization code here.*/ \ + /* Add threads initialization code here.*/ \ } #endif /** - * User finalization code added to the @p chThdExit() API. + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + * * @note It is inserted into lock zone. + * @note It is also invoked when the threads simply return in order to + * terminate. */ #if !defined(THREAD_EXT_EXIT) || defined(__DOXYGEN__) #define THREAD_EXT_EXIT(tp) { \ - /* Add thread finalization code here.*/ \ + /* Add threads finalization code here.*/ \ } #endif /** - * Code inserted inside the idle thread loop immediately after an interrupt - * resumed execution. + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. */ #if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__) #define IDLE_LOOP_HOOK() { \ -- cgit v1.2.3 From 6dfbaa34d96d3571fc28aba6179268c1df595b2f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 18 Oct 2009 07:43:46 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1238 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index c4ebe589f..f962e4c16 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -80,7 +80,7 @@ * @note Requires @p CH_USE_COREMEM. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) -#define CH_MEMCORE_SIZE 512 +#define CH_MEMCORE_SIZE 128 #endif /*===========================================================================*/ -- cgit v1.2.3 From cbbacdb239211fc33b0423b1213d2e58ac1692da Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 8 Dec 2009 14:42:32 +0000 Subject: HAL support for AVR. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1394 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/Makefile | 10 ++--- demos/AVR-AT90CANx-GCC/board.c | 22 +++++---- demos/AVR-AT90CANx-GCC/board.h | 8 +++- demos/AVR-AT90CANx-GCC/halconf.h | 96 ++++++++++++++++++++++++++++++++++++++++ demos/AVR-AT90CANx-GCC/main.c | 12 ++--- 5 files changed, 121 insertions(+), 27 deletions(-) create mode 100644 demos/AVR-AT90CANx-GCC/halconf.h (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/Makefile b/demos/AVR-AT90CANx-GCC/Makefile index 5754a6371..0b6943cab 100644 --- a/demos/AVR-AT90CANx-GCC/Makefile +++ b/demos/AVR-AT90CANx-GCC/Makefile @@ -81,6 +81,8 @@ OBJDIR = . # Imported source files CHIBIOS = ../.. +include ${CHIBIOS}/os/hal/hal.mk +include ${CHIBIOS}/os/hal/platforms/AVR/platform.mk include ${CHIBIOS}/os/ports/GCC/AVR/port.mk include ${CHIBIOS}/os/kernel/kernel.mk include ${CHIBIOS}/test/test.mk @@ -90,8 +92,8 @@ include ${CHIBIOS}/test/test.mk SRC = ${PORTSRC} \ ${KERNSRC} \ ${TESTSRC} \ - ${CHIBIOS}/os/io/serial.c \ - ${CHIBIOS}/os/io/platforms/AVR/serial_lld.c \ + ${HALSRC} \ + ${PLATFORMSRC} \ ${CHIBIOS}/os/various/evtimer.c \ board.c main.c @@ -127,9 +129,7 @@ DEBUG = dwarf-2 # Each directory must be seperated by a space. # Use forward slashes for directory separators. # For a directory that has spaces, enclose it in quotes. -EXTRAINCDIRS = $(PORTINC) $(KERNINC) $(TESTINC) \ - ${CHIBIOS}/os/io \ - ${CHIBIOS}/os/io/platforms/AVR \ +EXTRAINCDIRS = $(PORTINC) $(KERNINC) $(TESTINC) $(HALINC) $(PLATFORMINC) \ ${CHIBIOS}/os/various diff --git a/demos/AVR-AT90CANx-GCC/board.c b/demos/AVR-AT90CANx-GCC/board.c index 2fdf128a1..b97bd94b5 100644 --- a/demos/AVR-AT90CANx-GCC/board.c +++ b/demos/AVR-AT90CANx-GCC/board.c @@ -17,10 +17,8 @@ along with this program. If not, see . */ -#include -#include - -#include "board.h" +#include "ch.h" +#include "hal.h" CH_IRQ_HANDLER(TIMER0_COMP_vect) { @@ -71,16 +69,16 @@ void hwinit(void) { /* * Timer 0 setup. */ - TCCR0A = (1 << WGM01) | (0 << WGM00) | // CTC mode. - (0 << COM0A1) | (0 << COM0A0) | // OC0A disabled (normal I/O). - (0 << CS02) | (1 << CS01) | (1 << CS00); // CLK/64 clock source. + TCCR0A = (1 << WGM01) | (0 << WGM00) | /* CTC mode. */ + (0 << COM0A1) | (0 << COM0A0) | /* OC0A disabled. */ + (0 << CS02) | (1 << CS01) | (1 << CS00); /* CLK/64 clock. */ OCR0A = F_CPU / 64 / CH_FREQUENCY - 1; - TCNT0 = 0; // Reset counter. - TIFR0 = (1 << OCF0A); // Reset pending (if any). - TIMSK0 = (1 << OCIE0A); // Interrupt on compare. + TCNT0 = 0; /* Reset counter. */ + TIFR0 = (1 << OCF0A); /* Reset pending. */ + TIMSK0 = (1 << OCIE0A); /* IRQ on compare. */ /* - * Other initializations. + * HAL initialization. */ - sdInit(); + halInit(); } diff --git a/demos/AVR-AT90CANx-GCC/board.h b/demos/AVR-AT90CANx-GCC/board.h index fefd6a39c..0abe920eb 100644 --- a/demos/AVR-AT90CANx-GCC/board.h +++ b/demos/AVR-AT90CANx-GCC/board.h @@ -81,6 +81,12 @@ #define PORTE_LED (1 << 4) #define PORTE_BUTTON (1 << 5) -void hwinit(void); +#ifdef __cplusplus +extern "C" { +#endif + void hwinit(void); +#ifdef __cplusplus +} +#endif #endif /* _BOARD_H_ */ diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h new file mode 100644 index 000000000..a3d17a3c9 --- /dev/null +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -0,0 +1,96 @@ +/* + ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @addtogroup HAL_CONF + * @{ + */ + +/* + * HAL configuration file, this file allows to enable or disable the various + * device drivers from your application. You may also use this file in order + * to change the device drivers settings found in the low level drivers + * headers, just define here the new settings and those will override the + * defaults defined in the LLD headers. + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) +#define CH_HAL_USE_PAL FALSE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) +#define CH_HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) +#define CH_HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) +#define CH_HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) +#define CH_HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define CH_HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) +#define CH_HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define CH_HAL_USE_MMC_SPI FALSE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c index a19b1e9c5..61df6a3ed 100644 --- a/demos/AVR-AT90CANx-GCC/main.c +++ b/demos/AVR-AT90CANx-GCC/main.c @@ -17,15 +17,9 @@ along with this program. If not, see . */ -#include -#include -#include - -#include - -#include "board.h" - -void hwinit(void); +#include "ch.h" +#include "hal.h" +#include "evtimer.h" static WORKING_AREA(waThread1, 32); static msg_t Thread1(void *arg) { -- cgit v1.2.3 From 2441aa72104fb7c01505947d8b774a182e84e83d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 9 Dec 2009 21:29:34 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1409 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index f962e4c16..2a4916827 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -277,7 +277,7 @@ * * @note The default is @p TRUE. */ -#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) +#if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__) #define CH_USE_MEMCORE TRUE #endif -- cgit v1.2.3 From ce5974e5de90403c272854a2be4e47d924575186 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 18 Dec 2009 21:00:27 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1439 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/Makefile | 31 +++++++------- demos/AVR-AT90CANx-GCC/board.c | 84 ------------------------------------- demos/AVR-AT90CANx-GCC/board.h | 92 ----------------------------------------- 3 files changed, 17 insertions(+), 190 deletions(-) delete mode 100644 demos/AVR-AT90CANx-GCC/board.c delete mode 100644 demos/AVR-AT90CANx-GCC/board.h (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/Makefile b/demos/AVR-AT90CANx-GCC/Makefile index 0b6943cab..11e902b59 100644 --- a/demos/AVR-AT90CANx-GCC/Makefile +++ b/demos/AVR-AT90CANx-GCC/Makefile @@ -81,21 +81,23 @@ OBJDIR = . # Imported source files CHIBIOS = ../.. -include ${CHIBIOS}/os/hal/hal.mk -include ${CHIBIOS}/os/hal/platforms/AVR/platform.mk -include ${CHIBIOS}/os/ports/GCC/AVR/port.mk -include ${CHIBIOS}/os/kernel/kernel.mk -include ${CHIBIOS}/test/test.mk +include $(CHIBIOS)/boards/OLIMEX_AVR_CAN/board.mk +include $(CHIBIOS)/os/hal/platforms/AVR/platform.mk +include $(CHIBIOS)/os/hal/hal.mk +include $(CHIBIOS)/os/ports/GCC/AVR/port.mk +include $(CHIBIOS)/os/kernel/kernel.mk +include $(CHIBIOS)/test/test.mk # List C source files here. (C dependencies are automatically generated.) -SRC = ${PORTSRC} \ - ${KERNSRC} \ - ${TESTSRC} \ - ${HALSRC} \ - ${PLATFORMSRC} \ - ${CHIBIOS}/os/various/evtimer.c \ - board.c main.c +SRC = $(PORTSRC) \ + $(KERNSRC) \ + $(TESTSRC) \ + $(HALSRC) \ + $(PLATFORMSRC) \ + $(BOARDSRC) \ + $(CHIBIOS)/os/various/evtimer.c \ + main.c # List C++ source files here. (C dependencies are automatically generated.) @@ -129,8 +131,9 @@ DEBUG = dwarf-2 # Each directory must be seperated by a space. # Use forward slashes for directory separators. # For a directory that has spaces, enclose it in quotes. -EXTRAINCDIRS = $(PORTINC) $(KERNINC) $(TESTINC) $(HALINC) $(PLATFORMINC) \ - ${CHIBIOS}/os/various +EXTRAINCDIRS = $(PORTINC) $(KERNINC) $(TESTINC) \ + $(HALINC) $(PLATFORMINC) $(BOARDINC) \ + $(CHIBIOS)/os/various # Compiler flag to set the C Standard level. diff --git a/demos/AVR-AT90CANx-GCC/board.c b/demos/AVR-AT90CANx-GCC/board.c deleted file mode 100644 index b97bd94b5..000000000 --- a/demos/AVR-AT90CANx-GCC/board.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "ch.h" -#include "hal.h" - -CH_IRQ_HANDLER(TIMER0_COMP_vect) { - - CH_IRQ_PROLOGUE(); - - chSysLockFromIsr(); - chSysTimerHandlerI(); - chSysUnlockFromIsr(); - - CH_IRQ_EPILOGUE(); -} - -/* - * Board initialization code. - */ -void hwinit(void) { - - /* - * I/O ports setup. - */ - DDRA = VAL_DDRA; - PORTA = VAL_PORTA; - DDRB = VAL_DDRB; - PORTB = VAL_PORTB; - DDRC = VAL_DDRC; - PORTC = VAL_PORTC; - DDRD = VAL_DDRD; - PORTD = VAL_PORTD; - DDRE = VAL_DDRE; - PORTE = VAL_PORTE; - DDRF = VAL_DDRF; - PORTF = VAL_PORTF; - DDRG = VAL_DDRG; - PORTG = VAL_PORTG; - - /* - * External interrupts setup, all disabled initially. - */ - EICRA = 0x00; - EICRB = 0x00; - EIMSK = 0x00; - - /* - * Enables Idle mode for SLEEP instruction. - */ - SMCR = (1 << SE); - - /* - * Timer 0 setup. - */ - TCCR0A = (1 << WGM01) | (0 << WGM00) | /* CTC mode. */ - (0 << COM0A1) | (0 << COM0A0) | /* OC0A disabled. */ - (0 << CS02) | (1 << CS01) | (1 << CS00); /* CLK/64 clock. */ - OCR0A = F_CPU / 64 / CH_FREQUENCY - 1; - TCNT0 = 0; /* Reset counter. */ - TIFR0 = (1 << OCF0A); /* Reset pending. */ - TIMSK0 = (1 << OCIE0A); /* IRQ on compare. */ - - /* - * HAL initialization. - */ - halInit(); -} diff --git a/demos/AVR-AT90CANx-GCC/board.h b/demos/AVR-AT90CANx-GCC/board.h deleted file mode 100644 index 0abe920eb..000000000 --- a/demos/AVR-AT90CANx-GCC/board.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -#define BOARD_OLIMEX_AVR_CAN - -/* - * All inputs with pullups. - */ -#define VAL_DDRA 0x00 -#define VAL_PORTA 0xFF - -/* - * All inputs with pullups. - */ -#define VAL_DDRB 0x00 -#define VAL_PORTB 0xFF - -/* - * All inputs with pullups. - */ -#define VAL_DDRC 0x00 -#define VAL_PORTC 0xFF - -/* PD7 PD6 PD5 PD4 PD3 PD2 PD1 PD0 - * IN IN OUT IN OUT IN IN IN - * DDRD 0 0 1 0 1 0 0 0 - * PU HiZ VAL PU VAL HiZ HiZ HiZ - * PORTD 1 0 ?1 1 1 0 0 0 - */ -#define VAL_DDRD 0x28 -#define VAL_PORTD 0xB8 - -/* PE7 PE6 BUT LED PE3 PE2 PE1 PE0 - * IN IN IN OUT IN IN OUT IN - * DDRE 0 0 0 1 0 0 1 0 - * PU PU HiZ VAL PU PU VAL HiZ - * PORTE 1 1 0 1 1 1 1 0 - */ -#define VAL_DDRE 0x12 -#define VAL_PORTE 0xDE - -/* TDI TDO TMS TCK PF3 PF2 PF1 PF0 - * x x x x IN IN IN IN - * DDRF 0 0 0 0 0 0 0 0 - * x x x x PU PU PU PU - * PORTF 0 0 0 0 1 1 1 1 - * - */ -#define VAL_DDRF 0x00 -#define VAL_PORTF 0x0F - -/* x x x x x PG2 PG1 PG0 - * x x x x x IN IN IN - * DDRG 0 0 0 0 0 0 0 0 - * x x x x x PU PU PU - * PORTG 0 0 0 0 0 1 1 1 - * - */ -#define VAL_DDRG 0x00 -#define VAL_PORTG 0x07 - -#define PORTE_LED (1 << 4) -#define PORTE_BUTTON (1 << 5) - -#ifdef __cplusplus -extern "C" { -#endif - void hwinit(void); -#ifdef __cplusplus -} -#endif - -#endif /* _BOARD_H_ */ -- cgit v1.2.3 From da565f622c53f2fb23c1d66332ee764e44361ea3 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 29 Dec 2009 16:22:45 +0000 Subject: New HAL configuration file ported to all demos. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1482 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 56 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 3 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index a3d17a3c9..376dfe816 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -27,14 +27,23 @@ /* * HAL configuration file, this file allows to enable or disable the various * device drivers from your application. You may also use this file in order - * to change the device drivers settings found in the low level drivers - * headers, just define here the new settings and those will override the - * defaults defined in the LLD headers. + * to override the device drivers default settings. */ #ifndef _HALCONF_H_ #define _HALCONF_H_ +/* + * Uncomment the following line in order to include a mcu-related + * settings file. This file can be used to include platform specific + * header files or to override the low level drivers settings. + */ +/*#include "mcuconf.h"*/ + +/*===========================================================================*/ +/* PAL driver related settings. */ +/*===========================================================================*/ + /** * @brief Enables the PAL subsystem. */ @@ -42,6 +51,10 @@ #define CH_HAL_USE_PAL FALSE #endif +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + /** * @brief Enables the ADC subsystem. */ @@ -49,6 +62,10 @@ #define CH_HAL_USE_ADC FALSE #endif +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + /** * @brief Enables the CAN subsystem. */ @@ -56,6 +73,10 @@ #define CH_HAL_USE_CAN FALSE #endif +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + /** * @brief Enables the MAC subsystem. */ @@ -63,6 +84,10 @@ #define CH_HAL_USE_MAC FALSE #endif +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + /** * @brief Enables the PWM subsystem. */ @@ -70,6 +95,10 @@ #define CH_HAL_USE_PWM FALSE #endif +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + /** * @brief Enables the SERIAL subsystem. */ @@ -77,6 +106,10 @@ #define CH_HAL_USE_SERIAL TRUE #endif +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + /** * @brief Enables the SPI subsystem. */ @@ -84,6 +117,15 @@ #define CH_HAL_USE_SPI FALSE #endif +/* + * Default SPI settings overrides (uncomment to override). + */ +/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + /** * @brief Enables the MMC_SPI subsystem. */ @@ -91,6 +133,14 @@ #define CH_HAL_USE_MMC_SPI FALSE #endif +/* + * Default MMC_SPI settings overrides (uncomment to override). + */ +/*#define MMC_SECTOR_SIZE 512*/ +/*#define MMC_NICE_WAITING TRUE*/ +/*#define MMC_POLLING_INTERVAL 10*/ +/*#define MMC_POLLING_DELAY 10*/ + #endif /* _HALCONF_H_ */ /** @} */ -- cgit v1.2.3 From 61038954f731debcf474b097a1f7283e4cf198fc Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 2 Jan 2010 12:41:56 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1493 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index 376dfe816..c0f12c57d 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -38,7 +38,7 @@ * settings file. This file can be used to include platform specific * header files or to override the low level drivers settings. */ -/*#include "mcuconf.h"*/ +#include "mcuconf.h" /*===========================================================================*/ /* PAL driver related settings. */ @@ -48,7 +48,7 @@ * @brief Enables the PAL subsystem. */ #if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL FALSE +#define CH_HAL_USE_PAL TRUE #endif /*===========================================================================*/ @@ -59,7 +59,7 @@ * @brief Enables the ADC subsystem. */ #if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#define CH_HAL_USE_ADC FALSE #endif /*===========================================================================*/ @@ -70,7 +70,7 @@ * @brief Enables the CAN subsystem. */ #if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#define CH_HAL_USE_CAN FALSE #endif /*===========================================================================*/ @@ -81,7 +81,7 @@ * @brief Enables the MAC subsystem. */ #if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE +#define CH_HAL_USE_MAC FALSE #endif /*===========================================================================*/ @@ -92,7 +92,7 @@ * @brief Enables the PWM subsystem. */ #if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE +#define CH_HAL_USE_PWM FALSE #endif /*===========================================================================*/ @@ -103,9 +103,15 @@ * @brief Enables the SERIAL subsystem. */ #if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE +#define CH_HAL_USE_SERIAL TRUE #endif +/* + * Default SERIAL settings overrides (uncomment to override). + */ +/*#define SERIAL_DEFAULT_BITRATE 38400*/ +/*#define SERIAL_BUFFERS_SIZE 64*/ + /*===========================================================================*/ /* SPI driver related settings. */ /*===========================================================================*/ @@ -114,13 +120,13 @@ * @brief Enables the SPI subsystem. */ #if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE +#define CH_HAL_USE_SPI FALSE #endif /* * Default SPI settings overrides (uncomment to override). */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ +/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ /*===========================================================================*/ /* MMC_SPI driver related settings. */ @@ -130,16 +136,16 @@ * @brief Enables the MMC_SPI subsystem. */ #if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#define CH_HAL_USE_MMC_SPI FALSE #endif /* * Default MMC_SPI settings overrides (uncomment to override). */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +/*#define MMC_SECTOR_SIZE 512*/ +/*#define MMC_NICE_WAITING TRUE*/ +/*#define MMC_POLLING_INTERVAL 10*/ +/*#define MMC_POLLING_DELAY 10*/ #endif /* _HALCONF_H_ */ -- cgit v1.2.3 From 15e6fecf11e470abebe963177434f83883e63acf Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 2 Jan 2010 13:02:43 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1494 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 2 +- demos/AVR-AT90CANx-GCC/mcuconf.h | 53 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 demos/AVR-AT90CANx-GCC/mcuconf.h (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index c0f12c57d..58d49966f 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -48,7 +48,7 @@ * @brief Enables the PAL subsystem. */ #if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL TRUE +#define CH_HAL_USE_PAL FALSE #endif /*===========================================================================*/ diff --git a/demos/AVR-AT90CANx-GCC/mcuconf.h b/demos/AVR-AT90CANx-GCC/mcuconf.h new file mode 100644 index 000000000..017289582 --- /dev/null +++ b/demos/AVR-AT90CANx-GCC/mcuconf.h @@ -0,0 +1,53 @@ +/* + ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * AVR drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the driver + * is enabled in halconf.h. + */ + +/* + * ADC driver system settings. + */ + +/* + * CAN driver system settings. + */ + +/* + * MAC driver system settings. + */ + +/* + * PWM driver system settings. + */ + +/* + * SERIAL driver system settings. + */ +#define USE_AVR_USART0 FALSE +#define USE_AVR_USART1 TRUE + +/* + * SPI driver system settings. + */ +#define USE_LPC214x_SPI1 TRUE -- cgit v1.2.3 From e32275f84af6e07cbe737262ce90c75f69b9a1c1 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 3 Feb 2010 09:37:33 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1563 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 2a4916827..99548894e 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -123,6 +123,16 @@ /* Subsystem options. */ /*===========================================================================*/ +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__) +#define CH_USE_REGISTRY TRUE +#endif + /** * @brief Threads synchronization APIs. * @details If enabled then the @p chThdWait() function is included in -- cgit v1.2.3 From 157b6f9695e7f72f2d54b231c19cb4045710ed01 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 21 Feb 2010 07:24:53 +0000 Subject: Updated license dates. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1646 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 4 ++-- demos/AVR-AT90CANx-GCC/halconf.h | 10 +++++----- demos/AVR-AT90CANx-GCC/main.c | 2 +- demos/AVR-AT90CANx-GCC/mcuconf.h | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 99548894e..c32d36bdc 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -396,7 +396,7 @@ * @brief Debug option, stacks initialization. * @details If enabled then the threads working area is filled with a byte * value when a thread is created. This can be useful for the - * runtime measurement of the used stack. + * runtime measurement of the used stack. * * @note The default is @p FALSE. */ diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index 58d49966f..bd2f3e4fd 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -27,7 +27,7 @@ /* * HAL configuration file, this file allows to enable or disable the various * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * to override the device drivers default settings. */ #ifndef _HALCONF_H_ @@ -36,7 +36,7 @@ /* * Uncomment the following line in order to include a mcu-related * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. + * header files or to override the low level drivers settings. */ #include "mcuconf.h" @@ -45,7 +45,7 @@ /*===========================================================================*/ /** - * @brief Enables the PAL subsystem. + * @brief Enables the PAL subsystem. */ #if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) #define CH_HAL_USE_PAL FALSE @@ -124,7 +124,7 @@ #endif /* - * Default SPI settings overrides (uncomment to override). + * Default SPI settings overrides (uncomment to override). */ /*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c index 61df6a3ed..f922efed0 100644 --- a/demos/AVR-AT90CANx-GCC/main.c +++ b/demos/AVR-AT90CANx-GCC/main.c @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/AVR-AT90CANx-GCC/mcuconf.h b/demos/AVR-AT90CANx-GCC/mcuconf.h index 017289582..bd31976f2 100644 --- a/demos/AVR-AT90CANx-GCC/mcuconf.h +++ b/demos/AVR-AT90CANx-GCC/mcuconf.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. This file is part of ChibiOS/RT. @@ -26,7 +26,7 @@ */ /* - * ADC driver system settings. + * ADC driver system settings. */ /* -- cgit v1.2.3 From 79075f9e81d9d56be5da3bf6cdae56f4ace950de Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 19 Mar 2010 12:48:54 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1755 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 215 +++++++++++++++++++++------------------- 1 file changed, 112 insertions(+), 103 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index c32d36bdc..2cda27e83 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -18,9 +18,13 @@ */ /** - * @file templates/chconf.h - * @brief Configuration file template. + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * * @addtogroup config + * @details Kernel related settings and hooks. * @{ */ @@ -32,7 +36,7 @@ /*===========================================================================*/ /** - * @brief System tick frequency. + * @brief System tick frequency. * @details Frequency of the system timer that drives the system ticks. This * setting also defines the system tick time unit. */ @@ -41,20 +45,22 @@ #endif /** - * @brief Round robin interval. + * @brief Round robin interval. * @details This constant is the number of system ticks allowed for the * threads before preemption occurs. Setting this value to zero - * disables the round robin mechanism. + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. * - * @note Disabling round robin makes the kernel more compact and generally - * faster but forbids multiple threads at the same priority level. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. */ #if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__) #define CH_TIME_QUANTUM 20 #endif /** - * @brief Nested locks. + * @brief Nested locks. * @details If enabled then the use of nested @p chSysLock() / @p chSysUnlock() * operations is allowed.
* For performance and code size reasons the recommended setting @@ -62,22 +68,22 @@ * You may use this option if you need to merge ChibiOS/RT with * external libraries that require nested lock/unlock operations. * - * @note The default is @p FALSE. + * @note T he default is @p FALSE. */ #if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) #define CH_USE_NESTED_LOCKS FALSE #endif /** - * @brief Managed RAM size. + * @brief Managed RAM size. * @details Size of the RAM area to be managed by the OS. If set to zero * then the whole available RAM is used. The core memory is made * available to the heap allocator and/or can be used directly through * the simplified core memory allocator. * - * @note In order to let the OS manage the whole RAM the linker script must - * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_USE_COREMEM. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 128 @@ -88,32 +94,32 @@ /*===========================================================================*/ /** - * @brief OS optimization. + * @brief OS optimization. * @details If enabled then time efficient rather than space efficient code * is used when two possible implementations exist. * - * @note This is not related to the compiler optimization options. - * @note The default is @p TRUE. + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. */ #if !defined(CH_OPTIMIZE_SPEED) || defined(__DOXYGEN__) #define CH_OPTIMIZE_SPEED TRUE #endif /** - * @brief Exotic optimization. + * @brief Exotic optimization. * @details If defined then a CPU register is used as storage for the global * @p currp variable. Caching this variable in a register greatly * improves both space and time OS efficiency. A side effect is that * one less register has to be saved during the context switch * resulting in lower RAM usage and faster context switch. * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. + * @note This option is only usable with the GCC compiler and is only useful + * on processors with many registers like ARM cores. + * @note If this option is enabled then ALL the libraries linked to the + * ChibiOS/RT code must be recompiled with the GCC option @p + * -ffixed-@. + * @note This option must be enabled in the Makefile, it is listed here for + * documentation only. */ #if defined(__DOXYGEN__) #define CH_CURRP_REGISTER_CACHE "reg" @@ -124,219 +130,220 @@ /*===========================================================================*/ /** - * @brief Threads registry APIs. + * @brief Threads registry APIs. * @details If enabled then the registry APIs are included in the kernel. * - * @note The default is @p TRUE. + * @note The default is @p TRUE. */ #if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__) #define CH_USE_REGISTRY TRUE #endif /** - * @brief Threads synchronization APIs. + * @brief Threads synchronization APIs. * @details If enabled then the @p chThdWait() function is included in * the kernel. * - * @note The default is @p TRUE. + * @note The default is @p TRUE. */ #if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__) #define CH_USE_WAITEXIT TRUE #endif /** - * @brief Semaphores APIs. + * @brief Semaphores APIs. * @details If enabled then the Semaphores APIs are included in the kernel. * - * @note The default is @p TRUE. + * @note The default is @p TRUE. */ #if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__) #define CH_USE_SEMAPHORES TRUE #endif /** - * @brief Semaphores queuing mode. + * @brief Semaphores queuing mode. * @details If enabled then the threads are enqueued on semaphores by * priority rather than in FIFO order. * - * @note The default is @p FALSE. Enable this if you have special requirements. - * @note Requires @p CH_USE_SEMAPHORES. + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__) #define CH_USE_SEMAPHORES_PRIORITY FALSE #endif /** - * @brief Atomic semaphore API. - * @details If enabled then the semaphores the @p chSemWaitSignal() API + * @brief Atomic semaphore API. + * @details If enabled then the semaphores the @p chSemSignalWait() API * is included in the kernel. * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__) #define CH_USE_SEMSW TRUE #endif /** - * @brief Mutexes APIs. + * @brief Mutexes APIs. * @details If enabled then the mutexes APIs are included in the kernel. * - * @note The default is @p TRUE. + * @note The default is @p TRUE. */ #if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__) #define CH_USE_MUTEXES TRUE #endif /** - * @brief Conditional Variables APIs. + * @brief Conditional Variables APIs. * @details If enabled then the conditional variables APIs are included * in the kernel. * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_MUTEXES. + * @note The default is @p TRUE. + * @note Requires @p CH_USE_MUTEXES. */ #if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__) #define CH_USE_CONDVARS TRUE #endif /** - * @brief Conditional Variables APIs with timeout. + * @brief Conditional Variables APIs with timeout. * @details If enabled then the conditional variables APIs with timeout * specification are included in the kernel. * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_CONDVARS. + * @note The default is @p TRUE. + * @note Requires @p CH_USE_CONDVARS. */ #if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__) #define CH_USE_CONDVARS_TIMEOUT TRUE #endif /** - * @brief Events Flags APIs. + * @brief Events Flags APIs. * @details If enabled then the event flags APIs are included in the kernel. * - * @note The default is @p TRUE. + * @note The default is @p TRUE. */ #if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__) #define CH_USE_EVENTS TRUE #endif /** - * @brief Events Flags APIs with timeout. + * @brief Events Flags APIs with timeout. * @details If enabled then the events APIs with timeout specification * are included in the kernel. * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_EVENTS. + * @note The default is @p TRUE. + * @note Requires @p CH_USE_EVENTS. */ #if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__) #define CH_USE_EVENTS_TIMEOUT TRUE #endif /** - * @brief Synchronous Messages APIs. + * @brief Synchronous Messages APIs. * @details If enabled then the synchronous messages APIs are included * in the kernel. * - * @note The default is @p TRUE. + * @note The default is @p TRUE. */ #if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__) #define CH_USE_MESSAGES TRUE #endif /** - * @brief Synchronous Messages queuing mode. + * @brief Synchronous Messages queuing mode. * @details If enabled then messages are served by priority rather than in * FIFO order. * - * @note The default is @p FALSE. Enable this if you have special requirements. - * @note Requires @p CH_USE_MESSAGES. + * @note The default is @p FALSE. Enable this if you have special requirements. + * @note Requires @p CH_USE_MESSAGES. */ #if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__) #define CH_USE_MESSAGES_PRIORITY FALSE #endif /** - * @brief Mailboxes APIs. + * @brief Mailboxes APIs. * @details If enabled then the asynchronous messages (mailboxes) APIs are * included in the kernel. * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__) #define CH_USE_MAILBOXES TRUE #endif /** - * @brief I/O Queues APIs. + * @brief I/O Queues APIs. * @details If enabled then the I/O queues APIs are included in the kernel. * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. + * @note The default is @p TRUE. + * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE #endif /** - * @brief Core Memory Manager APIs. + * @brief Core Memory Manager APIs. * @details If enabled then the core memory manager APIs are included * in the kernel. * - * @note The default is @p TRUE. + * @note The default is @p TRUE. */ #if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__) #define CH_USE_MEMCORE TRUE #endif /** - * @brief Heap Allocator APIs. + * @brief Heap Allocator APIs. * @details If enabled then the memory heap allocator APIs are included * in the kernel. * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or - * @p CH_USE_SEMAPHORES. - * @note Mutexes are recommended. + * @note The default is @p TRUE. + * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @p CH_USE_SEMAPHORES. + * @note Mutexes are recommended. */ #if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) #define CH_USE_HEAP TRUE #endif /** - * @brief C-runtime allocator. + * @brief C-runtime allocator. * @details If enabled the the heap allocator APIs just wrap the C-runtime * @p malloc() and @p free() functions. * - * @note The default is @p FALSE. - * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the - * appropriate documentation. + * @note The default is @p FALSE. + * @note Requires @p CH_USE_HEAP. + * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) #define CH_USE_MALLOC_HEAP FALSE #endif /** - * @brief Memory Pools Allocator APIs. + * @brief Memory Pools Allocator APIs. * @details If enabled then the memory pools allocator APIs are included * in the kernel. * - * @note The default is @p TRUE. + * @note The default is @p TRUE. */ #if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__) #define CH_USE_MEMPOOLS TRUE #endif /** - * @brief Dynamic Threads APIs. + * @brief Dynamic Threads APIs. * @details If enabled then the dynamic threads creation APIs are included * in the kernel. * - * @note The default is @p TRUE. - * @note Requires @p CH_USE_WAITEXIT. + * @note The default is @p TRUE. + * @note Requires @p CH_USE_WAITEXIT. + * @note Requires @p CH_USE_HEAP and/or @p CH_USE_MEMPOOLS. */ #if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__) #define CH_USE_DYNAMIC TRUE @@ -347,71 +354,73 @@ /*===========================================================================*/ /** - * @brief Debug option, parameters checks. + * @brief Debug option, parameters checks. * @details If enabled then the checks on the API functions input * parameters are activated. * - * @note The default is @p FALSE. + * @note The default is @p FALSE. */ #if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__) #define CH_DBG_ENABLE_CHECKS FALSE #endif /** - * @brief Debug option, consistency checks. + * @brief Debug option, consistency checks. * @details If enabled then all the assertions in the kernel code are * activated. This includes consistency checks inside the kernel, * runtime anomalies and port-defined checks. * - * @note The default is @p FALSE. + * @note The default is @p FALSE. */ #if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) #define CH_DBG_ENABLE_ASSERTS FALSE #endif /** - * @brief Debug option, trace buffer. + * @brief Debug option, trace buffer. * @details If enabled then the context switch circular trace buffer is * activated. * - * @note The default is @p FALSE. + * @note The default is @p FALSE. */ #if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__) #define CH_DBG_ENABLE_TRACE FALSE #endif /** - * @brief Debug option, stack checks. + * @brief Debug option, stack checks. * @details If enabled then a runtime stack check is performed. * - * @note The default is @p FALSE. - * @note The stack check is performed in a architecture/port dependent way. It - * may not be implemented or some ports. + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. */ #if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__) #define CH_DBG_ENABLE_STACK_CHECK FALSE #endif /** - * @brief Debug option, stacks initialization. + * @brief Debug option, stacks initialization. * @details If enabled then the threads working area is filled with a byte * value when a thread is created. This can be useful for the * runtime measurement of the used stack. * - * @note The default is @p FALSE. + * @note The default is @p FALSE. */ #if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__) #define CH_DBG_FILL_THREADS FALSE #endif /** - * @brief Debug option, threads profiling. + * @brief Debug option, threads profiling. * @details If enabled then a field is added to the @p Thread structure that * counts the system ticks occurred while executing the thread. * - * @note The default is @p TRUE. - * @note This debug option is defaulted to TRUE because it is required by - * some test cases into the test suite. + * @note The default is @p TRUE. + * @note This debug option is defaulted to TRUE because it is required by + * some test cases into the test suite. */ #if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__) #define CH_DBG_THREADS_PROFILING TRUE @@ -422,7 +431,7 @@ /*===========================================================================*/ /** - * @brief Threads descriptor structure hook. + * @brief Threads descriptor structure hook. * @details User fields added to the end of the @p Thread structure. */ #if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) @@ -433,11 +442,11 @@ struct { \ #endif /** - * @brief Threads initialization hook. + * @brief Threads initialization hook. * @details User initialization code added to the @p chThdInit() API. * - * @note It is invoked from within @p chThdInit() and implicitily from all - * the threads creation APIs. + * @note It is invoked from within @p chThdInit() and implicitily from all + * the threads creation APIs. */ #if !defined(THREAD_EXT_INIT) || defined(__DOXYGEN__) #define THREAD_EXT_INIT(tp) { \ @@ -446,12 +455,12 @@ struct { \ #endif /** - * @brief Threads finalization hook. + * @brief Threads finalization hook. * @details User finalization code added to the @p chThdExit() API. * - * @note It is inserted into lock zone. - * @note It is also invoked when the threads simply return in order to - * terminate. + * @note It is inserted into lock zone. + * @note It is also invoked when the threads simply return in order to + * terminate. */ #if !defined(THREAD_EXT_EXIT) || defined(__DOXYGEN__) #define THREAD_EXT_EXIT(tp) { \ @@ -460,7 +469,7 @@ struct { \ #endif /** - * @brief Idle Loop hook. + * @brief Idle Loop hook. * @details This hook is continuously invoked by the idle thread loop. */ #if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__) -- cgit v1.2.3 From ae6fcc0782505d0afa0c48b30c84a3ab0d66373b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 19 May 2010 17:19:44 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1938 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/mcuconf.h | 1 - 1 file changed, 1 deletion(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/mcuconf.h b/demos/AVR-AT90CANx-GCC/mcuconf.h index bd31976f2..85a8cc2a6 100644 --- a/demos/AVR-AT90CANx-GCC/mcuconf.h +++ b/demos/AVR-AT90CANx-GCC/mcuconf.h @@ -50,4 +50,3 @@ /* * SPI driver system settings. */ -#define USE_LPC214x_SPI1 TRUE -- cgit v1.2.3 From fd41cf487a4e4e6d949efecdedc16b3e67d5d0b4 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 4 Jun 2010 12:33:23 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1997 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 2cda27e83..33dcfdfca 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -478,6 +478,10 @@ struct { \ } #endif +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + #endif /* _CHCONF_H_ */ /** @} */ -- cgit v1.2.3 From 0970c44b086287eac3c6c147a390fddb0f9de552 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 15 Jun 2010 17:19:01 +0000 Subject: Fixed bug 3016619. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2021 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 6 +++--- demos/AVR-AT90CANx-GCC/halconf.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 33dcfdfca..ccab98d65 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -308,7 +308,7 @@ * @note Mutexes are recommended. */ #if !defined(CH_USE_HEAP) || defined(__DOXYGEN__) -#define CH_USE_HEAP TRUE +#define CH_USE_HEAP FALSE #endif /** @@ -333,7 +333,7 @@ * @note The default is @p TRUE. */ #if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__) -#define CH_USE_MEMPOOLS TRUE +#define CH_USE_MEMPOOLS FALSE #endif /** @@ -346,7 +346,7 @@ * @note Requires @p CH_USE_HEAP and/or @p CH_USE_MEMPOOLS. */ #if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__) -#define CH_USE_DYNAMIC TRUE +#define CH_USE_DYNAMIC FALSE #endif /*===========================================================================*/ diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index bd2f3e4fd..7859d0f0e 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -110,7 +110,7 @@ * Default SERIAL settings overrides (uncomment to override). */ /*#define SERIAL_DEFAULT_BITRATE 38400*/ -/*#define SERIAL_BUFFERS_SIZE 64*/ +#define SERIAL_BUFFERS_SIZE 16 /*===========================================================================*/ /* SPI driver related settings. */ -- cgit v1.2.3 From 131b177925913634bd96e02e7a9f7d529a122df0 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 24 Jul 2010 09:10:47 +0000 Subject: Updated all the halconf.h files in the tree. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2088 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index 7859d0f0e..de9c05fdf 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -147,6 +147,17 @@ /*#define MMC_POLLING_INTERVAL 10*/ /*#define MMC_POLLING_DELAY 10*/ +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) +#define CH_HAL_USE_UART FALSE +#endif + #endif /* _HALCONF_H_ */ /** @} */ -- cgit v1.2.3 From 138c0f900d823b2c953038048bc40b14610f958a Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 21 Aug 2010 08:38:14 +0000 Subject: Added new kernel hooks (on halt and on systick). git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2136 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 46 +++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 13 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index ccab98d65..2c3129708 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -434,11 +434,9 @@ * @brief Threads descriptor structure hook. * @details User fields added to the end of the @p Thread structure. */ -#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) -#define THREAD_EXT_FIELDS \ -struct { \ - /* Add threads custom fields here.*/ \ -}; +#if !defined(THREAD_EXT_FIELDS_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_FIELDS_HOOK \ + /* Add threads custom fields here.*/ #endif /** @@ -448,9 +446,9 @@ struct { \ * @note It is invoked from within @p chThdInit() and implicitily from all * the threads creation APIs. */ -#if !defined(THREAD_EXT_INIT) || defined(__DOXYGEN__) -#define THREAD_EXT_INIT(tp) { \ - /* Add threads initialization code here.*/ \ +#if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ } #endif @@ -462,9 +460,9 @@ struct { \ * @note It is also invoked when the threads simply return in order to * terminate. */ -#if !defined(THREAD_EXT_EXIT) || defined(__DOXYGEN__) -#define THREAD_EXT_EXIT(tp) { \ - /* Add threads finalization code here.*/ \ +#if !defined(THREAD_EXT_EXIT_HOOK) || defined(__DOXYGEN__) +#define THREAD_EXT_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ } #endif @@ -473,8 +471,30 @@ struct { \ * @details This hook is continuously invoked by the idle thread loop. */ #if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__) -#define IDLE_LOOP_HOOK() { \ - /* Idle loop code here.*/ \ +#define IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} +#endif + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#if !defined(SYSTEM_TICK_EVENT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_TICK_EVENT_HOOK() { \ + /* System tick event code here.*/ \ +} +#endif + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__) +#define SYSTEM_HALT_HOOK() { \ + /* System halt code here.*/ \ } #endif -- cgit v1.2.3 From 781b0b129cccbecba160effce8c4ddd68295b8b9 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 11 Sep 2010 10:57:11 +0000 Subject: Fixed bug 3064204. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2175 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index de9c05fdf..f81870b13 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -62,6 +62,11 @@ #define CH_HAL_USE_ADC FALSE #endif +/* + * Default ADC settings overrides (uncomment to override). + */ +/*#define ADC_USE_WAIT TRUE*/ + /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ @@ -73,6 +78,11 @@ #define CH_HAL_USE_CAN FALSE #endif +/* + * Default CAN settings overrides (uncomment to override). + */ +/*#define CAN_USE_SLEEP_MODE TRUE*/ + /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -- cgit v1.2.3 From efdf9a658b9bffb0a42dc792f2852f88873f4240 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 27 Sep 2010 18:43:55 +0000 Subject: Reverted name change for macro THREAD_EXT_FIELDS. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2210 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 2c3129708..8c10de14c 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -431,11 +431,11 @@ /*===========================================================================*/ /** - * @brief Threads descriptor structure hook. + * @brief Threads descriptor structure extension. * @details User fields added to the end of the @p Thread structure. */ -#if !defined(THREAD_EXT_FIELDS_HOOK) || defined(__DOXYGEN__) -#define THREAD_EXT_FIELDS_HOOK \ +#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__) +#define THREAD_EXT_FIELDS \ /* Add threads custom fields here.*/ #endif -- cgit v1.2.3 From 35d05f85d17de7ebd5cad4638ecd92d91e5be9aa Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 31 Oct 2010 07:36:07 +0000 Subject: Updated reports. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2309 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index f81870b13..de9c05fdf 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -62,11 +62,6 @@ #define CH_HAL_USE_ADC FALSE #endif -/* - * Default ADC settings overrides (uncomment to override). - */ -/*#define ADC_USE_WAIT TRUE*/ - /*===========================================================================*/ /* CAN driver related settings. */ /*===========================================================================*/ @@ -78,11 +73,6 @@ #define CH_HAL_USE_CAN FALSE #endif -/* - * Default CAN settings overrides (uncomment to override). - */ -/*#define CAN_USE_SLEEP_MODE TRUE*/ - /*===========================================================================*/ /* MAC driver related settings. */ /*===========================================================================*/ -- cgit v1.2.3 From d8be44136c1e6d02ee105ac0791f9e6732551fec Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 1 Nov 2010 17:29:56 +0000 Subject: Fixed bug 3100946, renamed HAL switches removing the CH_ part. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2326 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 228 ++++++++++++++++++++++++++++----------- 1 file changed, 164 insertions(+), 64 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index de9c05fdf..2eea483f4 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -18,37 +18,93 @@ */ /** - * @file templates/halconf.h - * @brief HAL configuration header. + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * * @addtogroup HAL_CONF * @{ */ /* - * HAL configuration file, this file allows to enable or disable the various - * device drivers from your application. You may also use this file in order - * to override the device drivers default settings. + * */ #ifndef _HALCONF_H_ #define _HALCONF_H_ -/* - * Uncomment the following line in order to include a mcu-related - * settings file. This file can be used to include platform specific - * header files or to override the low level drivers settings. - */ #include "mcuconf.h" -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL FALSE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif /** - * @brief Enables the PAL subsystem. + * @brief Enables the CAN subsystem. */ -#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_PAL FALSE +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE #endif /*===========================================================================*/ @@ -56,10 +112,19 @@ /*===========================================================================*/ /** - * @brief Enables the ADC subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) -#define CH_HAL_USE_ADC FALSE +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE #endif /*===========================================================================*/ @@ -67,97 +132,132 @@ /*===========================================================================*/ /** - * @brief Enables the CAN subsystem. + * @brief Sleep mode related APIs inclusion switch. */ -#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) -#define CH_HAL_USE_CAN FALSE +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE #endif /*===========================================================================*/ -/* MAC driver related settings. */ +/* I2C driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MAC subsystem. + * @brief Enables the mutual exclusion APIs on the I2C bus. */ -#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) -#define CH_HAL_USE_MAC FALSE +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE #endif /*===========================================================================*/ -/* PWM driver related settings. */ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the PWM subsystem. + * @brief Block size for MMC transfers. */ -#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) -#define CH_HAL_USE_PWM FALSE +#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) +#define MMC_SECTOR_SIZE 512 #endif -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif /** - * @brief Enables the SERIAL subsystem. + * @brief Number of positive insertion queries before generating the + * insertion event. */ -#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define CH_HAL_USE_SERIAL TRUE +#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) +#define MMC_POLLING_INTERVAL 10 #endif -/* - * Default SERIAL settings overrides (uncomment to override). +/** + * @brief Interval, in milliseconds, between insertion queries. */ -/*#define SERIAL_DEFAULT_BITRATE 38400*/ -#define SERIAL_BUFFERS_SIZE 16 +#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) +#define MMC_POLLING_DELAY 10 +#endif + +/** + * @brief Uses the SPI polled API for small data transfers. + * @details Polled transfers usually improve performance because it + * saves two context switches and interrupt servicing. Note + * that this option has no effect on large transfers which + * are always performed using DMAs/IRQs. + */ +#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) +#define MMC_USE_SPI_POLLING TRUE +#endif /*===========================================================================*/ -/* SPI driver related settings. */ +/* PAL driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* PWM driver related settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* SERIAL driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the SPI subsystem. + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. */ -#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_SPI FALSE +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 #endif -/* - * Default SPI settings overrides (uncomment to override). +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. */ -/*#define SPI_USE_MUTUAL_EXCLUSION TRUE*/ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif /*===========================================================================*/ -/* MMC_SPI driver related settings. */ +/* SPI driver related settings. */ /*===========================================================================*/ /** - * @brief Enables the MMC_SPI subsystem. + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. */ -#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define CH_HAL_USE_MMC_SPI FALSE +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE #endif -/* - * Default MMC_SPI settings overrides (uncomment to override). +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. */ -/*#define MMC_SECTOR_SIZE 512*/ -/*#define MMC_NICE_WAITING TRUE*/ -/*#define MMC_POLLING_INTERVAL 10*/ -/*#define MMC_POLLING_DELAY 10*/ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ -/** - * @brief Enables the UART subsystem. - */ -#if !defined(CH_HAL_USE_UART) || defined(__DOXYGEN__) -#define CH_HAL_USE_UART FALSE -#endif - #endif /* _HALCONF_H_ */ /** @} */ -- cgit v1.2.3 From ef765be75f392d516bf77b307df5e2192458b3cc Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 20 Nov 2010 11:13:15 +0000 Subject: Fixed a misplaced comment in all the halconf.h files. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2394 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index 2eea483f4..e355d7bbc 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -28,10 +28,6 @@ * @{ */ -/* - * - */ - #ifndef _HALCONF_H_ #define _HALCONF_H_ -- cgit v1.2.3 From 68b05c757a60ba3bddbfb76d02b992f96d1e63f9 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 2 Dec 2010 17:40:37 +0000 Subject: Fixed typo in configuration files. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2453 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 8c10de14c..c982a771d 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -68,7 +68,7 @@ * You may use this option if you need to merge ChibiOS/RT with * external libraries that require nested lock/unlock operations. * - * @note T he default is @p FALSE. + * @note The default is @p FALSE. */ #if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) #define CH_USE_NESTED_LOCKS FALSE -- cgit v1.2.3 From ace3f844709b1bfdd4c88acbc943bdecf29f9f21 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 19 Dec 2010 10:39:21 +0000 Subject: AVR board files and demos updated. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2501 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c index f922efed0..79888a55a 100644 --- a/demos/AVR-AT90CANx-GCC/main.c +++ b/demos/AVR-AT90CANx-GCC/main.c @@ -38,6 +38,9 @@ static void TimerHandler(eventid_t id) { TestThread(&SD2); } +/* + * Application entry point. + */ int main(int argc, char **argv) { static EvTimer evt; static evhandler_t handlers[1] = { @@ -45,12 +48,14 @@ int main(int argc, char **argv) { }; static EventListener el0; - hwinit(); - /* - * The main() function becomes a thread here then the interrupts are - * enabled and ChibiOS/RT goes live. + * System initializations. + * - HAL initialization, this also initializes the configured device drivers + * and performs the board-specific initializations. + * - Kernel initialization, the main() function becomes a thread and the + * RTOS is active. */ + halInit(); chSysInit(); /* -- cgit v1.2.3 From f2386f6a22c55842203278c5b1f9691c5ac5f8fd Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 21 Dec 2010 10:30:39 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2515 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c index 79888a55a..f170a4c27 100644 --- a/demos/AVR-AT90CANx-GCC/main.c +++ b/demos/AVR-AT90CANx-GCC/main.c @@ -41,7 +41,7 @@ static void TimerHandler(eventid_t id) { /* * Application entry point. */ -int main(int argc, char **argv) { +int main(void) { static EvTimer evt; static evhandler_t handlers[1] = { TimerHandler -- cgit v1.2.3 From db7b60f402fda8ffb708e73feea7ed566eea0386 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 20 Feb 2011 15:26:43 +0000 Subject: Modified all the halconf.h files to include the USB and Serial over USB drivers. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2753 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index e355d7bbc..999773a20 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -89,6 +89,13 @@ #define HAL_USE_SERIAL TRUE #endif +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + /** * @brief Enables the SPI subsystem. */ @@ -103,6 +110,13 @@ #define HAL_USE_UART FALSE #endif +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB FALSE +#endif + /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ -- cgit v1.2.3 From 761f9f7287db259fe4a280d9ad13e2ed6eaf95a3 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 28 Feb 2011 19:28:47 +0000 Subject: Updated the various halconf.h and mcuconf.h with the GPT settings. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2782 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index 999773a20..54ecc3c50 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -54,6 +54,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + /** * @brief Enables the I2C subsystem. */ -- cgit v1.2.3 From e7e79a6ccb4f3e320b2b8b7bad1b14d65218641d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 18 Mar 2011 18:38:08 +0000 Subject: License updated. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2827 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 3 ++- demos/AVR-AT90CANx-GCC/halconf.h | 3 ++- demos/AVR-AT90CANx-GCC/main.c | 3 ++- demos/AVR-AT90CANx-GCC/mcuconf.h | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index c982a771d..644d792db 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index 54ecc3c50..3bfbca462 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c index f170a4c27..d039c6cf6 100644 --- a/demos/AVR-AT90CANx-GCC/main.c +++ b/demos/AVR-AT90CANx-GCC/main.c @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/AVR-AT90CANx-GCC/mcuconf.h b/demos/AVR-AT90CANx-GCC/mcuconf.h index 85a8cc2a6..3267455e1 100644 --- a/demos/AVR-AT90CANx-GCC/mcuconf.h +++ b/demos/AVR-AT90CANx-GCC/mcuconf.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. -- cgit v1.2.3 From dfc2c1e189dff36c57dfa521ac33289fe34972d2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 23 Apr 2011 17:37:09 +0000 Subject: Updated all the HAL configuration files. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2900 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index 3bfbca462..9c1d06fe3 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -69,6 +69,13 @@ #define HAL_USE_I2C FALSE #endif +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU TRUE +#endif + /** * @brief Enables the MAC subsystem. */ -- cgit v1.2.3 From 82215e70199aa16ccad770a0e47ca5131a3f8b93 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 8 May 2011 09:16:22 +0000 Subject: All halcof.h files updated for the SDC driver. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2932 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index 9c1d06fe3..ba3a80121 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -97,6 +97,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC TRUE +#endif + /** * @brief Enables the SERIAL subsystem. */ -- cgit v1.2.3 From 85f17ebe017f0ef2a42d96eb3525346db5b9c65e Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 13 May 2011 17:20:39 +0000 Subject: Customer CR. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2951 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 644d792db..3d5fefb9f 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -90,6 +90,23 @@ #define CH_MEMCORE_SIZE 128 #endif +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread automatically. The application has + * then the responsibility to do one of the following: + * - Spawn a custom idle thread at priority @p IDLEPRIO. + * - Change the main() thread priority to @p IDLEPRIO then enter + * an endless loop. In this scenario the @p main() thread acts as + * the idle thread. + * . + * @note Unless an idle thread is spawned the @p main() thread must not + * enter a sleep state. + */ +#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__) +#define CH_NO_IDLE_THREAD FALSE +#endif + /*===========================================================================*/ /* Performance options. */ /*===========================================================================*/ -- cgit v1.2.3 From 8af2607871d3a2f5bc92ce9fb095a23d7adab27b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 14 May 2011 05:24:10 +0000 Subject: Updated HAL configuration files with SDC driver settings. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2953 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index ba3a80121..d13f55b9d 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -242,6 +242,36 @@ /* PWM driver related settings. */ /*===========================================================================*/ +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intevals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ -- cgit v1.2.3 From 67e6534f658113f8bdfccab5fb6373214501d32b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 14 May 2011 07:05:46 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2955 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index d13f55b9d..82a219d8d 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -101,7 +101,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** -- cgit v1.2.3 From 391474c15f0695d4b1bbe1549fefc98ef3cf9e4d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 14 May 2011 07:11:40 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2956 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index 82a219d8d..e3ea70d99 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -73,7 +73,7 @@ * @brief Enables the ICU subsystem. */ #if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU TRUE +#define HAL_USE_ICU FALSE #endif /** -- cgit v1.2.3 From b4aa14e88c9e28a16a5f9c0c220fac6cc36750ad Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 18 May 2011 09:03:50 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2971 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 3d5fefb9f..b941ca77d 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -123,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE #endif -/** - * @brief Exotic optimization. - * @details If defined then a CPU register is used as storage for the global - * @p currp variable. Caching this variable in a register greatly - * improves both space and time OS efficiency. A side effect is that - * one less register has to be saved during the context switch - * resulting in lower RAM usage and faster context switch. - * - * @note This option is only usable with the GCC compiler and is only useful - * on processors with many registers like ARM cores. - * @note If this option is enabled then ALL the libraries linked to the - * ChibiOS/RT code must be recompiled with the GCC option @p - * -ffixed-@. - * @note This option must be enabled in the Makefile, it is listed here for - * documentation only. - */ -#if defined(__DOXYGEN__) -#define CH_CURRP_REGISTER_CACHE "reg" -#endif - /*===========================================================================*/ /* Subsystem options. */ /*===========================================================================*/ -- cgit v1.2.3 From 3495905f51318549a2bd6764360a4812aac869fa Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 19 May 2011 17:46:52 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2974 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 1 - 1 file changed, 1 deletion(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index b941ca77d..2568f89ca 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -278,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_SEMAPHORES. */ #if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__) #define CH_USE_QUEUES TRUE -- cgit v1.2.3 From 6b6790350e7861f2a15b308d84bc052681d1d150 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 19 May 2011 18:54:35 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2980 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 2568f89ca..15e938e53 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -84,7 +84,7 @@ * * @note In order to let the OS manage the whole RAM the linker script must * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_USE_COREMEM. + * @note Requires @p CH_USE_MEMCORE. */ #if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__) #define CH_MEMCORE_SIZE 128 @@ -300,7 +300,7 @@ * in the kernel. * * @note The default is @p TRUE. - * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or + * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or * @p CH_USE_SEMAPHORES. * @note Mutexes are recommended. */ @@ -315,7 +315,7 @@ * * @note The default is @p FALSE. * @note Requires @p CH_USE_HEAP. - * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the + * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the * appropriate documentation. */ #if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) -- cgit v1.2.3 From b9933c2089f5f0cd93738ae9081c45fcf3df54b7 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 11 Aug 2011 17:51:37 +0000 Subject: Implemented system state checker debug option, remove the option CH_USE_NESTED_LOCKS. Documentation improvements and fixes. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3221 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 61 +++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 20 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 15e938e53..cb22265a2 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -33,7 +33,10 @@ #define _CHCONF_H_ /*===========================================================================*/ -/* Kernel parameters. */ +/** + * @name Kernel parameters and options + * @{ + */ /*===========================================================================*/ /** @@ -60,21 +63,6 @@ #define CH_TIME_QUANTUM 20 #endif -/** - * @brief Nested locks. - * @details If enabled then the use of nested @p chSysLock() / @p chSysUnlock() - * operations is allowed.
- * For performance and code size reasons the recommended setting - * is to leave this option disabled.
- * You may use this option if you need to merge ChibiOS/RT with - * external libraries that require nested lock/unlock operations. - * - * @note The default is @p FALSE. - */ -#if !defined(CH_USE_NESTED_LOCKS) || defined(__DOXYGEN__) -#define CH_USE_NESTED_LOCKS FALSE -#endif - /** * @brief Managed RAM size. * @details Size of the RAM area to be managed by the OS. If set to zero @@ -107,8 +95,13 @@ #define CH_NO_IDLE_THREAD FALSE #endif +/** @} */ + /*===========================================================================*/ -/* Performance options. */ +/** + * @name Performance options + * @{ + */ /*===========================================================================*/ /** @@ -123,8 +116,13 @@ #define CH_OPTIMIZE_SPEED TRUE #endif +/** @} */ + /*===========================================================================*/ -/* Subsystem options. */ +/** + * @name Subsystem options + * @{ + */ /*===========================================================================*/ /** @@ -346,10 +344,26 @@ #define CH_USE_DYNAMIC FALSE #endif +/** @} */ + /*===========================================================================*/ -/* Debug options. */ +/** + * @name Debug options + * @{ + */ /*===========================================================================*/ +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#if !defined(CH_DBG_SYSTEM_STATE_CHECK) || defined(__DOXYGEN__) +#define CH_DBG_SYSTEM_STATE_CHECK FALSE +#endif + /** * @brief Debug option, parameters checks. * @details If enabled then the checks on the API functions input @@ -423,8 +437,13 @@ #define CH_DBG_THREADS_PROFILING TRUE #endif +/** @} */ + /*===========================================================================*/ -/* Kernel hooks. */ +/** + * @name Kernel hooks + * @{ + */ /*===========================================================================*/ /** @@ -495,6 +514,8 @@ } #endif +/** @} */ + /*===========================================================================*/ /* Port-specific settings (override port settings defaulted in chcore.h). */ /*===========================================================================*/ -- cgit v1.2.3 From 5cee2c08d787d1b14c62d5595b72644a773fe443 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 13 Aug 2011 15:40:57 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3226 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index cb22265a2..7a50c5b5a 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -482,6 +482,16 @@ } #endif +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#if !defined(THREAD_CONTEXT_SWITCH_HOOK) || defined(__DOXYGEN__) +#define THREAD_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* System halt code here.*/ \ +} +#endif + /** * @brief Idle Loop hook. * @details This hook is continuously invoked by the idle thread loop. -- cgit v1.2.3 From bc571ccd326886a8cbbde85de66b6fab91336193 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 12 Sep 2011 19:15:30 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3312 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index e3ea70d99..0b74e6678 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -55,6 +55,13 @@ #define HAL_USE_CAN FALSE #endif +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + /** * @brief Enables the GPT subsystem. */ @@ -185,6 +192,13 @@ /* MAC driver related settings. */ /*===========================================================================*/ +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + /*===========================================================================*/ /* MMC_SPI driver related settings. */ /*===========================================================================*/ @@ -234,14 +248,6 @@ #define MMC_USE_SPI_POLLING TRUE #endif -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* PWM driver related settings. */ -/*===========================================================================*/ - /*===========================================================================*/ /* SDC driver related settings. */ /*===========================================================================*/ -- cgit v1.2.3 From b86e5efeeb17af6937319d0fd874fc64b0c1ccb4 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 12 Sep 2011 19:27:05 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3313 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index 0b74e6678..8ec0c2a35 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -251,6 +251,7 @@ /*===========================================================================*/ /* SDC driver related settings. */ /*===========================================================================*/ + /** * @brief Number of initialization attempts before rejecting the card. * @note Attempts are performed at 10mS intevals. @@ -322,10 +323,6 @@ #define SPI_USE_MUTUAL_EXCLUSION TRUE #endif -/*===========================================================================*/ -/* UART driver related settings. */ -/*===========================================================================*/ - #endif /* _HALCONF_H_ */ /** @} */ -- cgit v1.2.3 From c39d08fc2ae9c43f73114e24292520306bddde19 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 23 Sep 2011 15:48:55 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3384 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/.cproject | 237 +++++++++++++++++++++++++++++++++++++++ demos/AVR-AT90CANx-GCC/.project | 90 +++++++++++++++ 2 files changed, 327 insertions(+) create mode 100644 demos/AVR-AT90CANx-GCC/.cproject create mode 100644 demos/AVR-AT90CANx-GCC/.project (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/.cproject b/demos/AVR-AT90CANx-GCC/.cproject new file mode 100644 index 000000000..31d9e0ba0 --- /dev/null +++ b/demos/AVR-AT90CANx-GCC/.cproject @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demos/AVR-AT90CANx-GCC/.project b/demos/AVR-AT90CANx-GCC/.project new file mode 100644 index 000000000..70de8c973 --- /dev/null +++ b/demos/AVR-AT90CANx-GCC/.project @@ -0,0 +1,90 @@ + + + AVR-AT90CANx-GCC + + + _Common Files + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + ?name? + + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.autoBuildTarget + all + + + org.eclipse.cdt.make.core.buildArguments + + + + org.eclipse.cdt.make.core.buildCommand + make + + + org.eclipse.cdt.make.core.cleanBuildTarget + clean + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.enableAutoBuild + false + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.fullBuildTarget + all + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + true + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.core.cnature + + + + os + 2 + WORKSPACE_LOC/os + + + test + 2 + WORKSPACE_LOC/test + + + -- cgit v1.2.3 From 8ce9365e009b1f1555bcd4901118ebf8de2eaa3d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 25 Sep 2011 15:31:46 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3411 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/.cproject | 237 --------------------------------------- demos/AVR-AT90CANx-GCC/.project | 90 --------------- 2 files changed, 327 deletions(-) delete mode 100644 demos/AVR-AT90CANx-GCC/.cproject delete mode 100644 demos/AVR-AT90CANx-GCC/.project (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/.cproject b/demos/AVR-AT90CANx-GCC/.cproject deleted file mode 100644 index 31d9e0ba0..000000000 --- a/demos/AVR-AT90CANx-GCC/.cproject +++ /dev/null @@ -1,237 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/demos/AVR-AT90CANx-GCC/.project b/demos/AVR-AT90CANx-GCC/.project deleted file mode 100644 index 70de8c973..000000000 --- a/demos/AVR-AT90CANx-GCC/.project +++ /dev/null @@ -1,90 +0,0 @@ - - - AVR-AT90CANx-GCC - - - _Common Files - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.core.cnature - - - - os - 2 - WORKSPACE_LOC/os - - - test - 2 - WORKSPACE_LOC/test - - - -- cgit v1.2.3 From eea23b22826e76dba443a12c651d5490a0314471 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 8 Oct 2011 16:56:03 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3439 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index 8ec0c2a35..b4fb49092 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -38,7 +38,7 @@ * @brief Enables the PAL subsystem. */ #if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL FALSE +#define HAL_USE_PAL TRUE #endif /** @@ -104,6 +104,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + /** * @brief Enables the SDC subsystem. */ -- cgit v1.2.3 From 36d1e0978ac7cce6074470ac5a09d14b9986f922 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 10 Oct 2011 18:08:37 +0000 Subject: Finalized AVR PAL driver. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3441 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/main.c | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c index d039c6cf6..50d43a7f9 100644 --- a/demos/AVR-AT90CANx-GCC/main.c +++ b/demos/AVR-AT90CANx-GCC/main.c @@ -20,34 +20,22 @@ #include "ch.h" #include "hal.h" -#include "evtimer.h" +#include "test.h" static WORKING_AREA(waThread1, 32); static msg_t Thread1(void *arg) { while (TRUE) { - PORTE ^= PORTE_LED; - chThdSleepMilliseconds(500); + palTogglePad(IOPORT5, PORTE_LED); + chThdSleepMilliseconds(500); } return 0; } -static void TimerHandler(eventid_t id) { - msg_t TestThread(void *p); - - if (!(PORTE & PORTE_BUTTON)) - TestThread(&SD2); -} - /* * Application entry point. */ int main(void) { - static EvTimer evt; - static evhandler_t handlers[1] = { - TimerHandler - }; - static EventListener el0; /* * System initializations. @@ -64,20 +52,16 @@ int main(void) { */ sdStart(&SD2, NULL); - /* - * Event Timer initialization. - */ - evtInit(&evt, MS2ST(500)); /* Initializes an event timer object. */ - evtStart(&evt); /* Starts the event timer. */ - chEvtRegister(&evt.et_es, &el0, 0); /* Registers on the timer event source. */ - /* * Starts the LED blinker thread. */ chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); - while(TRUE) - chEvtDispatch(handlers, chEvtWaitOne(ALL_EVENTS)); + while(TRUE) { + if (!palReadPad(IOPORT5, PORTE_BUTTON)) + TestThread(&SD2); + chThdSleepMilliseconds(500); + } return 0; } -- cgit v1.2.3 From a2708c091beb3331967dff2af9a9232744427de4 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 9 Jan 2012 19:37:58 +0000 Subject: Updated all halconf.h files. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3777 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index b4fb49092..944627bb4 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -34,6 +34,13 @@ #include "mcuconf.h" +/** + * @brief Enables the TM subsystem. + */ +#if !defined(HAL_USE_TM) || defined(__DOXYGEN__) +#define HAL_USE_TM TRUE +#endif + /** * @brief Enables the PAL subsystem. */ -- cgit v1.2.3 From 58f1fe92ee9c68ffd08bccd19f67eafbbc968a71 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 11 Jan 2012 18:02:20 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3788 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index 944627bb4..938dd46f3 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -38,7 +38,7 @@ * @brief Enables the TM subsystem. */ #if !defined(HAL_USE_TM) || defined(__DOXYGEN__) -#define HAL_USE_TM TRUE +#define HAL_USE_TM FALSE #endif /** -- cgit v1.2.3 From de5dcbba856524599a8f06d3a9bdbf1b01db44c2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 21 Jan 2012 14:29:42 +0000 Subject: License text updated with new year. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3846 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 2 +- demos/AVR-AT90CANx-GCC/halconf.h | 2 +- demos/AVR-AT90CANx-GCC/main.c | 2 +- demos/AVR-AT90CANx-GCC/mcuconf.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 7a50c5b5a..3733daac8 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -1,6 +1,6 @@ /* ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. + 2011,2012 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index 938dd46f3..eb013c9a7 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -1,6 +1,6 @@ /* ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. + 2011,2012 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c index 50d43a7f9..7361d7017 100644 --- a/demos/AVR-AT90CANx-GCC/main.c +++ b/demos/AVR-AT90CANx-GCC/main.c @@ -1,6 +1,6 @@ /* ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. + 2011,2012 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/AVR-AT90CANx-GCC/mcuconf.h b/demos/AVR-AT90CANx-GCC/mcuconf.h index 3267455e1..51cb93729 100644 --- a/demos/AVR-AT90CANx-GCC/mcuconf.h +++ b/demos/AVR-AT90CANx-GCC/mcuconf.h @@ -1,6 +1,6 @@ /* ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. + 2011,2012 Giovanni Di Sirio. This file is part of ChibiOS/RT. -- cgit v1.2.3 From f038bffdb512f67d4f90e8cba499713458eebd67 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 1 Apr 2012 09:13:04 +0000 Subject: Fixed bug 3510812. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4066 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 2 +- demos/AVR-AT90CANx-GCC/halconf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 3733daac8..ec84e58af 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -459,7 +459,7 @@ * @brief Threads initialization hook. * @details User initialization code added to the @p chThdInit() API. * - * @note It is invoked from within @p chThdInit() and implicitily from all + * @note It is invoked from within @p chThdInit() and implicitly from all * the threads creation APIs. */ #if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__) diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index eb013c9a7..c9b3ad25a 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -268,7 +268,7 @@ /** * @brief Number of initialization attempts before rejecting the card. - * @note Attempts are performed at 10mS intevals. + * @note Attempts are performed at 10mS intervals. */ #if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) #define SDC_INIT_RETRY 100 -- cgit v1.2.3 From 814b642a0ced73a71ceb3b548c2c570e8631dd58 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 18 Apr 2012 16:40:15 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4112 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/Makefile b/demos/AVR-AT90CANx-GCC/Makefile index 11e902b59..fa9309e2f 100644 --- a/demos/AVR-AT90CANx-GCC/Makefile +++ b/demos/AVR-AT90CANx-GCC/Makefile @@ -128,7 +128,7 @@ DEBUG = dwarf-2 # List any extra directories to look for include files here. -# Each directory must be seperated by a space. +# Each directory must be separated by a space. # Use forward slashes for directory separators. # For a directory that has spaces, enclose it in quotes. EXTRAINCDIRS = $(PORTINC) $(KERNINC) $(TESTINC) \ @@ -254,7 +254,7 @@ MATH_LIB = -lm # List any extra directories to look for libraries here. -# Each directory must be seperated by a space. +# Each directory must be separated by a space. # Use forward slashes for directory separators. # For a directory that has spaces, enclose it in quotes. EXTRALIBDIRS = -- cgit v1.2.3 From 77d7a3741d05e24286f41d3bfdfdee78f4dbd8a6 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 30 Dec 2012 09:43:16 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4995 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index c9b3ad25a..25538a2a8 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -206,6 +206,13 @@ /* MAC driver related settings. */ /*===========================================================================*/ +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + /** * @brief Enables an event sources for incoming packets. */ -- cgit v1.2.3 From 097062ca3be263bac3906c4b23d56ca765504ba8 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 2 Feb 2013 10:35:45 +0000 Subject: Removed obsolete options from the haconf.h files. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5101 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/halconf.h | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index 25538a2a8..3260be7f3 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -224,13 +224,6 @@ /* MMC_SPI driver related settings. */ /*===========================================================================*/ -/** - * @brief Block size for MMC transfers. - */ -#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__) -#define MMC_SECTOR_SIZE 512 -#endif - /** * @brief Delays insertions. * @details If enabled this options inserts delays into the MMC waiting @@ -243,32 +236,6 @@ #define MMC_NICE_WAITING TRUE #endif -/** - * @brief Number of positive insertion queries before generating the - * insertion event. - */ -#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__) -#define MMC_POLLING_INTERVAL 10 -#endif - -/** - * @brief Interval, in milliseconds, between insertion queries. - */ -#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__) -#define MMC_POLLING_DELAY 10 -#endif - -/** - * @brief Uses the SPI polled API for small data transfers. - * @details Polled transfers usually improve performance because it - * saves two context switches and interrupt servicing. Note - * that this option has no effect on large transfers which - * are always performed using DMAs/IRQs. - */ -#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__) -#define MMC_USE_SPI_POLLING TRUE -#endif - /*===========================================================================*/ /* SDC driver related settings. */ /*===========================================================================*/ -- cgit v1.2.3 From 184a71345c6a36a9a8664eda8fbcc3ea728267a8 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 2 Feb 2013 10:58:09 +0000 Subject: Updated license years. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5102 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 2 +- demos/AVR-AT90CANx-GCC/halconf.h | 2 +- demos/AVR-AT90CANx-GCC/main.c | 2 +- demos/AVR-AT90CANx-GCC/mcuconf.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index ec84e58af..f3f8e60cc 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -1,6 +1,6 @@ /* ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. + 2011,2012,2013 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index 3260be7f3..9bff08736 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -1,6 +1,6 @@ /* ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. + 2011,2012,2013 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c index 7361d7017..57cc176d3 100644 --- a/demos/AVR-AT90CANx-GCC/main.c +++ b/demos/AVR-AT90CANx-GCC/main.c @@ -1,6 +1,6 @@ /* ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. + 2011,2012,2013 Giovanni Di Sirio. This file is part of ChibiOS/RT. diff --git a/demos/AVR-AT90CANx-GCC/mcuconf.h b/demos/AVR-AT90CANx-GCC/mcuconf.h index 51cb93729..e045be09d 100644 --- a/demos/AVR-AT90CANx-GCC/mcuconf.h +++ b/demos/AVR-AT90CANx-GCC/mcuconf.h @@ -1,6 +1,6 @@ /* ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. + 2011,2012,2013 Giovanni Di Sirio. This file is part of ChibiOS/RT. -- cgit v1.2.3 From 853216256ad4cdacf5f94edb7d6b738c6be165a1 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 30 Mar 2013 10:32:37 +0000 Subject: Relicensing parts of the tree under the Apache 2.0 license. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5521 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/chconf.h | 24 ++++++++++-------------- demos/AVR-AT90CANx-GCC/halconf.h | 24 ++++++++++-------------- demos/AVR-AT90CANx-GCC/main.c | 24 ++++++++++-------------- demos/AVR-AT90CANx-GCC/mcuconf.h | 24 ++++++++++-------------- 4 files changed, 40 insertions(+), 56 deletions(-) (limited to 'demos/AVR-AT90CANx-GCC') diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index f3f8e60cc..253eadaa5 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -1,21 +1,17 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012,2013 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio - This file is part of ChibiOS/RT. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. + http://www.apache.org/licenses/LICENSE-2.0 - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. */ /** diff --git a/demos/AVR-AT90CANx-GCC/halconf.h b/demos/AVR-AT90CANx-GCC/halconf.h index 9bff08736..3858828e6 100644 --- a/demos/AVR-AT90CANx-GCC/halconf.h +++ b/demos/AVR-AT90CANx-GCC/halconf.h @@ -1,21 +1,17 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012,2013 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio - This file is part of ChibiOS/RT. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. + http://www.apache.org/licenses/LICENSE-2.0 - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. */ /** diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c index 57cc176d3..6b2871b78 100644 --- a/demos/AVR-AT90CANx-GCC/main.c +++ b/demos/AVR-AT90CANx-GCC/main.c @@ -1,21 +1,17 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012,2013 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio - This file is part of ChibiOS/RT. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. + http://www.apache.org/licenses/LICENSE-2.0 - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. */ #include "ch.h" diff --git a/demos/AVR-AT90CANx-GCC/mcuconf.h b/demos/AVR-AT90CANx-GCC/mcuconf.h index e045be09d..d3c05d25b 100644 --- a/demos/AVR-AT90CANx-GCC/mcuconf.h +++ b/demos/AVR-AT90CANx-GCC/mcuconf.h @@ -1,21 +1,17 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012,2013 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio - This file is part of ChibiOS/RT. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. + http://www.apache.org/licenses/LICENSE-2.0 - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. */ /* -- cgit v1.2.3