winavr_ucos276

所属分类:单片机开发
开发工具:C/C++
文件大小:120KB
下载次数:96
上传日期:2006-02-08 19:00:37
上 传 者沧海2017
说明:  ucosII2.76在winavr(20050214版本)下的程序包,用pn打开目录下的工程,运行make all工具即可编译可用,绝对可用. winavr如用2006版本,需要把文件中包含文件signal.h改为interrupt.h(可能在includes.h中改一处即可)
(ucosII2.76 in winavr (20050214 version) under the package, pn Open directory with the project, run can make all tools available compiler, absolutely available. winavr As the 2006 version, the need to document contains documents signal.h read interrupt.h (possibly in inclu des.h which can be changed a))

文件列表:
winavr_ucos276\includes.h (1234, 2003-07-21)
winavr_ucos276\includes.h.252 (1222, 2003-07-21)
winavr_ucos276\makefile (10734, 2005-10-22)
winavr_ucos276\makefile.252 (10695, 2003-07-21)
winavr_ucos276\makefile.bak (10736, 2005-10-22)
winavr_ucos276\os_cfg.h (9013, 2005-10-22)
winavr_ucos276\test.c (15095, 2005-10-22)
winavr_ucos276\test.pnproj (58, 2005-10-22)
winavr_ucos276\Micrium\Software\uCOS_II\Ports\AVR\ATmega128\GNU\jlu\avr_isr.h (5260, 2003-06-24)
winavr_ucos276\Micrium\Software\uCOS_II\Ports\AVR\ATmega128\GNU\jlu\os_cpu.h (4320, 2003-02-19)
winavr_ucos276\Micrium\Software\uCOS_II\Ports\AVR\ATmega128\GNU\jlu\os_cpu_a.asm (19835, 2003-07-21)
winavr_ucos276\Micrium\Software\uCOS_II\Ports\AVR\ATmega128\GNU\jlu\os_cpu_c.c (13307, 2003-07-21)
winavr_ucos276\Micrium\Software\uCOS_II\Ports\AVR\ATmega128\GNU\jlu\os_dbg.c (10323, 2003-12-20)
winavr_ucos276\Micrium\Software\uCOS_II\Ports\AVR\ATmega128\GNU\jlu\doc (0, 2006-02-08)
winavr_ucos276\Micrium\Software\uCOS_II\Ports\AVR\ATmega128\GNU\jlu\STK500\includes.h (1234, 2003-07-21)
winavr_ucos276\Micrium\Software\uCOS_II\Ports\AVR\ATmega128\GNU\jlu\STK500\includes.h.252 (1222, 2003-07-21)
winavr_ucos276\Micrium\Software\uCOS_II\Ports\AVR\ATmega128\GNU\jlu\STK500\makefile (10703, 2003-07-21)
winavr_ucos276\Micrium\Software\uCOS_II\Ports\AVR\ATmega128\GNU\jlu\STK500\makefile.252 (10695, 2003-07-21)
winavr_ucos276\Micrium\Software\uCOS_II\Ports\AVR\ATmega128\GNU\jlu\STK500\os_cfg.h (8978, 2003-07-21)
winavr_ucos276\Micrium\Software\uCOS_II\Ports\AVR\ATmega128\GNU\jlu\STK500\test.c (15085, 2003-07-21)
winavr_ucos276\Micrium\Software\uCOS_II\Ports\AVR\ATmega128\GNU\jlu\STK500 (0, 2006-02-08)
winavr_ucos276\Micrium\Software\uCOS_II\Ports\AVR\ATmega128\GNU\jlu (0, 2006-02-08)
winavr_ucos276\Micrium\Software\uCOS_II\Ports\AVR\ATmega128\GNU (0, 2006-02-08)
winavr_ucos276\Micrium\Software\uCOS_II\Ports\AVR\ATmega128 (0, 2006-02-08)
winavr_ucos276\Micrium\Software\uCOS_II\Ports\AVR (0, 2006-02-08)
winavr_ucos276\Micrium\Software\uCOS_II\Ports (0, 2006-02-08)
winavr_ucos276\Micrium\Software\uCOS_II\Source\os_cfg_r.h (8561, 2004-01-14)
winavr_ucos276\Micrium\Software\uCOS_II\Source\os_core.c (68255, 2003-12-20)
winavr_ucos276\Micrium\Software\uCOS_II\Source\os_dbg_r.c (10323, 2003-12-20)
winavr_ucos276\Micrium\Software\uCOS_II\Source\os_flag.c (54008, 2003-12-20)
winavr_ucos276\Micrium\Software\uCOS_II\Source\os_mbox.c (25351, 2003-12-20)
winavr_ucos276\Micrium\Software\uCOS_II\Source\os_mem.c (18700, 2003-12-20)
winavr_ucos276\Micrium\Software\uCOS_II\Source\os_mutex.c (29981, 2003-12-20)
winavr_ucos276\Micrium\Software\uCOS_II\Source\os_q.c (37340, 2003-12-20)
winavr_ucos276\Micrium\Software\uCOS_II\Source\os_sem.c (23622, 2004-02-03)
winavr_ucos276\Micrium\Software\uCOS_II\Source\os_task.c (49686, 2004-02-03)
... ...

Test and example program for uC/OS-II and avr-gcc 3.x ----------------------------------------------------- If you have version 2.52 of uC/OS-II (the one which comes with the book) or any version other than 2.70, see notes at the end of this document! This is a test and example program to be used with uC/OS-II version 2.70, Atmel's ATmega 128 and avr-gcc version 3.x. This example is a modification of the example #1 in Labrosse's book. The modifications to AVR were originally made by Ole Saether for the IAR compiler and ported to gcc version 2.95 by Jesper Hansen. I have made a number of changes to the program including, but not limited to: - ISR programming is done using a macro UCOSISR(), which is defined in avr_isr.h (by me). avr_isr.h is included in the port. - ISR code is changed a bit to conform to the requirements of uC/OS-II as documented by Labrosse's book. The general structure of an ISR using my macros is UCOSISR(validsignalname) { PushRS(); OSIntEnter(); if (OSIntNesting == 1) OSTCBCur->OSTCBStkPtr = (OS_STK *)SP; /* Do what you want the ISR to do */ sei(); OSIntExit(); PopRS(); } UCOSISR() is used instead of macros SIGNAL() and INTERRUPT() from avr-libc. DO NOT use SIGNAL() or INTERRUPT() with uC/OS-II, since they save only the used registers on the stack, whereas uC/OS-II requires that all the registers are saved. If a task switch is needed after or during the ISR, the context of the current task will be trashed the next time it is run. You can use SIGNAL(), since it does not enable interrupts during the ISR, but then you MUST NOT use any of the services provided by uC/OS-II. Thus, if you must e.g. signal a task using a semaphore, UCOSISR() is the only way to do it. - PushRS() and PopRS() are also macros provided by avr_isr.h. The push and pop all the registers to or from the stack. - sei() is a macro provided by avr-libc (by including avr/interrupt.h). SP (stack pointer) is also provided by avr-libc in avr/io.h (or the correct io*.h file included by avr/io.h) - I use UART Data Register Empty Interrupt instead of UART Transmit Complete Interrupt. The main part of the ISR is thus changed a bit and PutChar also. - I/O-ports are accessed using the now preferred syntax, e.g. TCCR0=0; /* before: outb(TCCR0,0) or outp(0,TCCR0) */ UCSR0B &= ~_BV(UDRIE0); /* before: outb(UCSR0B,inb(UCSR0B) &~ (1<
近期下载者

相关文件


收藏者