From 1d8c29c017b98aa823230ce49e9dbae2911b1e02 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 27 Feb 2008 15:36:56 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@206 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-ATmega128-GCC/Makefile | 640 +++++++++++++++++++++++++++++++++++++++ demos/AVR-ATmega128-GCC/board.c | 81 +++++ demos/AVR-ATmega128-GCC/board.h | 89 ++++++ demos/AVR-ATmega128-GCC/chconf.h | 169 +++++++++++ demos/AVR-ATmega128-GCC/main.c | 54 ++++ 5 files changed, 1033 insertions(+) create mode 100644 demos/AVR-ATmega128-GCC/Makefile create mode 100644 demos/AVR-ATmega128-GCC/board.c create mode 100644 demos/AVR-ATmega128-GCC/board.h create mode 100644 demos/AVR-ATmega128-GCC/chconf.h create mode 100644 demos/AVR-ATmega128-GCC/main.c (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/Makefile b/demos/AVR-ATmega128-GCC/Makefile new file mode 100644 index 000000000..42104bc7a --- /dev/null +++ b/demos/AVR-ATmega128-GCC/Makefile @@ -0,0 +1,640 @@ +# 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 = atmega128 + + +# 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 = ../../ports/AVR/chcore.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.) +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 = + + +# 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 ../../src/lib ../../ports/AVR + + +# 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 bin eep lss sym +#build: lib + + +elf: $(TARGET).elf +hex: $(TARGET).hex +bin: $(TARGET).bin +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 $< $@ + +%.bin: %.elf + @echo + @echo $(MSG_FLASH) $@ + $(OBJCOPY) -O binary -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).bin + $(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 bin eep lss sym coff extcoff \ +clean clean_list program debug gdb-config + + + + + + diff --git a/demos/AVR-ATmega128-GCC/board.c b/demos/AVR-ATmega128-GCC/board.c new file mode 100644 index 000000000..b0907d6c4 --- /dev/null +++ b/demos/AVR-ATmega128-GCC/board.c @@ -0,0 +1,81 @@ +/* + 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" + +ISR(TIMER0_OVF_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. + */ + MCUCR = (1 << SE); + + /* + * Timer 0 setup. + */ + TCCR0 = (1 << WGM01) | (0 << WGM00) | // CTC mode. + (0 << COM01) | (0 << COM00) | // OC0A disabled (normal I/O). + (0 << CS02) | (1 << CS01) | (1 << CS00); // CLK/64 clock source. + OCR0 = F_CPU / 64 / CH_FREQUENCY - 1; + TCNT0 = 0; // Reset counter. + TIFR = (1 << OCF0); // Reset pending (if any). + TIMSK = (1 << OCIE0); // Interrupt on compare. +} diff --git a/demos/AVR-ATmega128-GCC/board.h b/demos/AVR-ATmega128-GCC/board.h new file mode 100644 index 000000000..ee0e9b624 --- /dev/null +++ b/demos/AVR-ATmega128-GCC/board.h @@ -0,0 +1,89 @@ +/* + 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_MT_128 + +/* PA7 RLY DS B5 B4 B3 B2 B1 + * IN OUT IN IN IN IN IN IN + * DDRA 0 1 0 0 0 0 0 0 + * PU VAL HiZ HiZ HiZ HiZ HiZ HiZ + * PORTA 1 0 0 0 0 0 0 0 + */ +#define VAL_DDRA 0x40 +#define VAL_PORTA 0x80 + +/* + * All inputs with pullups. + */ +#define VAL_DDRB 0x00 +#define VAL_PORTB 0xFF + +/* D7 D6 D5 D4 PC3 E R/W RS + * IN IN IN IN IN OUT OUT OUT + * DDRC 0 0 0 0 0 1 1 1 + * PU PU PU PU PU VAL VAL VAL + * PORTC 1 1 1 1 1 0 0 0 + */ +#define VAL_DDRC 0x03 +#define VAL_PORTC 0xF8 + +/* PD7 PD6 PD5 PD4 TXD RXD PD1 PD0 + * IN IN IN IN OUT IN IN IN + * DDRD 0 0 0 0 1 0 0 0 + * PU PU PU PU VAL HiZ HiZ HiZ + * PORTD 1 1 1 1 1 0 0 0 + */ +#define VAL_DDRD 0x08 +#define VAL_PORTD 0xF8 + +/* PE7 PE6 BZ2 BZ2 PE3 PE2 PE1 PE0 + * IN IN OUT OUT IN IN OUT IN + * DDRE 0 0 1 1 0 0 1 0 + * PU PU VAL VAL PU PU VAL PU + * PORTE 1 1 1 1 1 1 1 1 + */ +#define VAL_DDRE 0x32 +#define VAL_PORTE 0xFF + +/* 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 + * PU PU PU PU PU PU PU PU + * PORTF 1 1 1 1 1 1 1 1 + * + */ +#define VAL_DDRF 0x00 +#define VAL_PORTF 0xFF + +/* 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); + +#endif /* _BOARD_H_ */ diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h new file mode 100644 index 000000000..c8817f85c --- /dev/null +++ b/demos/AVR-ATmega128-GCC/chconf.h @@ -0,0 +1,169 @@ +/* + 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 . +*/ + +/* + * Configuration file for LPC214x-GCC demo project. + */ + +/** + * @addtogroup Config + * @{ + */ + +#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 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 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 + +/** 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 Mutexes APIs are included in + * the kernel.*/ +#define CH_USE_MUTEXES + +/** 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 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 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. + * @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 1000 + +/** Configuration option: This constant is the number of ticks allowed for the + * threads before preemption occurs.*/ +#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 + * 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 "r7" + +/** 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 + +/** Debug option: Includes the threads context switch tracing feature. + */ +//#define CH_USE_TRACE + +#endif /* _CHCONF_H_ */ + +/** @} */ diff --git a/demos/AVR-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c new file mode 100644 index 000000000..14c45cf47 --- /dev/null +++ b/demos/AVR-ATmega128-GCC/main.c @@ -0,0 +1,54 @@ +/* + 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 + +void hwinit(void); + +static WorkingArea(waThread1, 32); +static t_msg Thread1(void *arg) { + + while (TRUE) { + chThdSleep(800); + } + return 0; +} + +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); + + while(TRUE) + /* Do stuff*/ ; + + return 0; +} -- cgit v1.2.3 From 64e798c8cd4ae5e6ce18290f8452099ec90ebd14 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 27 Feb 2008 15:53:49 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@207 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-ATmega128-GCC/chconf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index c8817f85c..17c2c3d38 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-GCC/chconf.h @@ -152,7 +152,7 @@ * ChibiOS/RT code must be recompiled with the GCC option \p * -ffixed-. */ -//#define CH_CURRP_REGISTER_CACHE "r7" +//#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 -- cgit v1.2.3 From 4ea04cc357408d68750e5b4a9d834c5a5d015fa7 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 29 Feb 2008 14:55:04 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@208 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-ATmega128-GCC/Makefile | 3 +-- demos/AVR-ATmega128-GCC/board.c | 4 ++-- demos/AVR-ATmega128-GCC/board.h | 19 +++++++++++++++++++ demos/AVR-ATmega128-GCC/main.c | 7 +++++-- 4 files changed, 27 insertions(+), 6 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/Makefile b/demos/AVR-ATmega128-GCC/Makefile index 42104bc7a..dea57ee61 100644 --- a/demos/AVR-ATmega128-GCC/Makefile +++ b/demos/AVR-ATmega128-GCC/Makefile @@ -85,11 +85,10 @@ SRC = ../../ports/AVR/chcore.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 \ + ../../src/lib/evtimer.c \ board.c main.c - # List C++ source files here. (C dependencies are automatically generated.) CPPSRC = diff --git a/demos/AVR-ATmega128-GCC/board.c b/demos/AVR-ATmega128-GCC/board.c index b0907d6c4..6ac43a218 100644 --- a/demos/AVR-ATmega128-GCC/board.c +++ b/demos/AVR-ATmega128-GCC/board.c @@ -24,7 +24,7 @@ #include "board.h" -ISR(TIMER0_OVF_vect) { +ISR(TIMER0_COMP_vect) { chSysIRQEnterI(); @@ -73,7 +73,7 @@ void hwinit(void) { */ TCCR0 = (1 << WGM01) | (0 << WGM00) | // CTC mode. (0 << COM01) | (0 << COM00) | // OC0A disabled (normal I/O). - (0 << CS02) | (1 << CS01) | (1 << CS00); // CLK/64 clock source. + (1 << CS02) | (0 << CS01) | (0 << CS00); // CLK/64 clock source. OCR0 = F_CPU / 64 / CH_FREQUENCY - 1; TCNT0 = 0; // Reset counter. TIFR = (1 << OCF0); // Reset pending (if any). diff --git a/demos/AVR-ATmega128-GCC/board.h b/demos/AVR-ATmega128-GCC/board.h index ee0e9b624..a29ee8664 100644 --- a/demos/AVR-ATmega128-GCC/board.h +++ b/demos/AVR-ATmega128-GCC/board.h @@ -84,6 +84,25 @@ #define VAL_DDRG 0x00 #define VAL_PORTG 0x07 +#define PORTA_BUTTON1 (1 << 0) +#define PORTA_BUTTON2 (1 << 1) +#define PORTA_BUTTON3 (1 << 2) +#define PORTA_BUTTON4 (1 << 3) +#define PORTA_BUTTON5 (1 << 4) +#define PORTA_DALLAS (1 << 5) +#define PORTA_RELAY (1 << 6) + +#define PORTC_44780_RS (1 << 0) +#define PORTC_44780_RW (1 << 1) +#define PORTC_44780_E (1 << 2) +#define PORTC_44780_D4 (1 << 4) +#define PORTC_44780_D5 (1 << 5) +#define PORTC_44780_D6 (1 << 6) +#define PORTC_44780_D7 (1 << 7) + +#define PORTE_BUZZ1 (1 << 4) +#define PORTE_BUZZ2 (1 << 5) + void hwinit(void); #endif /* _BOARD_H_ */ diff --git a/demos/AVR-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index 14c45cf47..b5103521e 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-GCC/main.c @@ -21,13 +21,16 @@ #include +#include "board.h" + void hwinit(void); static WorkingArea(waThread1, 32); static t_msg Thread1(void *arg) { while (TRUE) { - chThdSleep(800); + PORTA ^= PORTA_RELAY; + chThdSleep(1000); } return 0; } @@ -48,7 +51,7 @@ int main(int argc, char **argv) { chThdCreate(NORMALPRIO, 0, waThread1, sizeof(waThread1), Thread1, NULL); while(TRUE) - /* Do stuff*/ ; + chThdSleep(1000); return 0; } -- cgit v1.2.3 From 2680f87b476671ef8af6314bfbf115b31daf0f50 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 29 Feb 2008 15:02:45 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@209 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-ATmega128-GCC/readme.txt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 demos/AVR-ATmega128-GCC/readme.txt (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/readme.txt b/demos/AVR-ATmega128-GCC/readme.txt new file mode 100644 index 000000000..b580dbc6e --- /dev/null +++ b/demos/AVR-ATmega128-GCC/readme.txt @@ -0,0 +1,23 @@ +***************************************************************************** +** ChibiOS/RT port for Atmel AVRmega128. ** +***************************************************************************** + +** TARGET ** + +The demo runs on an Olimex AVR-MT-128 board. + +** The Demo ** + +The demo currently just toggles the relay using a thread. It will be expanded +in next releases. + +** 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 0778745ee12a4f14c001bd205e05728cc01e9633 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 4 Mar 2008 16:08:22 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@214 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-ATmega128-GCC/Makefile | 2 +- demos/AVR-ATmega128-GCC/board.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/Makefile b/demos/AVR-ATmega128-GCC/Makefile index dea57ee61..66cc846c7 100644 --- a/demos/AVR-ATmega128-GCC/Makefile +++ b/demos/AVR-ATmega128-GCC/Makefile @@ -80,7 +80,7 @@ OBJDIR = . # List C source files here. (C dependencies are automatically generated.) -SRC = ../../ports/AVR/chcore.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 \ diff --git a/demos/AVR-ATmega128-GCC/board.c b/demos/AVR-ATmega128-GCC/board.c index 6ac43a218..03907d391 100644 --- a/demos/AVR-ATmega128-GCC/board.c +++ b/demos/AVR-ATmega128-GCC/board.c @@ -23,6 +23,7 @@ #include #include "board.h" +#include "avr_serial.h" ISR(TIMER0_COMP_vect) { @@ -78,4 +79,9 @@ void hwinit(void) { TCNT0 = 0; // Reset counter. TIFR = (1 << OCF0); // Reset pending (if any). TIMSK = (1 << OCIE0); // Interrupt on compare. + + /* + * Other initializations. + */ + InitSerial(); } -- cgit v1.2.3 From 5e64a9fec2e17d008b9488faa027d2beaa130a88 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 5 Mar 2008 10:59:11 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@215 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-ATmega128-GCC/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index b5103521e..48b263f3c 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-GCC/main.c @@ -26,7 +26,7 @@ void hwinit(void); static WorkingArea(waThread1, 32); -static t_msg Thread1(void *arg) { +static msg_t Thread1(void *arg) { while (TRUE) { PORTA ^= PORTA_RELAY; -- cgit v1.2.3 From 8c39bfc93d6c68e5d64707916558b6316f611be2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 5 Mar 2008 15:56:12 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@216 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-ATmega128-GCC/Makefile | 1 + demos/AVR-ATmega128-GCC/main.c | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/Makefile b/demos/AVR-ATmega128-GCC/Makefile index 66cc846c7..e2b5dd8cc 100644 --- a/demos/AVR-ATmega128-GCC/Makefile +++ b/demos/AVR-ATmega128-GCC/Makefile @@ -86,6 +86,7 @@ SRC = ../../ports/AVR/chcore.c ../../ports/AVR/avr_serial.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 diff --git a/demos/AVR-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index 48b263f3c..29a19701b 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-GCC/main.c @@ -18,6 +18,8 @@ */ #include +#include +#include #include @@ -35,7 +37,19 @@ static msg_t Thread1(void *arg) { return 0; } +static void TimerHandler(eventid_t id) { + msg_t TestThread(void *p); + + if (!(PORTA & PORTA_BUTTON1)) + TestThread(&SER2); +} + int main(int argc, char **argv) { + static EvTimer evt; + static evhandler_t handlers[1] = { + TimerHandler + }; + static EventListener el0; hwinit(); @@ -45,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) - chThdSleep(1000); + chEvtWait(ALL_EVENTS, handlers); return 0; } -- 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-ATmega128-GCC/readme.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/readme.txt b/demos/AVR-ATmega128-GCC/readme.txt index b580dbc6e..1c6ab3c5d 100644 --- a/demos/AVR-ATmega128-GCC/readme.txt +++ b/demos/AVR-ATmega128-GCC/readme.txt @@ -1,5 +1,5 @@ ***************************************************************************** -** ChibiOS/RT port for Atmel AVRmega128. ** +** ChibiOS/RT port for Atmel AVR ATmega128. ** ***************************************************************************** ** TARGET ** @@ -10,6 +10,7 @@ The demo runs on an Olimex AVR-MT-128 board. The demo currently just toggles the relay using a thread. It will be expanded in next releases. +By pressing the button 1 the test suite is activated, output on serial port 2. ** Build Procedure ** -- cgit v1.2.3 From d3ff29c1893323a3749e0c7f45a5d1541430929b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 7 Mar 2008 15:24:00 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@219 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-ATmega128-GCC/Makefile | 2 +- demos/AVR-ATmega128-GCC/board.h | 24 +++++----- demos/AVR-ATmega128-GCC/lcd.c | 97 ++++++++++++++++++++++++++++++++++++++ demos/AVR-ATmega128-GCC/lcd.h | 52 ++++++++++++++++++++ demos/AVR-ATmega128-GCC/main.c | 15 +++++- demos/AVR-ATmega128-GCC/readme.txt | 4 +- 6 files changed, 178 insertions(+), 16 deletions(-) create mode 100644 demos/AVR-ATmega128-GCC/lcd.c create mode 100644 demos/AVR-ATmega128-GCC/lcd.h (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/Makefile b/demos/AVR-ATmega128-GCC/Makefile index e2b5dd8cc..34c228691 100644 --- a/demos/AVR-ATmega128-GCC/Makefile +++ b/demos/AVR-ATmega128-GCC/Makefile @@ -87,7 +87,7 @@ SRC = ../../ports/AVR/chcore.c ../../ports/AVR/avr_serial.c \ ../../src/chserial.c \ ../../src/lib/evtimer.c \ ../../test/test.c \ - board.c main.c + board.c lcd.c main.c # List C++ source files here. (C dependencies are automatically generated.) diff --git a/demos/AVR-ATmega128-GCC/board.h b/demos/AVR-ATmega128-GCC/board.h index a29ee8664..97b9c684d 100644 --- a/demos/AVR-ATmega128-GCC/board.h +++ b/demos/AVR-ATmega128-GCC/board.h @@ -38,22 +38,22 @@ #define VAL_PORTB 0xFF /* D7 D6 D5 D4 PC3 E R/W RS - * IN IN IN IN IN OUT OUT OUT - * DDRC 0 0 0 0 0 1 1 1 + * OUT OUT OUT OUT IN OUT OUT OUT + * DDRC 1 1 1 1 0 1 1 1 * PU PU PU PU PU VAL VAL VAL - * PORTC 1 1 1 1 1 0 0 0 + * PORTC 0 0 0 0 1 0 0 0 */ -#define VAL_DDRC 0x03 -#define VAL_PORTC 0xF8 +#define VAL_DDRC 0xF7 +#define VAL_PORTC 0x08 /* PD7 PD6 PD5 PD4 TXD RXD PD1 PD0 * IN IN IN IN OUT IN IN IN * DDRD 0 0 0 0 1 0 0 0 - * PU PU PU PU VAL HiZ HiZ HiZ - * PORTD 1 1 1 1 1 0 0 0 + * PU PU PU PU VAL HiZ PU PU + * PORTD 1 1 1 1 1 0 1 1 */ #define VAL_DDRD 0x08 -#define VAL_PORTD 0xF8 +#define VAL_PORTD 0xFB /* PE7 PE6 BZ2 BZ2 PE3 PE2 PE1 PE0 * IN IN OUT OUT IN IN OUT IN @@ -67,12 +67,12 @@ /* 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 - * PU PU PU PU PU PU PU PU - * PORTF 1 1 1 1 1 1 1 1 + * x x x x PU PU PU PU + * PORTF 0 0 0 0 1 1 1 1 * */ #define VAL_DDRF 0x00 -#define VAL_PORTF 0xFF +#define VAL_PORTF 0x0F /* x x x x x PG2 PG1 PG0 * x x x x x IN IN IN @@ -99,6 +99,8 @@ #define PORTC_44780_D5 (1 << 5) #define PORTC_44780_D6 (1 << 6) #define PORTC_44780_D7 (1 << 7) +#define PORTC_44780_DATA (PORTC_44780_D4 | PORTC_44780_D5 | \ + PORTC_44780_D6 | PORTC_44780_D7) #define PORTE_BUZZ1 (1 << 4) #define PORTE_BUZZ2 (1 << 5) diff --git a/demos/AVR-ATmega128-GCC/lcd.c b/demos/AVR-ATmega128-GCC/lcd.c new file mode 100644 index 000000000..eed0c896e --- /dev/null +++ b/demos/AVR-ATmega128-GCC/lcd.c @@ -0,0 +1,97 @@ +/* + 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 "board.h" +#include "lcd.h" + +static void e_pulse(void) { + volatile uint8_t i; + + PORTC |= PORTC_44780_E; + for (i = 0; i < ELOOPVALUE; i++); + ; + PORTC &= ~PORTC_44780_E; +} + +static void wait_not_busy(void) { + + chThdSleep(2); +} + +/* + * 44780 soft reset procedure. + */ +void lcdInit(void) { + + PORTC = (PORTC & ~(PORTC_44780_DATA | PORTC_44780_RS | PORTC_44780_E | PORTC_44780_RW)) | + (LCD_CMD_INIT8 & PORTC_44780_DATA); + chThdSleep(50); + e_pulse(); + chThdSleep(10); + e_pulse(); + chThdSleep(2); + e_pulse(); + wait_not_busy(); + PORTC = (PORTC & ~(PORTC_44780_DATA | PORTC_44780_RS | PORTC_44780_E | PORTC_44780_RW)) | + (LCD_CMD_INIT4 & PORTC_44780_DATA); + e_pulse(); + lcdCmd(LCD_CMD_INIT4); + lcdCmd(LCD_SET_DM | LCD_DM_DISPLAY_ON); + lcdCmd(LCD_SET_INCREMENT_MODE); +} + +/* + * Sends a command byte to the 44780. + */ +void lcdCmd(uint8_t cmd) { + + wait_not_busy(); + PORTC = (PORTC | PORTC_44780_DATA) & (cmd | (0x0F & ~PORTC_44780_RS)); + e_pulse(); + PORTC = (PORTC | PORTC_44780_DATA) & ((cmd << 4) | (0x0F & ~PORTC_44780_RS)); + e_pulse(); +} + +/* + * Writes a char on the LCD at the current position. + */ +void lcdPutc(char c) { + uint8_t b; + + wait_not_busy(); + b = c | 0x0F; + PORTC = (PORTC | PORTC_44780_DATA | PORTC_44780_RS) & (c | 0x0F); + e_pulse(); + PORTC = (PORTC | PORTC_44780_DATA | PORTC_44780_RS) & ((c << 4) | 0x0F); + e_pulse(); +} + +/* + * Writes a string on the LCD at an absolute address. + */ +void lcdPuts(uint8_t pos, char *p) { + + lcdCmd(LCD_SET_DDRAM_ADDRESS | pos); + while (*p) + lcdPutc(*p++); +} diff --git a/demos/AVR-ATmega128-GCC/lcd.h b/demos/AVR-ATmega128-GCC/lcd.h new file mode 100644 index 000000000..12ffd127e --- /dev/null +++ b/demos/AVR-ATmega128-GCC/lcd.h @@ -0,0 +1,52 @@ +/* + 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 _LCD_H_ +#define _LCD_H_ + +#define ELOOPVALUE 10 + +#define LCD_CLEAR 0x01 + +#define LCD_RETURN_HOME 0x02 + +#define LCD_SET_INCREMENT_MODE 0x06 + +#define LCD_SET_DM 0x08 +#define LCD_DM_DISPLAY_ON 4 +#define LCD_DM_DISPLAY_OFF 0 +#define LCD_DM_CURSOR_ON 2 +#define LCD_DM_CURSOR_OFF 0 +#define LCD_DM_BLINK_ON 1 +#define LCD_DM_BLINK_OFF 0 + +#define LCD_CMD_INIT4 0x28 +#define LCD_CMD_INIT8 0x38 + +#define LCD_SET_DDRAM_ADDRESS 0x80 + +#define LCD_LINE1 0 +#define LCD_LINE2 40 + +void lcdInit(void); +void lcdCmd(uint8_t cmd); +void lcdPutc(char c); +void lcdPuts(uint8_t pos, char *p); + +#endif /* _LCD_H_ */ diff --git a/demos/AVR-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index 29a19701b..53fe21b2d 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-GCC/main.c @@ -24,6 +24,7 @@ #include #include "board.h" +#include "lcd.h" void hwinit(void); @@ -31,7 +32,8 @@ static WorkingArea(waThread1, 32); static msg_t Thread1(void *arg) { while (TRUE) { - PORTA ^= PORTA_RELAY; + if (!(PINA & PORTA_BUTTON2)) + PORTA ^= PORTA_RELAY; chThdSleep(1000); } return 0; @@ -40,7 +42,7 @@ static msg_t Thread1(void *arg) { static void TimerHandler(eventid_t id) { msg_t TestThread(void *p); - if (!(PORTA & PORTA_BUTTON1)) + if (!(PINA & PORTA_BUTTON1)) TestThread(&SER2); } @@ -59,6 +61,15 @@ int main(int argc, char **argv) { */ chSysInit(); + /* + * This initialization requires the OS already active because it uses delay + * APIs inside. + */ + lcdInit(); + lcdCmd(LCD_CLEAR); + lcdPuts(LCD_LINE1, " ChibiOS/RT "); + lcdPuts(LCD_LINE2, " Hello World! "); + /* * Event Timer initialization. */ diff --git a/demos/AVR-ATmega128-GCC/readme.txt b/demos/AVR-ATmega128-GCC/readme.txt index 1c6ab3c5d..7158463fb 100644 --- a/demos/AVR-ATmega128-GCC/readme.txt +++ b/demos/AVR-ATmega128-GCC/readme.txt @@ -8,8 +8,8 @@ The demo runs on an Olimex AVR-MT-128 board. ** The Demo ** -The demo currently just toggles the relay using a thread. It will be expanded -in next releases. +The demo currently just writes a hello world on the LCD and toggles the relay +using a thread while button 2 is pressed. By pressing the button 1 the test suite is activated, output on serial port 2. ** Build Procedure ** -- 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-ATmega128-GCC/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/Makefile b/demos/AVR-ATmega128-GCC/Makefile index 34c228691..3be566c19 100644 --- a/demos/AVR-ATmega128-GCC/Makefile +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/Makefile b/demos/AVR-ATmega128-GCC/Makefile index 3be566c19..89b5118ff 100644 --- a/demos/AVR-ATmega128-GCC/Makefile +++ b/demos/AVR-ATmega128-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 lcd.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-ATmega128-GCC/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index 53fe21b2d..f238642ef 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-GCC/main.c @@ -80,7 +80,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-ATmega128-GCC/chconf.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 17c2c3d38..fca0159a2 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index fca0159a2..a6b0f4a95 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index a6b0f4a95..fca0159a2 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index fca0159a2..182ba1a9b 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 182ba1a9b..bd9c528d2 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index bd9c528d2..594d28272 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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 090b4c11096363cf25ba9c4ea2a788cae1d7e8a4 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 30 Aug 2008 08:48:18 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@419 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-ATmega128-GCC/chconf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 594d28272..7ff7df502 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-GCC/chconf.h @@ -147,11 +147,11 @@ * provide the \p __heap_base__ and \p __heap_end__ symbols. * @note requires \p CH_USE_HEAP. */ -#define CH_HEAP_SIZE 0 +#define CH_HEAP_SIZE 128 /** 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 +//#define CH_USE_MALLOC_HEAP /** Configuration option: if specified then the memory pools allocator APIs * are included in the kernel.*/ -- 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-ATmega128-GCC/chconf.h | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 7ff7df502..58f0fca7e 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 58f0fca7e..c44cd39d5 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index c44cd39d5..736c4064e 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 736c4064e..c44cd39d5 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index c44cd39d5..f3975e8a4 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index f238642ef..873a28a79 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-GCC/main.c @@ -80,7 +80,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-ATmega128-GCC/chconf.h | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index f3975e8a4..34b26c7be 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 34b26c7be..6ec07fca9 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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 69d06df416f4aa337de7183b6ed54ffe527ca0c0 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 1 Nov 2008 16:46:53 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@488 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-ATmega128-GCC/Makefile | 2 +- demos/AVR-ATmega128-GCC/chconf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/Makefile b/demos/AVR-ATmega128-GCC/Makefile index 89b5118ff..f291af1fb 100644 --- a/demos/AVR-ATmega128-GCC/Makefile +++ b/demos/AVR-ATmega128-GCC/Makefile @@ -109,7 +109,7 @@ ASRC = # 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 +OPT = 2 # Debugging format. diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 6ec07fca9..a3e829134 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-GCC/chconf.h @@ -117,7 +117,7 @@ * provide the \p __heap_base__ and \p __heap_end__ symbols. * @note requires \p CH_USE_HEAP. */ -#define CH_HEAP_SIZE 128 +#define CH_HEAP_SIZE 512 /** Configuration option: enforces the use of the C-runtime \p malloc() and * \p free() functions as backend for the system heap allocator.*/ -- 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-ATmega128-GCC/chconf.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index a3e829134..87b92479e 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 87b92479e..bda3d497b 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index bda3d497b..d2a689b62 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index 873a28a79..40b2f8b89 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-GCC/main.c @@ -34,7 +34,7 @@ static msg_t Thread1(void *arg) { while (TRUE) { if (!(PINA & PORTA_BUTTON2)) PORTA ^= PORTA_RELAY; - chThdSleep(1000); + chThdSleepMilliseconds(1000); } return 0; } @@ -73,7 +73,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. */ @@ -83,7 +83,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-ATmega128-GCC/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index 40b2f8b89..405770d00 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-GCC/main.c @@ -28,7 +28,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-ATmega128-GCC/chconf.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index d2a689b62..ea028aed6 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/board.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/board.c b/demos/AVR-ATmega128-GCC/board.c index 03907d391..96c810b17 100644 --- a/demos/AVR-ATmega128-GCC/board.c +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/board.c | 6 +++--- demos/AVR-ATmega128-GCC/chconf.h | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/board.c b/demos/AVR-ATmega128-GCC/board.c index 96c810b17..0e40c20f4 100644 --- a/demos/AVR-ATmega128-GCC/board.c +++ b/demos/AVR-ATmega128-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(); } /* diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index ea028aed6..4e9abec89 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-GCC/chconf.h @@ -30,6 +30,15 @@ * that this is not related to the compiler optimization options.*/ #define CH_OPTIMIZE_SPEED +/** Configuration option: If enabled then the used of nested @p chSysLock() / + * @p chSysUnlock() operations is allowed.
+ * For performance and code size reasons the recommended setting is 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. + */ +//#define CH_USE_NESTED_LOCKS + /** Configuration option: if specified then the kernel performs the round * robin scheduling algorithm on threads of equal priority. */ #define CH_USE_ROUNDROBIN -- 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-ATmega128-GCC/board.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/board.c b/demos/AVR-ATmega128-GCC/board.c index 0e40c20f4..0a6201eed 100644 --- a/demos/AVR-ATmega128-GCC/board.c +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 4e9abec89..2de244954 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-GCC/chconf.h @@ -51,6 +51,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-ATmega128-GCC/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/board.c b/demos/AVR-ATmega128-GCC/board.c index 0a6201eed..490dd0362 100644 --- a/demos/AVR-ATmega128-GCC/board.c +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 459 ++++++++++++++++++++++++++------------- 1 file changed, 313 insertions(+), 146 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 2de244954..5e787d675 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-GCC/chconf.h @@ -18,6 +18,8 @@ */ /** + * @file src/templates/chconf.h + * @brief Configuration file template. * @addtogroup Config * @{ */ @@ -25,180 +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 enabled then the used of nested @p chSysLock() / - * @p chSysUnlock() operations is allowed.
- * For performance and code size reasons the recommended setting is 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. - */ -//#define CH_USE_NESTED_LOCKS - -/** 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 512 +#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-ATmega128-GCC/chconf.h | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 5e787d675..da4744a16 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 216 ++++++++++++++++++++++++--------------- 1 file changed, 131 insertions(+), 85 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index da4744a16..15ce1a80d 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 15ce1a80d..ff98f4164 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index ff98f4164..2681f9563 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 2681f9563..9c00191cc 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 9c00191cc..b4cccc474 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index b4cccc474..717a0ce09 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/Makefile b/demos/AVR-ATmega128-GCC/Makefile index f291af1fb..c13d60ef9 100644 --- a/demos/AVR-ATmega128-GCC/Makefile +++ b/demos/AVR-ATmega128-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 lcd.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-ATmega128-GCC/Makefile | 10 +++++++--- demos/AVR-ATmega128-GCC/board.c | 4 ++-- demos/AVR-ATmega128-GCC/chconf.h | 10 ---------- demos/AVR-ATmega128-GCC/main.c | 9 +++++++-- 4 files changed, 16 insertions(+), 17 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/Makefile b/demos/AVR-ATmega128-GCC/Makefile index c13d60ef9..4af1c53db 100644 --- a/demos/AVR-ATmega128-GCC/Makefile +++ b/demos/AVR-ATmega128-GCC/Makefile @@ -89,9 +89,10 @@ 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 lcd.c main.c + board.c main.c # List C++ source files here. (C dependencies are automatically generated.) @@ -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-ATmega128-GCC/board.c b/demos/AVR-ATmega128-GCC/board.c index 490dd0362..84e1565cb 100644 --- a/demos/AVR-ATmega128-GCC/board.c +++ b/demos/AVR-ATmega128-GCC/board.c @@ -18,9 +18,9 @@ */ #include +#include #include "board.h" -#include "avr_serial.h" CH_IRQ_HANDLER(TIMER0_COMP_vect) { @@ -82,5 +82,5 @@ void hwinit(void) { /* * Other initializations. */ - serial_init(); + sdInit(); } diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 717a0ce09..cb7da16d3 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index 405770d00..dc3fd33c3 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-GCC/main.c @@ -18,8 +18,8 @@ */ #include +#include #include -#include #include @@ -43,7 +43,7 @@ static void TimerHandler(eventid_t id) { msg_t TestThread(void *p); if (!(PINA & PORTA_BUTTON1)) - TestThread(&SER2); + TestThread(&SD2); } int main(int argc, char **argv) { @@ -61,6 +61,11 @@ int main(int argc, char **argv) { */ chSysInit(); + /* + * Activates the serial driver 2 using the driver default configuration. + */ + sdStart(&SD2, NULL); + /* * This initialization requires the OS already active because it uses delay * APIs inside. -- cgit v1.2.3 From 6cb018ac39eb99ae0668d00cdecfa48f08dfca89 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 27 Aug 2009 15:41:14 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1107 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-ATmega128-GCC/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/Makefile b/demos/AVR-ATmega128-GCC/Makefile index 4af1c53db..c56520b08 100644 --- a/demos/AVR-ATmega128-GCC/Makefile +++ b/demos/AVR-ATmega128-GCC/Makefile @@ -92,7 +92,7 @@ SRC = ${PORTSRC} \ ../../os/io/serial.c \ ../../os/io/platforms/AVR/serial_lld.c \ ../../os/various/evtimer.c \ - board.c main.c + lcd.c board.c main.c # List C++ source files here. (C dependencies are automatically generated.) -- 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-ATmega128-GCC/Makefile | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/Makefile b/demos/AVR-ATmega128-GCC/Makefile index c56520b08..dcc7f7beb 100644 --- a/demos/AVR-ATmega128-GCC/Makefile +++ b/demos/AVR-ATmega128-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 \ lcd.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-ATmega128-GCC/chconf.h | 253 ++++++++++++++++++++++++++------------- 1 file changed, 170 insertions(+), 83 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index cb7da16d3..c4ebe589f 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index c4ebe589f..f962e4c16 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/Makefile | 10 ++-- demos/AVR-ATmega128-GCC/board.c | 22 ++++----- demos/AVR-ATmega128-GCC/board.h | 8 +++- demos/AVR-ATmega128-GCC/halconf.h | 96 +++++++++++++++++++++++++++++++++++++++ demos/AVR-ATmega128-GCC/main.c | 11 ++--- 5 files changed, 121 insertions(+), 26 deletions(-) create mode 100644 demos/AVR-ATmega128-GCC/halconf.h (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/Makefile b/demos/AVR-ATmega128-GCC/Makefile index dcc7f7beb..1ae0a672a 100644 --- a/demos/AVR-ATmega128-GCC/Makefile +++ b/demos/AVR-ATmega128-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 \ lcd.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-ATmega128-GCC/board.c b/demos/AVR-ATmega128-GCC/board.c index 84e1565cb..8a9a69309 100644 --- a/demos/AVR-ATmega128-GCC/board.c +++ b/demos/AVR-ATmega128-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. */ - TCCR0 = (1 << WGM01) | (0 << WGM00) | // CTC mode. - (0 << COM01) | (0 << COM00) | // OC0A disabled (normal I/O). - (1 << CS02) | (0 << CS01) | (0 << CS00); // CLK/64 clock source. + TCCR0 = (1 << WGM01) | (0 << WGM00) | /* CTC mode. */ + (0 << COM01) | (0 << COM00) | /* OC0A disabled. */ + (1 << CS02) | (0 << CS01) | (0 << CS00); /* CLK/64 clock. */ OCR0 = F_CPU / 64 / CH_FREQUENCY - 1; - TCNT0 = 0; // Reset counter. - TIFR = (1 << OCF0); // Reset pending (if any). - TIMSK = (1 << OCIE0); // Interrupt on compare. + TCNT0 = 0; /* Reset counter. */ + TIFR = (1 << OCF0); /* Reset pending. */ + TIMSK = (1 << OCIE0); /* IRQ on compare. */ /* - * Other initializations. + * HAL initialization. */ - sdInit(); + halInit(); } diff --git a/demos/AVR-ATmega128-GCC/board.h b/demos/AVR-ATmega128-GCC/board.h index 97b9c684d..97da17097 100644 --- a/demos/AVR-ATmega128-GCC/board.h +++ b/demos/AVR-ATmega128-GCC/board.h @@ -105,6 +105,12 @@ #define PORTE_BUZZ1 (1 << 4) #define PORTE_BUZZ2 (1 << 5) -void hwinit(void); +#ifdef __cplusplus +extern "C" { +#endif + void hwinit(void); +#ifdef __cplusplus +} +#endif #endif /* _BOARD_H_ */ diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h new file mode 100644 index 000000000..a3d17a3c9 --- /dev/null +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index dc3fd33c3..28d3f1cef 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-GCC/main.c @@ -17,17 +17,12 @@ along with this program. If not, see . */ -#include -#include -#include +#include "ch.h" +#include "hal.h" +#include "evtimer.h" -#include - -#include "board.h" #include "lcd.h" -void hwinit(void); - static WORKING_AREA(waThread1, 32); static msg_t Thread1(void *arg) { -- cgit v1.2.3 From 31f54b93735bca0ef23b68dc1a1cf735800bbf14 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 8 Dec 2009 17:44:03 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1398 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-ATmega128-GCC/lcd.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/lcd.c b/demos/AVR-ATmega128-GCC/lcd.c index eed0c896e..29a4d0c8c 100644 --- a/demos/AVR-ATmega128-GCC/lcd.c +++ b/demos/AVR-ATmega128-GCC/lcd.c @@ -17,11 +17,8 @@ along with this program. If not, see . */ -#include - -#include - -#include "board.h" +#include "ch.h" +#include "hal.h" #include "lcd.h" static void e_pulse(void) { -- 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-ATmega128-GCC/chconf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index f962e4c16..2a4916827 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/Makefile | 31 ++++++----- demos/AVR-ATmega128-GCC/board.c | 84 ---------------------------- demos/AVR-ATmega128-GCC/board.h | 116 --------------------------------------- 3 files changed, 17 insertions(+), 214 deletions(-) delete mode 100644 demos/AVR-ATmega128-GCC/board.c delete mode 100644 demos/AVR-ATmega128-GCC/board.h (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/Makefile b/demos/AVR-ATmega128-GCC/Makefile index 1ae0a672a..3f42dce8e 100644 --- a/demos/AVR-ATmega128-GCC/Makefile +++ b/demos/AVR-ATmega128-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_MT_128/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 \ - lcd.c board.c main.c +SRC = $(PORTSRC) \ + $(KERNSRC) \ + $(TESTSRC) \ + $(HALSRC) \ + $(PLATFORMSRC) \ + $(BOARDSRC) \ + $(CHIBIOS)/os/various/evtimer.c \ + lcd.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-ATmega128-GCC/board.c b/demos/AVR-ATmega128-GCC/board.c deleted file mode 100644 index 8a9a69309..000000000 --- a/demos/AVR-ATmega128-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. - */ - MCUCR = (1 << SE); - - /* - * Timer 0 setup. - */ - TCCR0 = (1 << WGM01) | (0 << WGM00) | /* CTC mode. */ - (0 << COM01) | (0 << COM00) | /* OC0A disabled. */ - (1 << CS02) | (0 << CS01) | (0 << CS00); /* CLK/64 clock. */ - OCR0 = F_CPU / 64 / CH_FREQUENCY - 1; - TCNT0 = 0; /* Reset counter. */ - TIFR = (1 << OCF0); /* Reset pending. */ - TIMSK = (1 << OCIE0); /* IRQ on compare. */ - - /* - * HAL initialization. - */ - halInit(); -} diff --git a/demos/AVR-ATmega128-GCC/board.h b/demos/AVR-ATmega128-GCC/board.h deleted file mode 100644 index 97da17097..000000000 --- a/demos/AVR-ATmega128-GCC/board.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 . -*/ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -#define BOARD_OLIMEX_AVR_MT_128 - -/* PA7 RLY DS B5 B4 B3 B2 B1 - * IN OUT IN IN IN IN IN IN - * DDRA 0 1 0 0 0 0 0 0 - * PU VAL HiZ HiZ HiZ HiZ HiZ HiZ - * PORTA 1 0 0 0 0 0 0 0 - */ -#define VAL_DDRA 0x40 -#define VAL_PORTA 0x80 - -/* - * All inputs with pullups. - */ -#define VAL_DDRB 0x00 -#define VAL_PORTB 0xFF - -/* D7 D6 D5 D4 PC3 E R/W RS - * OUT OUT OUT OUT IN OUT OUT OUT - * DDRC 1 1 1 1 0 1 1 1 - * PU PU PU PU PU VAL VAL VAL - * PORTC 0 0 0 0 1 0 0 0 - */ -#define VAL_DDRC 0xF7 -#define VAL_PORTC 0x08 - -/* PD7 PD6 PD5 PD4 TXD RXD PD1 PD0 - * IN IN IN IN OUT IN IN IN - * DDRD 0 0 0 0 1 0 0 0 - * PU PU PU PU VAL HiZ PU PU - * PORTD 1 1 1 1 1 0 1 1 - */ -#define VAL_DDRD 0x08 -#define VAL_PORTD 0xFB - -/* PE7 PE6 BZ2 BZ2 PE3 PE2 PE1 PE0 - * IN IN OUT OUT IN IN OUT IN - * DDRE 0 0 1 1 0 0 1 0 - * PU PU VAL VAL PU PU VAL PU - * PORTE 1 1 1 1 1 1 1 1 - */ -#define VAL_DDRE 0x32 -#define VAL_PORTE 0xFF - -/* 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 PORTA_BUTTON1 (1 << 0) -#define PORTA_BUTTON2 (1 << 1) -#define PORTA_BUTTON3 (1 << 2) -#define PORTA_BUTTON4 (1 << 3) -#define PORTA_BUTTON5 (1 << 4) -#define PORTA_DALLAS (1 << 5) -#define PORTA_RELAY (1 << 6) - -#define PORTC_44780_RS (1 << 0) -#define PORTC_44780_RW (1 << 1) -#define PORTC_44780_E (1 << 2) -#define PORTC_44780_D4 (1 << 4) -#define PORTC_44780_D5 (1 << 5) -#define PORTC_44780_D6 (1 << 6) -#define PORTC_44780_D7 (1 << 7) -#define PORTC_44780_DATA (PORTC_44780_D4 | PORTC_44780_D5 | \ - PORTC_44780_D6 | PORTC_44780_D7) - -#define PORTE_BUZZ1 (1 << 4) -#define PORTE_BUZZ2 (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-ATmega128-GCC/halconf.h | 56 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 3 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index a3d17a3c9..376dfe816 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index 376dfe816..c0f12c57d 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h | 2 +- demos/AVR-ATmega128-GCC/mcuconf.h | 53 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 demos/AVR-ATmega128-GCC/mcuconf.h (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index c0f12c57d..58d49966f 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/mcuconf.h b/demos/AVR-ATmega128-GCC/mcuconf.h new file mode 100644 index 000000000..017289582 --- /dev/null +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 2a4916827..99548894e 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 4 ++-- demos/AVR-ATmega128-GCC/halconf.h | 10 +++++----- demos/AVR-ATmega128-GCC/lcd.c | 2 +- demos/AVR-ATmega128-GCC/lcd.h | 2 +- demos/AVR-ATmega128-GCC/main.c | 2 +- demos/AVR-ATmega128-GCC/mcuconf.h | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 99548894e..c32d36bdc 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index 58d49966f..bd2f3e4fd 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/lcd.c b/demos/AVR-ATmega128-GCC/lcd.c index 29a4d0c8c..30be58416 100644 --- a/demos/AVR-ATmega128-GCC/lcd.c +++ b/demos/AVR-ATmega128-GCC/lcd.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-ATmega128-GCC/lcd.h b/demos/AVR-ATmega128-GCC/lcd.h index 12ffd127e..3b3cdd050 100644 --- a/demos/AVR-ATmega128-GCC/lcd.h +++ b/demos/AVR-ATmega128-GCC/lcd.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. diff --git a/demos/AVR-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index 28d3f1cef..b63d793b5 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/mcuconf.h b/demos/AVR-ATmega128-GCC/mcuconf.h index 017289582..bd31976f2 100644 --- a/demos/AVR-ATmega128-GCC/mcuconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 215 ++++++++++++++++++++------------------- 1 file changed, 112 insertions(+), 103 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index c32d36bdc..2cda27e83 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/mcuconf.h | 1 - 1 file changed, 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/mcuconf.h b/demos/AVR-ATmega128-GCC/mcuconf.h index bd31976f2..85a8cc2a6 100644 --- a/demos/AVR-ATmega128-GCC/mcuconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 2cda27e83..33dcfdfca 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 6 +++--- demos/AVR-ATmega128-GCC/halconf.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 33dcfdfca..ccab98d65 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index bd2f3e4fd..7859d0f0e 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index 7859d0f0e..de9c05fdf 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 46 ++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 13 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index ccab98d65..2c3129708 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index de9c05fdf..f81870b13 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 2c3129708..8c10de14c 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index f81870b13..de9c05fdf 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h | 228 +++++++++++++++++++++++++++----------- 1 file changed, 164 insertions(+), 64 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index de9c05fdf..2eea483f4 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index 2eea483f4..e355d7bbc 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 8c10de14c..c982a771d 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index b63d793b5..c02ef5404 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-GCC/main.c @@ -41,6 +41,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] = { @@ -48,12 +51,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-ATmega128-GCC/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index c02ef5404..e1cb2a9d6 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-GCC/main.c @@ -44,7 +44,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-ATmega128-GCC/halconf.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index e355d7bbc..999773a20 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index 999773a20..54ecc3c50 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 3 ++- demos/AVR-ATmega128-GCC/halconf.h | 3 ++- demos/AVR-ATmega128-GCC/lcd.c | 3 ++- demos/AVR-ATmega128-GCC/lcd.h | 3 ++- demos/AVR-ATmega128-GCC/main.c | 3 ++- demos/AVR-ATmega128-GCC/mcuconf.h | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index c982a771d..644d792db 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index 54ecc3c50..3bfbca462 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/lcd.c b/demos/AVR-ATmega128-GCC/lcd.c index 30be58416..5ef8fca02 100644 --- a/demos/AVR-ATmega128-GCC/lcd.c +++ b/demos/AVR-ATmega128-GCC/lcd.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-ATmega128-GCC/lcd.h b/demos/AVR-ATmega128-GCC/lcd.h index 3b3cdd050..464bde6c3 100644 --- a/demos/AVR-ATmega128-GCC/lcd.h +++ b/demos/AVR-ATmega128-GCC/lcd.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-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index e1cb2a9d6..0b26a9641 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/mcuconf.h b/demos/AVR-ATmega128-GCC/mcuconf.h index 85a8cc2a6..3267455e1 100644 --- a/demos/AVR-ATmega128-GCC/mcuconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index 3bfbca462..9c1d06fe3 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index 9c1d06fe3..ba3a80121 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 644d792db..3d5fefb9f 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index ba3a80121..d13f55b9d 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index d13f55b9d..82a219d8d 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index 82a219d8d..e3ea70d99 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 3d5fefb9f..b941ca77d 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 1 - 1 file changed, 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index b941ca77d..2568f89ca 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 2568f89ca..15e938e53 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 61 +++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 20 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 15e938e53..cb22265a2 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index cb22265a2..7a50c5b5a 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index e3ea70d99..0b74e6678 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index 0b74e6678..8ec0c2a35 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/.cproject | 237 ++++++++++++++++++++++++++++++++++++++ demos/AVR-ATmega128-GCC/.project | 90 +++++++++++++++ 2 files changed, 327 insertions(+) create mode 100644 demos/AVR-ATmega128-GCC/.cproject create mode 100644 demos/AVR-ATmega128-GCC/.project (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/.cproject b/demos/AVR-ATmega128-GCC/.cproject new file mode 100644 index 000000000..56d3ad8a5 --- /dev/null +++ b/demos/AVR-ATmega128-GCC/.cproject @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demos/AVR-ATmega128-GCC/.project b/demos/AVR-ATmega128-GCC/.project new file mode 100644 index 000000000..d19dece00 --- /dev/null +++ b/demos/AVR-ATmega128-GCC/.project @@ -0,0 +1,90 @@ + + + AVR-ATmega128-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 bede8d6781661d679475d2b60d87fb7f43cc5e8e Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 25 Sep 2011 15:18:18 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3410 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-ATmega128-GCC/.cproject | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/.cproject b/demos/AVR-ATmega128-GCC/.cproject index 56d3ad8a5..68ce07ecb 100644 --- a/demos/AVR-ATmega128-GCC/.cproject +++ b/demos/AVR-ATmega128-GCC/.cproject @@ -27,10 +27,12 @@ @@ -38,10 +40,12 @@ @@ -49,10 +53,12 @@ -- 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-ATmega128-GCC/.cproject | 243 -------------------------------------- demos/AVR-ATmega128-GCC/.project | 90 -------------- 2 files changed, 333 deletions(-) delete mode 100644 demos/AVR-ATmega128-GCC/.cproject delete mode 100644 demos/AVR-ATmega128-GCC/.project (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/.cproject b/demos/AVR-ATmega128-GCC/.cproject deleted file mode 100644 index 68ce07ecb..000000000 --- a/demos/AVR-ATmega128-GCC/.cproject +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/demos/AVR-ATmega128-GCC/.project b/demos/AVR-ATmega128-GCC/.project deleted file mode 100644 index d19dece00..000000000 --- a/demos/AVR-ATmega128-GCC/.project +++ /dev/null @@ -1,90 +0,0 @@ - - - AVR-ATmega128-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-ATmega128-GCC/halconf.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index 8ec0c2a35..b4fb49092 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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 977abf0c51adfac84351ac5c9d93edf4719fd094 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 9 Oct 2011 16:32:08 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3440 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-ATmega128-GCC/lcd.c | 26 ++++++++++++++++---------- demos/AVR-ATmega128-GCC/main.c | 6 +++--- 2 files changed, 19 insertions(+), 13 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/lcd.c b/demos/AVR-ATmega128-GCC/lcd.c index 5ef8fca02..cd8aa5006 100644 --- a/demos/AVR-ATmega128-GCC/lcd.c +++ b/demos/AVR-ATmega128-GCC/lcd.c @@ -25,10 +25,10 @@ static void e_pulse(void) { volatile uint8_t i; - PORTC |= PORTC_44780_E; + PORTC |= PORTC_44780_E_MASK; for (i = 0; i < ELOOPVALUE; i++); ; - PORTC &= ~PORTC_44780_E; + PORTC &= ~PORTC_44780_E_MASK; } static void wait_not_busy(void) { @@ -41,8 +41,9 @@ static void wait_not_busy(void) { */ void lcdInit(void) { - PORTC = (PORTC & ~(PORTC_44780_DATA | PORTC_44780_RS | PORTC_44780_E | PORTC_44780_RW)) | - (LCD_CMD_INIT8 & PORTC_44780_DATA); + PORTC = (PORTC & ~(PORTC_44780_DATA_MASK | PORTC_44780_RS_MASK | + PORTC_44780_E_MASK | PORTC_44780_RW_MASK)) | + (LCD_CMD_INIT8 & PORTC_44780_DATA_MASK); chThdSleep(50); e_pulse(); chThdSleep(10); @@ -50,8 +51,9 @@ void lcdInit(void) { chThdSleep(2); e_pulse(); wait_not_busy(); - PORTC = (PORTC & ~(PORTC_44780_DATA | PORTC_44780_RS | PORTC_44780_E | PORTC_44780_RW)) | - (LCD_CMD_INIT4 & PORTC_44780_DATA); + PORTC = (PORTC & ~(PORTC_44780_DATA_MASK | PORTC_44780_RS_MASK | + PORTC_44780_E_MASK | PORTC_44780_RW_MASK)) | + (LCD_CMD_INIT4 & PORTC_44780_DATA_MASK); e_pulse(); lcdCmd(LCD_CMD_INIT4); lcdCmd(LCD_SET_DM | LCD_DM_DISPLAY_ON); @@ -64,9 +66,11 @@ void lcdInit(void) { void lcdCmd(uint8_t cmd) { wait_not_busy(); - PORTC = (PORTC | PORTC_44780_DATA) & (cmd | (0x0F & ~PORTC_44780_RS)); + PORTC = (PORTC | PORTC_44780_DATA_MASK) & (cmd | + (0x0F & ~PORTC_44780_RS_MASK)); e_pulse(); - PORTC = (PORTC | PORTC_44780_DATA) & ((cmd << 4) | (0x0F & ~PORTC_44780_RS)); + PORTC = (PORTC | PORTC_44780_DATA_MASK) & ((cmd << 4) | + (0x0F & ~PORTC_44780_RS_MASK)); e_pulse(); } @@ -78,9 +82,11 @@ void lcdPutc(char c) { wait_not_busy(); b = c | 0x0F; - PORTC = (PORTC | PORTC_44780_DATA | PORTC_44780_RS) & (c | 0x0F); + PORTC = (PORTC | PORTC_44780_DATA_MASK | PORTC_44780_RS_MASK) & + (c | 0x0F); e_pulse(); - PORTC = (PORTC | PORTC_44780_DATA | PORTC_44780_RS) & ((c << 4) | 0x0F); + PORTC = (PORTC | PORTC_44780_DATA_MASK | PORTC_44780_RS_MASK) & + ((c << 4) | 0x0F); e_pulse(); } diff --git a/demos/AVR-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index 0b26a9641..cd982d1b9 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-GCC/main.c @@ -28,8 +28,8 @@ static WORKING_AREA(waThread1, 32); static msg_t Thread1(void *arg) { while (TRUE) { - if (!(PINA & PORTA_BUTTON2)) - PORTA ^= PORTA_RELAY; + if (!palReadPad(IOPORT1, PORTA_BUTTON2)) + palTogglePad(IOPORT1, PORTA_RELAY); chThdSleepMilliseconds(1000); } return 0; @@ -38,7 +38,7 @@ static msg_t Thread1(void *arg) { static void TimerHandler(eventid_t id) { msg_t TestThread(void *p); - if (!(PINA & PORTA_BUTTON1)) + if (!palReadPad(IOPORT1, PORTA_BUTTON1)) TestThread(&SD2); } -- 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-ATmega128-GCC/main.c | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index cd982d1b9..36b482c4b 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-GCC/main.c @@ -20,7 +20,7 @@ #include "ch.h" #include "hal.h" -#include "evtimer.h" +#include "test.h" #include "lcd.h" @@ -35,22 +35,10 @@ static msg_t Thread1(void *arg) { return 0; } -static void TimerHandler(eventid_t id) { - msg_t TestThread(void *p); - - if (!palReadPad(IOPORT1, PORTA_BUTTON1)) - TestThread(&SD2); -} - /* * Application entry point. */ int main(void) { - static EvTimer evt; - static evhandler_t handlers[1] = { - TimerHandler - }; - static EventListener el0; /* * System initializations. @@ -76,20 +64,14 @@ int main(void) { lcdPuts(LCD_LINE1, " ChibiOS/RT "); lcdPuts(LCD_LINE2, " Hello World! "); - /* - * 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)); - - return 0; + while(TRUE) { + if (!palReadPad(IOPORT1, PORTA_BUTTON1)) + TestThread(&SD2); + chThdSleepMilliseconds(500); + } } -- 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-ATmega128-GCC/halconf.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index b4fb49092..944627bb4 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index 944627bb4..938dd46f3 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 2 +- demos/AVR-ATmega128-GCC/halconf.h | 2 +- demos/AVR-ATmega128-GCC/lcd.c | 2 +- demos/AVR-ATmega128-GCC/lcd.h | 2 +- demos/AVR-ATmega128-GCC/main.c | 2 +- demos/AVR-ATmega128-GCC/mcuconf.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 7a50c5b5a..3733daac8 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index 938dd46f3..eb013c9a7 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/lcd.c b/demos/AVR-ATmega128-GCC/lcd.c index cd8aa5006..f010cced3 100644 --- a/demos/AVR-ATmega128-GCC/lcd.c +++ b/demos/AVR-ATmega128-GCC/lcd.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-ATmega128-GCC/lcd.h b/demos/AVR-ATmega128-GCC/lcd.h index 464bde6c3..64e2c67f2 100644 --- a/demos/AVR-ATmega128-GCC/lcd.h +++ b/demos/AVR-ATmega128-GCC/lcd.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-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index 36b482c4b..0c9fae639 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/mcuconf.h b/demos/AVR-ATmega128-GCC/mcuconf.h index 3267455e1..51cb93729 100644 --- a/demos/AVR-ATmega128-GCC/mcuconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 2 +- demos/AVR-ATmega128-GCC/halconf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 3733daac8..ec84e58af 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index eb013c9a7..c9b3ad25a 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/Makefile b/demos/AVR-ATmega128-GCC/Makefile index 3f42dce8e..0ea8e8cff 100644 --- a/demos/AVR-ATmega128-GCC/Makefile +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index c9b3ad25a..25538a2a8 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index 25538a2a8..3260be7f3 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 2 +- demos/AVR-ATmega128-GCC/halconf.h | 2 +- demos/AVR-ATmega128-GCC/lcd.c | 2 +- demos/AVR-ATmega128-GCC/lcd.h | 2 +- demos/AVR-ATmega128-GCC/main.c | 2 +- demos/AVR-ATmega128-GCC/mcuconf.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index ec84e58af..f3f8e60cc 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index 3260be7f3..9bff08736 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/lcd.c b/demos/AVR-ATmega128-GCC/lcd.c index f010cced3..101e89e26 100644 --- a/demos/AVR-ATmega128-GCC/lcd.c +++ b/demos/AVR-ATmega128-GCC/lcd.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-ATmega128-GCC/lcd.h b/demos/AVR-ATmega128-GCC/lcd.h index 64e2c67f2..37f7bc40a 100644 --- a/demos/AVR-ATmega128-GCC/lcd.h +++ b/demos/AVR-ATmega128-GCC/lcd.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-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index 0c9fae639..1824bc5ea 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/mcuconf.h b/demos/AVR-ATmega128-GCC/mcuconf.h index 51cb93729..e045be09d 100644 --- a/demos/AVR-ATmega128-GCC/mcuconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/chconf.h | 24 ++++++++++-------------- demos/AVR-ATmega128-GCC/halconf.h | 24 ++++++++++-------------- demos/AVR-ATmega128-GCC/lcd.c | 24 ++++++++++-------------- demos/AVR-ATmega128-GCC/lcd.h | 24 ++++++++++-------------- demos/AVR-ATmega128-GCC/main.c | 24 ++++++++++-------------- demos/AVR-ATmega128-GCC/mcuconf.h | 24 ++++++++++-------------- 6 files changed, 60 insertions(+), 84 deletions(-) (limited to 'demos/AVR-ATmega128-GCC') diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index f3f8e60cc..253eadaa5 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/halconf.h b/demos/AVR-ATmega128-GCC/halconf.h index 9bff08736..3858828e6 100644 --- a/demos/AVR-ATmega128-GCC/halconf.h +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/lcd.c b/demos/AVR-ATmega128-GCC/lcd.c index 101e89e26..d0415b83f 100644 --- a/demos/AVR-ATmega128-GCC/lcd.c +++ b/demos/AVR-ATmega128-GCC/lcd.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-ATmega128-GCC/lcd.h b/demos/AVR-ATmega128-GCC/lcd.h index 37f7bc40a..c86d90dc1 100644 --- a/demos/AVR-ATmega128-GCC/lcd.h +++ b/demos/AVR-ATmega128-GCC/lcd.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. */ #ifndef _LCD_H_ diff --git a/demos/AVR-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index 1824bc5ea..756e7fe6a 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-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-ATmega128-GCC/mcuconf.h b/demos/AVR-ATmega128-GCC/mcuconf.h index e045be09d..d3c05d25b 100644 --- a/demos/AVR-ATmega128-GCC/mcuconf.h +++ b/demos/AVR-ATmega128-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